@import url("/fonts/fonts.css");

:root {
  color-scheme: light;
  --background: #f8f7f3;
  --surface: #fff;
  --ink: #262624;
  --muted: #77756f;
  --line: #dfddd6;
  --accent: #c64f35;
  --soft: #efece5;
  --sans: "DM Sans", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --reader-font: "Source Serif 4", Georgia, serif;
  --reader-size: 1.12rem;
  --reader-toolbar-height: 58px;
  --radius: 4px;
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* Safe-area and z-index scale */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --floating-offset: max(16px, var(--safe-bottom));
  --touch-target-min: 44px;
  --mobile-tab-gutter: 24px;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
  --card-stack-gap: 32px;
  --verse-preview-min-height: 104px;
  --z-nav: 20;
  --z-sticky: 100;
  --z-floating: 200;
  --z-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;
}
/* Safe-area & floating utilities */
/* Use these helpers on fixed/floating elements to honor device insets and
  keep spacing consistent across breakpoints. */
.floating--bottom { position: fixed; bottom: max(12px, var(--floating-offset)); right: 16px; left: auto; z-index: var(--z-floating); }
.floating--top { position: fixed; top: max(12px, var(--safe-top)); left: 16px; right: 16px; z-index: var(--z-floating); }
.safe-padding { padding-bottom: calc(var(--floating-offset) + 8px); }
.z-nav { z-index: var(--z-nav); }
.z-sticky { z-index: var(--z-sticky); }
.z-floating { z-index: var(--z-floating); }
.z-modal { z-index: var(--z-modal); }

[data-theme="dark"] { color-scheme: dark; --background: #181817; --surface: #222220; --ink: #eeeae2; --muted: #aaa69d; --line: #3d3b37; --soft: #2c2a27; --accent: #e58067; }
[data-theme="dark"] .daily-card, [data-theme="dark"] .communion-top-card { box-shadow: 0 1px 4px rgba(0,0,0,.4); }
[data-theme="dark"] .communion-archive-item { background: color-mix(in srgb, var(--ink) 3%, transparent); }
[data-theme="dark"] .communion-archive-item:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--background); overscroll-behavior: none; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overscroll-behavior-y: none; }
button { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.communion-top-tab:focus-visible { outline-offset: -2px; }
svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

/* ── Header ── */
.site-header { position: sticky; z-index: var(--z-nav); top: calc(var(--safe-top) + 0px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 74px; padding: 0 40px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--background) 92%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.wordmark { color: inherit; font: 600 1.2rem var(--serif); text-decoration: none; }
.primary-tabs { align-self: stretch; display: flex; gap: clamp(24px, 3.5vw, 42px); }
.primary-tabs a, .mobile-tabs a { position: relative; display: grid; place-items: center; color: var(--muted); font-size: .84rem; font-weight: 500; text-decoration: none; transition: color .2s var(--ease); }
.primary-tabs a.active { color: var(--ink); }
.primary-tabs a.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--ink); content: ""; }
.header-actions { justify-self: end; display: flex; gap: 4px; }
.icon-button { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; transition: background .2s var(--ease), transform .1s var(--ease); }
.icon-button:hover { background: var(--soft); }
.icon-button:active { transform: scale(.9); }
.back-link { color: inherit; text-underline-offset: 3px; transition: color .2s var(--ease); }
.back-link:hover { color: var(--ink); }

/* ── Layout ── */
.view { width: min(100% - 40px, 820px); margin: 0 auto; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: .65rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

/* ── Hero ── */
.daily-hero { padding: clamp(48px, 6vh, 64px) 0 28px; text-align: center; }
.daily-hero h1, .chapter-header h1 { margin: 0; font: 600 clamp(2.8rem, 8vw, 5.5rem)/1 var(--serif); letter-spacing: -.045em; }
.daily-intro { max-width: 480px; margin: 16px auto 0; color: var(--muted); line-height: 1.65; font-size: .95rem; }

/* ── Cards ── */
.daily-card { margin-bottom: 32px; padding: clamp(28px, 4vw, 40px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.daily-card h2 { margin: 0 0 20px; font: 600 1.45rem var(--serif); text-align: center; }
.daily-card .eyebrow { text-align: center; }
.daily-card .daily-intro { text-align: center; }
.daily-passage { text-align: center; }

/* ── Scripture ── */
.scripture { font: 400 var(--reader-size)/1.9 var(--reader-font); }
.daily-passage p, .verse,
.communion-preview p { display: inline; margin: 0; }
.daily-passage p:not(:last-child)::after, .verse:not(:last-child)::after,
.communion-preview p:not(:last-child)::after { content: " "; }
.line-by-line .daily-passage p, .line-by-line .verse,
.line-by-line .communion-preview p { display: block; margin: 0 0 1em; }
.line-by-line .daily-passage p::after, .line-by-line .verse::after,
.line-by-line .communion-preview p::after { content: none; }
.verse-number { display: inline-block; margin-right: .65em; color: var(--accent); font: 600 .63em var(--sans); letter-spacing: .1em; text-decoration: none; text-transform: uppercase; vertical-align: super; }
.line-by-line .verse-number { min-width: 1.6em; }

/* ── Buttons ── */
.daily-actions { display: flex; justify-content: center; gap: 10px; margin-top: 28px; padding: 28px 0; border-top: 1px solid var(--line); }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; cursor: pointer; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease), transform .1s var(--ease), box-shadow .2s var(--ease); min-height: var(--touch-target-min); }
.button:hover { border-color: var(--ink); }
.button:active { transform: scale(.97); }
.button.primary { border-color: var(--ink); background: var(--ink); color: var(--background); text-transform: uppercase; letter-spacing: .07em; }
.button.primary:hover { opacity: .88; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.button.primary:active { transform: scale(.97); opacity: .82; }

/* Honeypot anti-spam field: visually and programmatically hidden from people. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* ── Reader toolbar ── */
.reader-toolbar { position: sticky; z-index: var(--z-sticky); top: calc(74px + var(--safe-top)); display: grid; min-height: var(--reader-toolbar-height); grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--background) 92%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: transform .25s var(--ease), opacity .25s var(--ease); }
/* Book/Chapter selector stays visible in the reader and auto-hides with the
   controls while scrolling (see the mobile-controls rule below). */
.translation { min-width: 0; padding: 14px 16px; border: 0; border-right: 1px solid var(--line); background: transparent; text-align: center; cursor: pointer; transition: background .15s var(--ease); }
.selector { min-width: 0; padding: 14px 16px; border: 0; border-right: 1px solid var(--line); background: transparent; text-align: center; cursor: pointer; transition: background .15s var(--ease); }
.selector:hover, .translation:hover { background: var(--soft); }
.selector strong, .translation strong { display: block; overflow: hidden; font: 600 .9rem var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.selector strong { color: var(--accent); font: 600 .76rem var(--sans); letter-spacing: .12em; text-transform: uppercase; }

/* ── Chapter header ── */
.chapter-header { padding: 58px 0 42px; text-align: center; }
.chapter-header h2 { margin: 14px 0 0; font: 600 1.2rem/1.35 var(--serif); }
.chapter-introduction { max-width: 620px; margin: 12px auto 0; color: var(--muted); font-size: .8rem; line-height: 1.65; }
.chapter-header p:last-child { margin: 14px 0 0; color: var(--muted); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.chapter-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; }
.chapter-meta-button, .chapter-audio-button { display: inline-flex; align-items: center; justify-content: center; padding: 0; margin: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: color .2s var(--ease); }
.chapter-meta-button { color: var(--accent); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-family: inherit; }
.chapter-audio-button { width: 44px; height: 44px; }
.chapter-audio-button svg { width: 15px; height: 15px; transform: translateX(1px); }
.chapter-meta-button:hover, .chapter-audio-button:hover { color: var(--ink); }
.audio-spinner { width: 16px; height: 16px; border: 2px solid color-mix(in srgb, currentColor 22%, transparent); border-top-color: currentColor; border-radius: 50%; animation: audio-spin .75s linear infinite; }
@keyframes audio-spin { to { transform: rotate(360deg); } }

/* ── Verses ── */
.verse { scroll-margin-top: 110px; border-radius: var(--radius); padding: 2px 4px; margin: -2px -4px; transition: background-color .2s var(--ease), box-shadow .2s var(--ease); -webkit-tap-highlight-color: transparent; }
.verse:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent); }
.verse:target { background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }

/* ── Chapter nav ── */
.chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 70px 0 90px; padding-top: 20px; border-top: 1px solid var(--line); }
.chapter-nav button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 18px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: center; transition: border-color .2s var(--ease), background .2s var(--ease), transform .1s var(--ease); min-height: 44px; }
.chapter-nav button:last-child { text-align: center; }
.chapter-nav button:hover { border-color: var(--ink); }
.chapter-nav button:active { transform: scale(.97); }
.chapter-nav span { color: var(--muted); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; }
.chapter-nav strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); }
.chapter-nav button:disabled { visibility: hidden; }

/* When mobile controls are visible, float the chapter play button so it's reachable
   while respecting safe-area insets. Also add bottom padding to the main view so
   the control doesn't obscure content. */
body.mobile-controls-visible .chapter-audio-button {
  position: fixed;
  right: 16px;
  bottom: max(12px, var(--floating-offset));
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--surface);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: var(--z-floating);
  color: var(--ink);
}

/* Ensure the centered content is padded above the floating control on small screens */
body.mobile-controls-visible .view {
  padding-bottom: calc(var(--floating-offset) + 96px);
}

/* ── Home footer ── */
.home-footer { display: flex; justify-content: center; margin: -20px 0 0; padding: 24px 0 70px; font-size: .82rem; }
.home-footer-links { display: flex; gap: 24px; justify-content: center; }
.home-footer a { color: var(--muted); text-underline-offset: 3px; transition: color .2s var(--ease); }
.home-footer a:hover { color: var(--ink); }
.mobile-tabs { display: none; }

/* ── Dialogs ── */
dialog { position: fixed; top: max(16px, var(--safe-top)); bottom: auto; width: min(680px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 32px)); margin: 0 auto; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #0005; }
dialog::backdrop { background: #111b; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog[open] { animation: dialog-show .22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
dialog[open]::backdrop { animation: backdrop-show .22s ease forwards; }
@keyframes dialog-show { from { opacity: 0; transform: scale(.96) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes backdrop-show { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-slide-up { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid var(--line); }
.dialog-header > div:not(.spacer) { flex: 1; min-width: 0; text-align: center; }
.spacer { flex: 0 0 44px; width: 44px; min-width: 44px; max-width: 44px; }
.dialog-header h2 { margin: 0; font: 600 1.25rem var(--serif); color: var(--ink); text-align: center; }

/* ── Archive dialog ── */
.archive-content { min-height: 0; padding: 25px; overflow-y: auto; flex: 1 1 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.archive-dialog[open] { display: flex; flex-direction: column; height: min(760px, calc(100dvh - 32px)); }
.archive-reading { margin-bottom: 0; }
.archive-reading .scripture { line-height: 1.85; }
.archive-reading-reference { margin: 0 0 12px; }
.archive-kept-list { display: grid; gap: 0; }
.archive-kept-item { display: flex; flex-direction: column; padding: 22px 0 24px; border-bottom: 1px solid color-mix(in srgb, var(--line) 68%, transparent); }
.archive-kept-item:first-child { padding-top: 0; }
.archive-kept-item:last-child { border-bottom: 0; padding-bottom: 0; }
.archive-kept-link { color: inherit; text-decoration: none; transition: background .2s var(--ease), transform .15s var(--ease); }
.archive-kept-link:hover { background: color-mix(in srgb, var(--ink) 2%, transparent); }
.archive-kept-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--radius-sm); }
.archive-kept-reference { margin-bottom: 10px; text-transform: uppercase; }
/* Offer-dialog preview always flows inline with verse numbers (ignores line-by-line). */
.line-by-line .offer-dialog .communion-preview p { display: inline; margin: 0; }
.line-by-line .offer-dialog .communion-preview p:not(:last-child)::after { content: " "; }
/* Archive popup header centered (eyebrow + date) */
.archive-dialog .dialog-header { position: relative; justify-content: space-between; }
.dialog-header .eyebrow { margin-bottom: 7px; }
.archive-kept-text { font-size: 1.02rem; line-height: 1.85; }
.archive-kept-text p { display: block; margin: 0 0 10px; }
.archive-kept-text p:last-child { margin-bottom: 0; }
.archive-kept-text .verse-number { color: var(--muted); font-size: .9rem; font-weight: 500; margin-right: 6px; }
.archive-note { margin-bottom: 20px; padding: 14px 16px; background: color-mix(in srgb, var(--ink) 3%, transparent); border-radius: var(--radius-md); border-left: 3px solid var(--accent); }
.archive-note p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.archive-chapters { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }
.archive-chapters .eyebrow { margin-bottom: 10px; text-align: center; }
.archive-chapters .button { margin: 0 8px 8px 0; }

/* ── Book picker ── */
.book-picker { max-height: 600px; overflow-y: auto; }
.book-picker h3 { margin: 0; padding: 18px 25px 8px; color: var(--muted); font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; }
.book-picker button { display: flex; width: 100%; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 13px 25px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; transition: background .15s var(--ease), transform .1s var(--ease); min-height: 44px; }
.book-picker button:hover { background: var(--soft); }
.book-picker button:active { transform: scale(.99); }
.book-picker strong { font-family: var(--serif); }
.book-details { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.book-details small, .book-chapters { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.book-chapters { flex: 0 0 auto; white-space: nowrap; }

/* ── Translation info ── */
.translation-info { padding: 30px 25px; }
.translation-info h3 { margin: 0 0 12px; font: 600 1.25rem var(--serif); }
.translation-info p { margin: 0 0 12px; color: var(--muted); font-size: .82rem; line-height: 1.7; }
.translation-info p:last-child { margin-bottom: 0; }

/* ── Chapter picker ── */
.chapter-picker { max-height: 600px; padding: 25px; overflow-y: auto; }
.picker-introduction { margin: 0 0 20px; color: var(--muted); font-size: .8rem; line-height: 1.65; }
.chapter-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.chapter-grid button { aspect-ratio: 1; border: 1px solid var(--line); background: var(--background); cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease), transform .1s var(--ease); display: inline-grid; place-items: center; padding: 6px; font-size: .95rem; min-height: var(--touch-target-min); }
.chapter-grid button:hover, .chapter-grid button.active { border-color: var(--ink); background: var(--ink); color: var(--background); }
.chapter-grid button:active { transform: scale(.95); }

/* ── Settings dialog ── */
.settings-dialog[open] { display: flex; height: min(760px, calc(100dvh - 32px)); max-height: min(760px, calc(100dvh - 32px)); flex-direction: column; }
.settings-dialog .dialog-header { flex: 0 0 auto; }
.settings-content { flex: 1 1 auto; min-height: 0; padding: 0 25px 25px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.setting-section { padding: 25px 0; border-bottom: 1px solid var(--line); }
.setting-section:last-child { padding-bottom: 0; border-bottom: 0; }
.setting-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.setting-heading h3 { margin: 0 0 4px; font-size: .86rem; }
.setting-heading p { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.setting-heading > strong { color: var(--accent); font-size: .8rem; }
.size-controls { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; min-height: 62px; border: 1px solid var(--line); }
.size-controls button { width: 48px; height: 48px; border: 0; background: var(--soft); cursor: pointer; font-size: 1.35rem; transition: background .15s var(--ease), color .15s var(--ease), transform .1s var(--ease); }
.size-controls button:hover:not(:disabled) { background: var(--ink); color: var(--background); }
.size-controls button:active:not(:disabled) { transform: scale(.92); }
.size-controls button:disabled { color: var(--muted); cursor: not-allowed; opacity: .45; }
.size-preview { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 14px 12px; border-right: 1px solid var(--line); border-left: 1px solid var(--line); line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.preview-reference { color: var(--accent); font: 600 .55rem var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.font-options { display: grid; gap: 8px; }
.font-options button { display: grid; grid-template-columns: 48px minmax(0, 1fr) 18px; align-items: flex-start; gap: 14px; padding: 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; transition: border-color .15s var(--ease), background .15s var(--ease), transform .1s var(--ease); min-height: var(--touch-target-min); }
.font-options button:hover, .font-options button.active { border-color: var(--ink); background: var(--soft); }
.font-options button:active { transform: scale(.98); }
.font-options button > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.font-options small { color: var(--muted); font-size: .67rem; }
.font-options i { width: 13px; height: 13px; border: 1px solid var(--muted); border-radius: 50%; transition: border-color .15s var(--ease); }
.font-options button.active i { border: 4px solid var(--accent); }
.font-sample { font-size: 1.35rem; }
.source-font { font-family: "Source Serif 4", Georgia, serif; }
.baskerville-font { font-family: "Libre Baskerville", Georgia, serif; }
.atkinson-font { font-family: "Atkinson Hyperlegible", sans-serif; }
.lexend-font { font-family: "Lexend", sans-serif; }
.setting-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.audio-setting-row { margin-bottom: 24px; }
.setting-toggle-row .setting-heading { margin-bottom: 0; }
.voice-selector { width: 180px; padding: 10px 12px; text-align: left; flex-shrink: 0; }
.voice-selector:disabled { color: var(--muted); cursor: not-allowed; }
.speed-controls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.speed-button { padding: 10px 12px; }
.speed-button:active { transform: scale(.96); }
.speed-button.active { border-color: var(--accent); background: var(--soft); }
.switch { position: relative; flex: 0 0 auto; width: 44px; height: 25px; padding: 2px; border: 0; border-radius: 20px; background: var(--muted); cursor: pointer; transition: background .2s var(--ease); }
.switch span { display: block; width: 21px; height: 21px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] span { transform: translateX(19px); }
.data-actions { display: flex; gap: 10px; margin-top: 14px; }
.data-action-button { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 56px; }
.import-label { position: relative; text-align: center; cursor: pointer; overflow: hidden; }
.import-label input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; clip-path: inset(50%); }
.hide-verse-numbers .verse-number, .hide-verse-numbers .preview-reference { display: none; }
.hide-verse-numbers .kept-verse-text .verse-number, .hide-verse-numbers .archive-kept-text .verse-number { display: inline; }
.toast { position: fixed; z-index: var(--z-toast); bottom: max(25px, var(--safe-bottom), 20px); left: 50%; padding: 12px 20px; border-radius: 24px; background: var(--ink); color: var(--background); font-size: .8rem; font-weight: 500; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .25s var(--ease); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#update-banner { z-index: var(--z-toast); }
#update-banner button { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 6px 14px; border-radius: 8px; font-size: .82rem; font-weight: 600; cursor: pointer; }
#update-banner button:active { background: rgba(255,255,255,.35); }
.update-available .site-header { padding-top: calc(var(--safe-top) + 48px); }
.muted { color: var(--muted); }
.loading, .fatal { color: var(--muted); text-align: center; }
.loading { display: grid; place-items: center; gap: 10px; animation: loading-pulse 1.5s ease-in-out infinite; }
.loading::before { content: ""; width: 18px; height: 18px; border: 2px solid color-mix(in srgb, var(--muted) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: audio-spin .75s linear infinite; }
@keyframes loading-pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.fatal { margin: 80px 20px; }

/* ── Static pages (about, church, privacy, archive) ── */
.policy-header { grid-template-columns: 1fr auto; }
.policy-page { width: min(100% - 40px, 820px); margin: 0 auto; }
.policy-hero h1 { margin: 0; font: 600 clamp(2.8rem, 8vw, 5.5rem)/1 var(--serif); letter-spacing: -.045em; }
.policy-content { padding: clamp(26px, 6vw, 54px); }
.policy-content section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.policy-content section:first-child { padding-top: 0; }
.policy-content section:last-child:not(.about-footnote) { padding-bottom: 0; border-bottom: 0; }
.policy-content h2 { margin: 0 0 14px; font: 600 1.35rem var(--serif); letter-spacing: -.01em; text-align: center; }
.policy-content p { margin: 0 0 14px; color: var(--muted); line-height: 1.75; font-size: .92rem; }
.policy-content p:last-child { margin-bottom: 0; }
.about-page { width: min(100% - 40px, 760px); margin: 0 auto 48px; }
.about-hero h1 { margin: 0; font: 600 clamp(2.8rem, 8vw, 5.5rem)/1 var(--serif); letter-spacing: -.045em; }
.about-content { padding: clamp(22px, 5vw, 44px); display: flex; flex-direction: column; gap: 8px; }
.about-content section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.about-content section:first-child { padding-top: 0; }
.about-content section:last-child:not(.about-footnote) { padding-bottom: 0; border-bottom: 0; }
.about-content h2 { margin: 0 0 14px; font: 600 1.25rem var(--serif); letter-spacing: -.01em; }
.about-content p { margin: 0 0 14px; color: var(--muted); line-height: 1.75; font-size: .92rem; }
.about-content p:last-child { margin-bottom: 0; }
.about-content em { color: var(--ink); font-style: italic; }
.about-note { color: var(--muted); }
.about-mark { color: var(--ink); font-family: var(--serif); font-style: italic; }
.about-support { border-bottom: 0; }
.about-content section.about-footnote,
.policy-content section.about-footnote { border-bottom: 0; }
.about-footnote { margin-top: 22px; padding-top: 18px; padding-bottom: 48px; font-size: .82rem; text-align: center; }
.about-footnote,
.about-footnote p { display: flex; justify-content: center; gap: 20px; }
.about-footnote a { color: var(--muted); text-underline-offset: 3px; transition: color .2s var(--ease); }
.about-footnote a:hover { color: var(--ink); }

/* ── Suggestions ── */
.suggestion-form { display: grid; max-width: 560px; gap: clamp(14px, 2.6vw, 18px); margin: 16px auto 0; text-align: center; }
.suggestion-form input,
.suggestion-form textarea { text-align: left; }
.suggestion-field { display: grid; gap: 8px; }
.suggestion-field input,
.suggestion-field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  color: var(--ink);
  font: 400 .95rem/1.5 var(--sans);
  resize: vertical;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.suggestion-field input::placeholder,
.suggestion-field textarea::placeholder { color: color-mix(in srgb, var(--muted) 88%, transparent); text-align: left; }
.suggestion-field input:focus,
.suggestion-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.suggestion-field textarea { min-height: 160px; }
.suggestion-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.suggestion-status { min-height: 1.4em; margin: 0; font-size: .82rem; line-height: 1.6; color: var(--muted); }
.suggestion-status.is-error { color: var(--accent); }
.suggestion-status.is-success { color: var(--accent); }
.suggestion-submit { justify-self: start; min-width: 170px; }
.support-cta { text-align: center; margin-top: 8px; }
.support-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 20px 0 24px; }
.wallet-card { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--ink) 3%, transparent); cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease), transform .1s var(--ease), box-shadow .2s var(--ease); font: inherit; text-align: center; text-decoration: none; color: inherit; }
.wallet-card:hover { border-color: var(--accent); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.wallet-card:active { transform: scale(.99); }
.wallet-card.is-copied { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.wallet-card .eyebrow { margin: 0 0 6px; }
.wallet-card code { display: block; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: .82rem; word-break: break-all; user-select: all; font-family: monospace; }

/* ══════════════════════════════════════
   COMMUNION
   ══════════════════════════════════════ */

/* ── Offering card ── */
.communion-top-card { margin-bottom: 24px; border-top: 2px solid var(--accent); border-radius: var(--radius); }
.communion-top-card + .communion-tab-card { margin-top: 0; }
.communion-top-tab-bar { display: flex; gap: 3px; margin-bottom: 16px; background: color-mix(in srgb, var(--ink) 4%, transparent); border-radius: 6px; padding: 2px; }
.communion-top-tab { flex: 1; padding: 10px 16px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: 600; transition: color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease); min-height: 44px; letter-spacing: .01em; }
.communion-top-tab:hover { color: var(--ink); }
.communion-top-tab.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.08); transform: scale(1.01); }

/* ── Anchor header ── */
.communion-anchor-header { margin-bottom: 14px; }
.communion-anchor-header h2 { margin: 0 0 8px; font: 600 1.15rem var(--serif); }
.communion-anchor-header .eyebrow { margin-bottom: 2px; }
.communion-anchor-actions { display: flex; gap: 12px; }
.communion-offer-desc { margin: 0 0 4px; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.communion-offer-panel { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.communion-status { min-height: 1.4em; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.communion-status.is-locked { color: var(--accent); font-weight: 600; }
.communion-count { margin: 10px 0 0; color: var(--muted); font-size: .78rem; }
#communion-top-communion { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
#communion-top-communion .communion-anchor-header { margin-bottom: 0; }

/* ── Section titles ── */
.communion-section-title { margin: 0 0 16px; font: 600 1.15rem var(--serif); }

/* ── Offering form ── */
.communion-form { display: grid; gap: 14px; }
.communion-form .form-row { display: grid; gap: 8px; }
.communion-form .form-row select,
.communion-form .form-row input {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--ink);
  font-size: .95rem;
  min-height: 44px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.communion-form .form-row select:focus,
.communion-form .form-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.communion-form .form-row label { font-size: .82rem; color: var(--muted); font-weight: 500; }
.communion-preview { padding: 0; background: transparent; border-radius: 0; line-height: 1.8; color: var(--ink); }
.communion-preview-shell { min-height: var(--verse-preview-min-height); padding: 14px; border: 1px solid color-mix(in srgb, var(--line) 88%, transparent); border-radius: var(--radius-md); background: color-mix(in srgb, var(--ink) 3%, transparent); display: grid; align-content: center; }
.communion-preview-shell .muted { text-align: center; }
.communion-form .rules-row { margin-top: 8px; }
.communion-form .rules-row p { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.6; }
#communion-duplicate { margin-top: 12px; }
#communion-submit { position: relative; overflow: hidden; }
#communion-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.communion-form-success { animation: form-success .5s var(--ease) forwards; }
@keyframes form-success { 0% { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); } 100% { background: var(--surface); } }

/* ── Gathering tabs ── */
.communion-tab-card, .communion-archive-card, .communion-preview-card, .communion-top-card, #communion-witness-card { margin-bottom: var(--card-stack-gap); }
.communion-yesterday-header { margin-bottom: 16px; }
.communion-yesterday-header .eyebrow { margin-bottom: 2px; }
.communion-yesterday-header h3 { margin: 4px 0 0; }



/* ── Communion fade-in ── */
.communion-fade-in { animation: communion-fade .4s var(--ease) forwards; }
.communion-view .daily-card { animation: card-enter .5s var(--ease) forwards; opacity: 0; }
.communion-view .daily-card:nth-child(2) { animation-delay: .05s; }
.communion-view .daily-card:nth-child(3) { animation-delay: .1s; }
.communion-view .daily-card:nth-child(4) { animation-delay: .15s; }
.communion-view .daily-card:nth-child(5) { animation-delay: .2s; }
@keyframes communion-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Reading section on communion page ── */
.communion-card-header { margin-bottom: 24px; position: relative; }
.communion-card-header h2 { position: relative; display: inline-block; padding: 0 16px; background: var(--surface); margin: 0; z-index: 2; }
.communion-card-header-centered { text-align: center; }
.strike-title { position: relative; margin-bottom: 6px; }
.strike-title::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); z-index: 1; }
.communion-card-header-centered .daily-intro { margin-left: auto; margin-right: auto; position: relative; }

/* Centered day-marker */
.day-marker { margin: 2px 0 28px; text-align: center; }
.day-marker span { color: var(--accent); font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.communion-reading-reference { font: 600 1.05rem var(--serif); color: var(--accent); margin: 0 0 14px; }

/* ── Witness section (Common + Hidden Witness) ── */
#communion-witness-card { margin-bottom: 24px; }
.witness-list { display: grid; gap: 10px; }
.witness-item-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--ink) 2%, transparent); transition: border-color .2s var(--ease); }
.witness-item-header:hover { border-color: var(--accent); }
.witness-reference, .passage-reference { font: 600 .9rem var(--serif); color: var(--accent); }
.witness-chapter-link { flex-shrink: 0; font-size: .72rem; padding: 8px 12px; min-height: 36px; }

/* ── Gatekeeper dialog ── */
.gatekeeper-dialog { border: none; border-radius: 8px; background: var(--surface); box-shadow: 0 8px 32px rgba(0,0,0,.12); padding: 0; width: 100%; max-width: 680px; }
.gatekeeper-dialog::backdrop { background: rgba(0,0,0,.4); backdrop-filter: blur(4px); }
.gatekeeper-content { min-height: 400px; display: flex; flex-direction: column; align-items: center; padding: 30px; gap: 24px; }
.gatekeeper-title { margin: 0; font: 600 2rem var(--serif); letter-spacing: -.03em; color: var(--ink); }
.gatekeeper-subtitle { margin: 10px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.6; text-align: center; }
.gatekeeper-body { margin: 28px 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; width: 100%; }
.gatekeeper-body p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.gatekeeper-verse-wrapper { margin-top: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-top: 40px; width: 100%; }
.gatekeeper-verse { margin: 0 0 6px; font: italic 400 .85rem var(--serif); line-height: 1.5; color: var(--muted); opacity: 0.8; text-align: center; }
.gatekeeper-ref { margin: 0; font: 600 .65rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); opacity: 0.6; text-align: center; }
.gatekeeper-enter { font-size: .9rem; padding: 14px 24px; min-width: 200px; }

/* ── Prayer overlay (Easter egg) ── */
.prayer-overlay { position: fixed; z-index: var(--z-modal); inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); cursor: pointer; animation: prayer-fade-in .5s ease forwards; }
@keyframes prayer-fade-in { from { opacity: 0; } to { opacity: 1; } }
.prayer-overlay-content { max-width: 480px; padding: 40px; text-align: center; color: rgba(255,255,255,.9); font: 400 1.25rem/2 var(--serif); letter-spacing: .01em; }
.prayer-overlay-ref { margin: 28px 0 0; font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.45); }

/* ── Explain dialog trigger ── */
.explain-trigger { display: block; width: 100%; text-align: center; margin: 18px 0 0; font-size: .8rem; color: var(--muted); border: none; padding: 8px 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; transition: color .2s var(--ease); }
.explain-trigger:hover { color: var(--ink); }
.explain-content { padding: 20px 24px; line-height: 1.8; }
.explain-content p { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.explain-content p:last-child { margin-bottom: 0; }

/* Offering + thank-you dialogs size to their content (not the default tall box). */
.offer-dialog[open], .offer-thanks-dialog[open] { height: auto; max-height: min(760px, calc(100dvh - 32px)); overflow-y: auto; }
.offer-thanks-dialog { width: min(440px, calc(100vw - 32px)); }
.offer-dialog .communion-offer-panel { margin-top: 0; padding: 24px; border-top: none; }
.offer-dialog-intro { max-width: 100%; margin: 0 0 18px; }
.offer-thanks-content { padding: 28px 26px; text-align: center; }
.offer-thanks-content .eyebrow { margin: 0; }
.offer-thanks-content h2 { margin: 6px 0 12px; font: 600 1.6rem var(--serif); }
.offer-thanks-actions { margin: 22px 0 0; }
.offer-privacy-note { margin-top: 10px; color: var(--muted); font-size: .75rem; text-align: center; }
.settings-privacy-link { margin-top: 12px; text-align: center; font-size: .78rem; }
.settings-privacy-link a { color: var(--muted); text-underline-offset: 3px; transition: color .2s var(--ease); }
.settings-privacy-link a:hover { color: var(--ink); }

/* Communion thread  -  kept verses as cards matching mobile style. */
.kept-thread { display: grid; gap: 28px; }
.kept-verse { padding: 24px; background: color-mix(in srgb, var(--ink) 5%, transparent); border-radius: var(--radius); }
.kept-verse:last-child { padding-bottom: 24px; }
.kept-verse-card-link { display: block; color: inherit; text-decoration: none; transition: background .2s var(--ease), transform .15s var(--ease); }
.kept-verse-card-link:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.kept-verse-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.kept-verse-reference { margin-bottom: 12px; }
.kept-reference { font: 600 .84rem var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kept-verse--mine { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.kept-verse-mine-tag { margin-left: 10px; color: var(--accent); font: 600 .75rem var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.kept-verse-text { line-height: 1.85; font-size: 1.06rem; }
.kept-verse-text .verse-number { color: var(--muted); font-size: .9rem; font-weight: 500; margin-right: 6px; }
.kept-verse-text p { display: block; margin: 0 0 10px; }
.kept-verse-text p:last-child { margin-bottom: 0; }
.archive-title-date { display: block; margin-top: 4px; color: var(--muted); font: 500 .8rem var(--sans); }

/* ── Offer toggle and status ── */
.communion-offer-status { margin: 10px 0 0; color: var(--accent); font-size: .85rem; font-weight: 600; }

/* ── Communion gathering card (landing page) ── */
.communion-gathering-link { margin: 18px 0 0; font-size: .8rem; text-align: center; }
.communion-gathering-link a { color: var(--muted); text-underline-offset: 3px; transition: color .2s var(--ease); }
.communion-gathering-link a:hover { color: var(--ink); }
.gathering-count { font-size: .85rem; color: var(--muted); margin: 0 0 12px; }
.gathering-preview { }
.gathering-witness { display: flex; flex-direction: column; gap: 8px; }
.gathering-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gathering-label { font-size: .72rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.gathering-ref { font-size: .88rem; font-weight: 500; color: var(--ink); font-family: var(--serif); }
#communion-offer-card .daily-intro { max-width: 100%; }

/* ── Archive card (on communion page) ── */
.communion-archive-link { margin: 16px 0 0; font-size: .8rem; text-align: center; }
.communion-archive-link a { color: var(--muted); text-underline-offset: 4px; transition: color .2s var(--ease); }
.communion-archive-link a:hover { color: var(--ink); }
.communion-archive-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
#communion-view:not([hidden]) .communion-archive-list:empty::after { content: "No entries yet."; display: block; text-align: center; color: var(--muted); font-size: .88rem; padding: 20px 0; }
.communion-archive-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink) 2%, transparent);
  display: block;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease), background .2s var(--ease);
  cursor: pointer;
  text-align: center;
}
.communion-archive-item:hover { border-color: var(--accent); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 8%, transparent); transform: translateY(-1px); background: color-mix(in srgb, var(--ink) 3%, transparent); }
.communion-archive-item span, .communion-archive-item small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.archive-date { font-size: .8rem; color: var(--muted); margin-bottom: 8px; text-align: center; }
.archive-reference { font: 600 .95rem var(--serif); margin-bottom: 6px; display: block; text-transform: uppercase; }
.archive-count { font-size: .8rem; color: var(--muted); }
.communion-archive-item--today { border-color: var(--accent); }
.communion-archive-item--today:hover { box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 12%, transparent); }
.archive-today-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; background: var(--accent); color: var(--background); font-size: .65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 3px; vertical-align: middle; }
.communion-archive-item { animation: archive-item-enter .4s var(--ease) forwards; opacity: 0; }
.communion-archive-item:nth-child(1) { animation-delay: 0s; }
.communion-archive-item:nth-child(2) { animation-delay: .06s; }
.communion-archive-item:nth-child(3) { animation-delay: .12s; }
@keyframes archive-item-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
/* ── Archive page ── */
.archive-page-list { margin-top: 22px; }
.archive-full-list { display: grid; gap: 10px; margin-top: 16px; max-height: 600px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-right: 4px; }
.archive-full-list::-webkit-scrollbar { width: 6px; }
.archive-full-list::-webkit-scrollbar-track { background: transparent; }
.archive-full-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.archive-full-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }
/* ══════════════════════════════════════
   SEARCH
   ══════════════════════════════════════ */
.search-dialog[open] { display: flex; height: min(760px, calc(100dvh - 32px)); max-height: min(760px, calc(100dvh - 32px)); flex-direction: column; }
.search-dialog .dialog-header { flex: 0 0 auto; }
.search-input-wrapper { flex: 0 0 auto; padding: 20px 25px; border-bottom: 1px solid var(--line); }
.search-input { width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--background); color: var(--ink); font-size: .95rem; font-family: var(--sans); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.search-results-container { flex: 1 1 auto; min-height: 0; max-height: 480px; overflow-y: auto; display: flex; flex-direction: column; }
.search-result-item { display: flex; flex-shrink: 0; flex-direction: column; width: 100%; text-align: left; background: transparent; padding: 16px 25px; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s var(--ease), transform .1s var(--ease); min-height: 44px; }
.search-result-item:hover { background: var(--soft); }
.search-result-item:active { transform: scale(.99); }
.search-result-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.search-result-meta { color: var(--accent); font-size: .72rem; margin-bottom: 4px; font-weight: 600; font-family: var(--sans); letter-spacing: .05em; text-transform: uppercase; }
.search-result-text { font-family: var(--reader-font); font-size: .95rem; line-height: 1.6; color: var(--ink); }
.search-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-bottom: 4px; }
.filter-chip { flex: 0 0 auto; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: .78rem; font-weight: 600; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease); font-family: var(--sans); min-height: 44px; }
.filter-chip:active { transform: scale(.96); }
.filter-chip.active { background: var(--ink); color: var(--background); border-color: var(--ink); transform: scale(1.02); }
.search-skeleton { padding: 16px 25px; display: flex; flex-direction: column; gap: 12px; }
.search-skeleton-line { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 60%, transparent) 50%, var(--line) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.2s ease-in-out infinite; }
.search-skeleton-line:nth-child(2) { width: 80%; }
.search-skeleton-line:nth-child(3) { width: 60%; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.archive-skeleton { display: grid; gap: 10px; }
.archive-skeleton-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--ink) 2%, transparent); display: grid; gap: 10px; }
.archive-skeleton-line { height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 60%, transparent) 50%, var(--line) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.2s ease-in-out infinite; }
.archive-skeleton-line:nth-child(1) { width: 44%; justify-self: center; }
.archive-skeleton-line:nth-child(2) { width: 74%; height: 16px; justify-self: center; }
.archive-skeleton-line:nth-child(3) { width: 38%; justify-self: center; }
.search-empty { padding: 40px 25px; text-align: center; }
.search-empty-title { font: 600 1rem var(--serif); color: var(--ink); margin-bottom: 6px; }
.search-empty-hint { color: var(--muted); font-size: .85rem; }

/* ══════════════════════════════════════
   ADMIN
   ══════════════════════════════════════ */
.admin-page { width: min(100% - 40px, 1120px); margin: 0 auto 48px; }
.admin-card { padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-summary { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 22px; }
.admin-summary p { margin: 0; color: var(--muted); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.admin-table th { color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.admin-cell-meta { width: 180px; color: var(--muted); white-space: nowrap; font-size: .82rem; }
.admin-cell-subject { width: 240px; font-weight: 600; }
.admin-cell-message { min-width: 360px; line-height: 1.7; white-space: pre-wrap; }
.admin-empty { color: var(--muted); text-align: center; padding: 28px 12px; }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (min-width: 701px) {
  .daily-view { display: flex; min-height: calc(100dvh - 74px); flex-direction: column; }
  .daily-actions { gap: 16px; }
  .home-footer { margin-top: auto; padding: 18px 0 28px; }
  .about-footnote { padding-bottom: 28px; }
  .support-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1180px) {
  .view { width: min(100% - 80px, 880px); }
  .about-page, .policy-page { width: min(100% - 80px, 840px); }
}

/* Mobile controls hide state (applies to all platforms) */
body:not(.mobile-controls-visible) .mobile-tabs { opacity: 0; pointer-events: none; transform: translateY(100%); }
body:not(.mobile-controls-visible):not(.policy-body) .site-header { opacity: 0; pointer-events: none; transform: translateY(-100%); }
body:not(.mobile-controls-visible) .reader-toolbar { opacity: 0; pointer-events: none; transform: translateY(-100%); }

@media (max-width: 700px) {
  main { padding-bottom: calc(60px + var(--safe-bottom)); }
  dialog { top: max(10px, var(--safe-top)); width: min(100% - 20px, 680px); max-height: calc(100dvh - max(20px, var(--safe-top)) - var(--safe-bottom)); }
  dialog[open], .settings-dialog[open], .search-dialog[open] { height: calc(100dvh - max(20px, var(--safe-top)) - var(--safe-bottom)) !important; animation: dialog-slide-up .28s cubic-bezier(0.32, 0.72, 0, 1) forwards; }
  .site-header { grid-template-columns: 1fr auto; height: 60px; padding: 0 14px 0 20px; will-change: transform, opacity; transition: transform .25s var(--ease), opacity .25s var(--ease); }
  .primary-tabs { display: none; }
  .view { width: min(100% - 32px, 820px); }
  .daily-hero { padding: 36px 0 18px; }
  .daily-card { margin-bottom: 32px; }
  .daily-passage { text-align: left; }
  .communion-tab { font-size: .78rem; padding: 8px 14px; }
  .communion-top-tab { font-size: .78rem; padding: 8px 12px; }
  .daily-actions { flex-direction: column; }
  .daily-actions .button { max-width: 320px; width: 100%; }
  .daily-view .daily-actions .button:not(.primary) { display: none; }
  .bible-view { padding-bottom: calc(92px + var(--safe-bottom)); }
  .reader-toolbar { top: 60px; margin: 0 -16px; grid-template-columns: 1fr 1fr 1fr; will-change: transform, opacity; transition: top .25s var(--ease), transform .25s var(--ease), opacity .25s var(--ease); }
  .selector, .translation { padding: 15px 12px; }
  .chapter-header { padding: 42px 0 34px; }
  .scripture { line-height: 1.82; }
  .chapter-nav { margin: 52px 0 30px; }
  .chapter-nav button { padding: 14px 10px; }
  .home-footer { margin-top: 0; padding: 0 0 30px; }
  .about-footnote { padding-bottom: 30px; }
  #communion-top-communion { align-items: flex-start; flex-direction: column; gap: 14px; }
  .mobile-tabs { position: fixed; z-index: var(--z-floating); right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(60px + var(--safe-bottom)); padding-bottom: var(--safe-bottom); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--background) 94%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); will-change: transform, opacity; transition: transform .25s var(--ease), opacity .25s var(--ease); }
  .mobile-tabs a { min-height: var(--touch-target-min); padding: 0 6px; font-size: .72rem; text-align: center; }
  .mobile-tabs a.active { color: var(--ink); background: var(--soft); }
  body:not(.mobile-controls-visible) .mobile-tabs { opacity: 0; pointer-events: none; transform: translateY(100%); }
  body:not(.mobile-controls-visible):not(.policy-body) .site-header { opacity: 0; pointer-events: none; transform: translateY(-100%); }
  body:not(.mobile-controls-visible) .reader-toolbar { opacity: 0; pointer-events: none; transform: translateY(-100%); }
  .chapter-picker { padding: 18px; }
  /* Make chapter grid responsive and increase tap targets on small screens */
  .chapter-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .chapter-picker .chapter-grid button {
    padding: 10px 8px;
    min-height: 52px;
    border-radius: 6px;
    font-size: 1rem;
  }
  @media (max-width: 420px) {
    .chapter-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .chapter-picker { padding: 14px; }
    .chapter-picker .chapter-grid button { padding: 12px 10px; min-height: 52px; font-size: 1.05rem; aspect-ratio: unset; }
  }
  .policy-header { display: flex; justify-content: space-between; }
  .policy-body main { padding-bottom: 0; }
  .policy-page { width: min(100% - 32px, 840px); }
  .about-page { width: min(100% - 32px, 760px); }
  .support-grid { grid-template-columns: 1fr; }
  .setting-toggle-row { align-items: center; }
  #audio-settings-section .setting-toggle-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .speed-controls { justify-content: flex-start; }
  .voice-selector { width: 100%; max-width: 180px; }
  .settings-content { padding: 0 18px 18px; }
  .dialog-header, .search-input-wrapper { padding: 20px 18px; }
  .search-result-item { padding: 15px 18px; }
  .admin-page { width: min(100% - 32px, 1120px); }
  .admin-summary { flex-direction: column; align-items: flex-start; }
  .admin-table th, .admin-table td { padding: 12px 10px; }
  .admin-cell-meta { width: 140px; }
  .data-actions { flex-direction: column; }
}

/* Ensure dialog headers respect the safe-area inset on small devices (PWA iOS) */
@media (max-width: 700px) {
  dialog { padding-top: 0; padding-bottom: 0; }
  dialog .dialog-header { padding-top: calc(20px + var(--safe-top)); }
}

@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .site-header, .reader-toolbar, .mobile-tabs { transition: none; }
}

@media (min-width: 701px) and (prefers-reduced-motion: reduce) {
  .reader-toolbar { transition: none; }
}

/* ══════════════════════════════════════
   PRINT
   ══════════════════════════════════════ */
@media print {
  body { background: white; color: black; }
  .site-header, .reader-toolbar, .mobile-tabs, .mobile-back-btn, .chapter-nav, .communion-form, .communion-archive-card, #communion-offer-card, #communion-gathering-card, .toast, dialog { display: none !important; }
  .daily-hero { padding: 20px 0 14px; }
  .chapter-header { padding: 20px 0 14px; }
  .verse-number { color: #666; }
  .daily-passage { max-width: 100%; }
  .verse { scroll-margin-top: 0; }
  a { text-decoration: none; color: black; }
}
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 22px 10px; text-align: center; }
.empty-state-mark { position: relative; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 50%; background: color-mix(in srgb, var(--ink) 3%, transparent); }
.empty-state-mark::before, .empty-state-mark::after { position: absolute; top: 50%; left: 50%; background: var(--accent); border-radius: 999px; content: ""; transform: translate(-50%, -50%); }
.empty-state-mark::before { width: 18px; height: 1.5px; }
.empty-state-mark::after { width: 1.5px; height: 18px; }
.empty-state-title { color: var(--ink); font: 600 1.1rem var(--serif); }
.empty-state-copy { max-width: 34ch; color: var(--muted); font-size: .88rem; line-height: 1.65; }
