/* His Promise Daily — calm editorial reading room: soft cloud blue, one dusk-slate accent. */

:root {
  --bg: #e1e9f1; /* cloud blue */
  --bg-deep: #d5dfe9; /* segmented-control track */
  --paper: #fbfcfd; /* card */
  --paper-2: #f4f7fa;
  --ink: #1a2230;
  --ink-muted: #3b4556;
  --ink-faint: #4d5868;
  --accent: #3d5470; /* muted dusk slate */
  --accent-strong: #2e4159;
  --accent-wash: rgba(61, 84, 112, 0.08);
  --accent-line: rgba(61, 84, 112, 0.3);
  --border: rgba(26, 34, 48, 0.09);
  --border-strong: rgba(26, 34, 48, 0.18);
  --hairline: rgba(26, 34, 48, 0.08);
  --focus: #3d5470;
  --focus-ring: rgba(61, 84, 112, 0.24);
  --chip-active-text: #fbfcfd;
  --feeling-bg: rgba(61, 84, 112, 0.09);
  --feeling-ink: #2e4159;
  --status-ok-bg: rgba(61, 84, 112, 0.1);
  --status-ok-ink: #24364b;
  --status-err-bg: rgba(160, 70, 50, 0.1);
  --status-err-ink: #8a332c;
  --sky:
    radial-gradient(ellipse 70% 48% at 8% 0%, rgba(240, 245, 249, 0.85) 0%, transparent 62%),
    radial-gradient(ellipse 55% 42% at 96% 8%, rgba(214, 222, 238, 0.45) 0%, transparent 64%),
    linear-gradient(180deg, #e9eff5 0%, #e1e9f1 45%, #d3dfea 100%);
  --radius: 22px;
  --radius-sm: 14px;
  --radius-field: 14px;
  --radius-pill: 999px;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  /* Script face for the wordmark and page headings; Newsreader stays as the fallback. */
  --font-script: "Yellowtail", "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  /* Serif face for scripture verse text only (Newsreader is the fallback).
     To try another verse font, change the family here + in the Google Fonts link,
     then retune the --verse-* values below. */
  --font-verse: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --verse-size: clamp(1.4rem, 2.55vw, 1.56rem);
  --verse-size-reading: clamp(1.44rem, 2.65vw, 1.6rem);
  --verse-size-mobile: 1.28rem;
  --verse-line-height: 1.52;
  --verse-tracking: 0;
  --verse-style: italic;
  --verse-weight: 400;
  --max: 760px;
  --ease: 0.18s ease;
  --shadow-card:
    0 1px 2px rgba(40, 60, 90, 0.06),
    0 14px 36px -12px rgba(40, 60, 90, 0.18);
  --shadow-soft:
    0 1px 2px rgba(40, 60, 90, 0.05),
    0 8px 22px -12px rgba(40, 60, 90, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
  min-height: 100%;
  background-color: var(--bg);
  background-image: var(--sky);
  background-attachment: fixed;
  /* Cards slide past the edges; never let that create sideways scroll. */
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html {
    overflow-x: clip;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.97rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background: transparent;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Soft cotton clouds: a static, low-contrast colour layer behind everything. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(ellipse 42% 18% at 14% 24%, rgba(150, 168, 192, 0.22) 0%, transparent 72%),
    radial-gradient(ellipse 48% 20% at 86% 20%, rgba(155, 165, 195, 0.18) 0%, transparent 74%),
    radial-gradient(ellipse 36% 16% at 18% 78%, rgba(145, 165, 190, 0.16) 0%, transparent 74%),
    radial-gradient(ellipse 40% 16% at 82% 74%, rgba(150, 165, 192, 0.15) 0%, transparent 74%);
  filter: blur(28px);
}

body::after {
  background:
    radial-gradient(ellipse 34% 20% at 10% 16%, rgba(255, 255, 255, 0.8) 0%, rgba(236, 242, 247, 0.3) 46%, transparent 72%),
    radial-gradient(ellipse 18% 12% at 22% 22%, rgba(255, 255, 255, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 40% 22% at 84% 12%, rgba(255, 255, 255, 0.72) 0%, rgba(232, 236, 246, 0.25) 50%, transparent 74%),
    radial-gradient(ellipse 22% 14% at 70% 20%, rgba(255, 255, 255, 0.48) 0%, transparent 72%),
    radial-gradient(ellipse 28% 16% at 8% 70%, rgba(255, 255, 255, 0.52) 0%, transparent 74%),
    radial-gradient(ellipse 32% 18% at 90% 66%, rgba(255, 255, 255, 0.48) 0%, transparent 74%);
  filter: blur(16px);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.65rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

/* —— Header —— */

.site-header {
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
  background: transparent;
}

.site-header--bar {
  padding: 0.85rem 1.5rem;
  text-align: left;
  background: rgba(228, 236, 243, 0.84);
  backdrop-filter: saturate(1.1) blur(12px);
  -webkit-backdrop-filter: saturate(1.1) blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--hairline);
}

.site-header--bar .header-bar {
  margin-bottom: 0;
}

.site-header--compact {
  padding: 1.1rem 1.5rem 2.25rem;
}

.site-header .eyebrow {
  margin: 2.25rem 0 0.7rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-header h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 6.8vw, 3.8rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.05;
  color: var(--ink);
}

.site-header .lede {
  margin: 0 auto;
  max-width: 26rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  width: min(100%, var(--max));
  margin: 0 auto 1.25rem;
  text-align: left;
}

.site-header--compact .header-bar {
  margin-bottom: 0;
}

.brand-link {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0;
  line-height: 1.1;
  color: var(--ink);
  text-decoration: none;
}

.brand-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1.1rem;
  font-size: 0.84rem;
}

.nav-link {
  color: var(--ink-muted);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-link-muted,
.nav-user {
  color: var(--ink-faint);
}

.nav-user {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
}

/* —— Layout —— */

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin: 0 auto;
  padding: 0.5rem 0 4.5rem;
}

.page-home .wrap {
  padding-top: 0;
}

.wrap-narrow {
  max-width: 28rem;
}

/* —— Hero search —— */

.search-panel {
  position: relative;
  z-index: 1;
  padding: 1rem 0 0.75rem;
}

.page-home .search-panel {
  padding: 3rem 0 1.25rem;
  text-align: center;
}

.hero-wordmark {
  margin: 0 0 1.6rem;
  font-family: var(--font-script);
  font-size: clamp(2.8rem, 8.4vw, 4.4rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: var(--ink);
}

.search-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.search-row,
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0.3rem 0.35rem 0.3rem 0.4rem;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.search-bar:focus-within {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-soft), 0 0 0 3px var(--focus-ring);
}

#search {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.55rem 0.5rem 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.97rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

#search::-webkit-search-cancel-button,
#search::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

#search::placeholder {
  color: var(--ink-faint);
  opacity: 0.9;
}

#search:focus {
  outline: none;
  box-shadow: none;
}

.search-bar-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
}

.search-submit {
  flex: 0 0 auto;
  min-height: 2.6rem;
  padding: 0 1.05rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--paper);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background var(--ease), transform 0.12s ease;
}

.search-submit:hover {
  background: var(--accent-strong);
}

.search-submit:active,
.search-submit.is-pressed {
  transform: scale(0.97);
}

/* —— Filters —— */

.filters-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  font: inherit;
  color: var(--ink-faint);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--ease), background var(--ease);
}

.filters-toggle:hover,
.filters-toggle[aria-expanded="true"] {
  color: var(--accent);
  background: var(--accent-wash);
}

.filters-toggle-icon {
  display: block;
}

.filters-toggle-badge {
  position: absolute;
  top: 0.2rem;
  right: 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1;
  color: var(--paper);
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.filters-toggle-badge[hidden] {
  display: none;
}

.filters {
  display: grid;
  gap: 1.35rem;
  margin-top: 0.85rem;
  padding: 1.35rem 1.25rem 1.2rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.filters[hidden] {
  display: none;
}

.filters-dropdowns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem 1.15rem;
}

.filter-block-testament {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .filters-dropdowns {
    grid-template-columns: 1fr;
  }
}

.testament-options,
.auth-tabs,
.browse-modes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.25rem;
  background: var(--bg-deep);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
}

.testament-options {
  width: 100%;
}

.testament-btn,
.auth-tab,
.browse-mode {
  appearance: none;
  flex: 1 1 auto;
  min-height: 2.4rem;
  padding: 0.4rem 1rem;
  font: inherit;
  font-size: 0.84rem;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
}

.testament-btn {
  min-width: 5.25rem;
}

.testament-btn:hover,
.auth-tab:hover,
.browse-mode:hover {
  color: var(--ink);
}

.testament-btn[aria-pressed="true"],
.auth-tab[aria-selected="true"],
.browse-mode[aria-pressed="true"] {
  background: var(--paper);
  color: var(--accent-strong);
  box-shadow: 0 1px 3px rgba(40, 60, 90, 0.14);
}

/* Landing switch: today's verse (with 60-day history) or the whole collection */
.browse-modes {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0.4rem auto 0;
}

.browse-modes[hidden] {
  display: none;
}

.browse-mode {
  min-height: 2.3rem;
  padding: 0.35rem 1.05rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.filter-block h2 {
  margin: 0 0 0.5rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.select-row,
.book-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

#book-filter,
#feeling-filter,
#theme-filter,
#version-filter {
  width: 100%;
  min-width: 0;
  min-height: 2.7rem;
  padding: 0.5rem 2.2rem 0.5rem 0.9rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background-color: var(--paper-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 L6 6.5 L11 1.5' fill='none' stroke='%231a2230' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  border: 1px solid var(--border);
  border-radius: 12px;
  appearance: none;
}

#book-filter:focus,
#feeling-filter:focus,
#theme-filter:focus,
#version-filter:focus {
  border-color: var(--accent-line);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.chips,
.smart-chips,
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip,
.smart-chip,
.tag {
  appearance: none;
  padding: 0.36rem 0.8rem;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}

.chip:hover,
.smart-chip:hover,
.tag:hover {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--accent-wash);
}

.chip[aria-pressed="true"],
.chip-feeling[aria-pressed="true"] {
  background: var(--accent);
  color: var(--chip-active-text);
  border-color: transparent;
}

.filter-hint {
  margin: -0.15rem 0 0.45rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.tag-feeling {
  background: var(--feeling-bg);
  color: var(--feeling-ink);
  border-color: transparent;
}

.tag-static {
  cursor: default;
}

/* —— Results meta —— */

.results-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin: 1.5rem 0 1rem;
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.results-meta strong {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.92rem;
}

.is-landing .results-meta {
  display: none;
}

.is-landing .results-host--reading {
  margin-top: 1.75rem;
}

.results {
  display: grid;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.results--single {
  display: block;
  max-width: 36rem;
  margin: 0 auto;
}

.results-host--reading {
  margin: 0.15rem 0 0.35rem;
}

#results,
.reading-stage,
.card--reading,
.empty {
  /* Clears the sticky header so the card sits just below it. */
  scroll-margin-top: 5rem;
}

/* —— Reading deck —— */

.reading-stage {
  position: relative;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.25rem 0 1.25rem;
}

.reading-chrome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  max-width: 36rem;
  margin: 0 auto 1.1rem;
}

.reading-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.reading-position {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  white-space: nowrap;
}

.reading-meter {
  position: relative;
  width: min(8.5rem, 100%);
  height: 2px;
  border-radius: 2px;
  background: var(--hairline);
  overflow: hidden;
}

.reading-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reading-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0 1rem 0 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 2px rgba(40, 60, 90, 0.07);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color var(--ease), border-color var(--ease), background var(--ease), opacity var(--ease);
}

.reading-nav--next {
  padding: 0 0.75rem 0 1rem;
}

.reading-nav svg {
  display: block;
  flex: 0 0 auto;
}

.reading-nav:hover:not(:disabled) {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--paper);
}

.reading-nav:active:not(:disabled) {
  background: var(--accent-wash);
}

.reading-nav:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-ring);
}

.reading-nav:disabled {
  color: var(--ink-faint);
  background: transparent;
  border-color: var(--hairline);
  box-shadow: none;
  opacity: 0.55;
  cursor: default;
}

.reading-stage--daily .reading-position {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.daily-when {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
}

.daily-date {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.reading-viewport {
  position: relative;
  /* Horizontal gestures are ours; vertical scrolling stays native. */
  touch-action: pan-y;
  cursor: grab;
  outline: none;
  border-radius: var(--radius);
  padding: 0.35rem 0;
}

.reading-viewport:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.reading-stage.is-dragging .reading-viewport {
  cursor: grabbing;
}

.reading-stage.is-dragging .reading-viewport,
.reading-stage.is-dragging .reading-viewport * {
  user-select: none;
  -webkit-user-select: none;
}

.deck-track {
  position: relative;
  z-index: 1;
}

.deck-card {
  position: relative;
  z-index: 2;
  will-change: transform, opacity;
  transform-origin: 50% 60%;
}

.deck-card.is-leaving {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

/* Stacked cards just behind the current one: a quiet hint of more to read. */
.deck-peek {
  position: absolute;
  z-index: 0;
  top: 1.35rem;
  bottom: 1.35rem;
  left: 50%;
  width: min(36rem, 100%);
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px -10px rgba(40, 60, 90, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.deck-peek--next {
  transform: translateX(calc(-50% + 14px)) scale(0.965);
}

.deck-peek--prev {
  transform: translateX(calc(-50% - 14px)) scale(0.965);
}

.deck-peek.is-on {
  opacity: 1;
}

.is-pulling-next .deck-peek--next {
  transform: translateX(calc(-50% + 8px)) scale(0.98);
}

.is-pulling-prev .deck-peek--prev {
  transform: translateX(calc(-50% - 8px)) scale(0.98);
}

.reading-hint {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.reading-hint[hidden] {
  display: none;
}

/* —— Cards —— */

.card {
  display: flex;
  flex-direction: column;
  padding: 1.85rem 1.6rem 1.55rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.card--reading {
  padding: 2.4rem 2.4rem 2rem;
  min-height: 19rem;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  order: 1;
}

.card-ref-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
  padding-top: 0.45rem;
}

.card-ref {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--accent);
}

.relevance-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--feeling-ink);
  background: var(--feeling-bg);
  white-space: nowrap;
}

.card-text {
  order: 2;
  margin: 1.25rem 0 1.4rem;
  padding: 0;
  max-width: 30em;
  font-family: var(--font-verse);
  font-size: var(--verse-size);
  font-weight: var(--verse-weight);
  font-style: var(--verse-style);
  font-optical-sizing: auto;
  letter-spacing: var(--verse-tracking);
  line-height: var(--verse-line-height);
  color: var(--ink);
  background: transparent;
  border: none;
  overflow-wrap: break-word;
}

.card--reading .card-text {
  font-size: var(--verse-size-reading);
  line-height: var(--verse-line-height);
  margin-top: 1.35rem;
}

/* —— Explanation: one short summary, set apart by a short slate rule —— */
.card-explain {
  order: 3;
  margin: 0 0 1.35rem;
  max-width: 36em;
  padding-top: 1.1rem;
  position: relative;
}

.card-explain::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2rem;
  height: 1px;
  background: var(--accent-line);
}

.card-explain-text {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.65;
}

.card-explain.is-loading .card-explain-text {
  display: block;
  min-height: 3.2em;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(61, 84, 112, 0.05), rgba(61, 84, 112, 0.1), rgba(61, 84, 112, 0.05));
}

.card-tags {
  order: 5;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.empty {
  padding: 3.25rem 1.5rem;
  text-align: center;
  color: var(--ink-muted);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.empty h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-script);
  font-size: clamp(1.9rem, 4.4vw, 2.45rem);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink);
}

.empty p {
  margin: 0;
}

@media (max-width: 560px) {
  .reading-stage {
    padding: 0.15rem 0 1rem;
  }

  .reading-nav-label {
    display: none;
  }

  .reading-nav,
  .reading-nav--next {
    width: 2.75rem;
    padding: 0;
  }

  .card--reading {
    padding: 1.6rem 1.25rem 1.4rem;
    min-height: 0;
  }

  .card-text,
  .card--reading .card-text {
    font-size: var(--verse-size-mobile);
  }

  .card-explain-text {
    font-size: 0.9rem;
  }

  .deck-peek {
    top: 1rem;
    bottom: 1rem;
  }

  .deck-peek--next {
    transform: translateX(calc(-50% + 9px)) scale(0.97);
  }

  .deck-peek--prev {
    transform: translateX(calc(-50% - 9px)) scale(0.97);
  }
}

/* —— Favorite (cross): quiet outline; slate when saved —— */

.favorite-btn {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  width: 3.25rem;
  min-width: 3.25rem;
  height: 3.35rem;
  min-height: 3.35rem;
  margin: 0;
  padding: 0.3rem 0.25rem 0.35rem;
  color: var(--ink-muted);
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
}

.favorite-btn:hover {
  color: var(--accent-strong);
  border-color: var(--accent-line);
}

.favorite-btn:active {
  transform: translateY(1px);
}

.favorite-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.favorite-btn[aria-pressed="true"] {
  color: var(--paper);
  background: var(--accent);
  border-color: var(--accent);
}

.favorite-btn[aria-pressed="true"]:hover {
  background: var(--accent-strong);
  color: var(--paper);
}

.favorite-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.favorite-btn-label {
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

.cross-icon {
  display: block;
  pointer-events: none;
  width: 14px;
  height: 14px;
}

/* —— Footer —— */

.site-footer {
  padding: 2.5rem 1.5rem 3.5rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ink-faint);
  border-top: 1px solid var(--hairline);
}

.site-footer p {
  margin: 0.35rem auto;
  max-width: 28rem;
}

.site-footer .footer-links a {
  color: var(--ink-muted);
}

.local-beta-notice {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  overflow-wrap: anywhere;
}

.site-footer code {
  font-size: 0.95em;
  color: var(--ink-muted);
}

.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;
}

/* —— Actions —— */

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 1.75rem 0 2.25rem;
}

.btn-primary,
.btn-secondary,
.load-more,
.smart-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1.35rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.84rem;
  text-decoration: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.btn-primary,
.load-more,
.smart-apply {
  color: var(--paper);
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover,
.load-more:hover,
.smart-apply:hover {
  color: var(--paper);
  background: var(--accent-strong);
}

.btn-secondary {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  color: var(--accent-strong);
  border-color: var(--accent-line);
}

.btn-compact {
  padding: 0.4rem 0.95rem;
  min-height: 2.35rem;
  font-size: 0.8rem;
}

/* —— Auth & account —— */

.auth-card,
.upgrade-panel {
  padding: 1.7rem 1.45rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.auth-tabs {
  display: flex;
  width: 100%;
  margin-bottom: 1.35rem;
}

.auth-tab {
  margin: 0;
  font-size: 0.84rem;
}

.auth-form label {
  display: block;
  margin: 1rem 0 0.4rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.auth-form label:first-of-type {
  margin-top: 0;
}

.auth-form .optional {
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

.auth-form input,
.smart-freetext {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.auth-form input:focus,
.smart-freetext:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.field-hint,
.auth-footnote {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

.auth-status {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
  border-radius: 12px;
  background: var(--status-ok-bg);
  color: var(--status-ok-ink);
}

.auth-status--error {
  background: var(--status-err-bg);
  color: var(--status-err-ink);
}

.auth-welcome {
  margin: 0 0 0.35rem;
  font-family: var(--font-script);
  font-size: clamp(1.9rem, 4.4vw, 2.35rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.15;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.auth-form .btn-primary {
  width: 100%;
  margin-top: 1.35rem;
}

.me-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.me-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.results-meta-inline {
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.results-meta-inline strong {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.92rem;
}

.empty-cta {
  margin-top: 1.25rem !important;
}

.upgrade-panel {
  margin-bottom: 1.75rem;
  text-align: center;
}

.upgrade-panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-script);
  font-size: clamp(1.8rem, 4.4vw, 2.35rem);
  font-weight: 400;
}

.upgrade-panel p {
  margin: 0 auto 1.15rem;
  max-width: 32rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* —— Smart guide —— */

.smart-guide {
  margin-top: 0.85rem;
  margin-bottom: 2rem;
  padding: 1.25rem 1.15rem 1.05rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  position: relative;
  text-align: left;
}

.smart-guide[hidden] {
  display: none;
}

.smart-guide-inner {
  padding-right: 1.75rem;
}

.smart-guide-dismiss {
  position: absolute;
  top: 0.85rem;
  right: 0.7rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink-faint);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.smart-guide-dismiss:hover {
  color: var(--ink);
}

.smart-guide-question {
  margin: 0 0 0.9rem;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
}

.smart-chips {
  margin-bottom: 0.9rem;
}

.smart-freetext-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 0.55rem;
}

.smart-freetext {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
}

.smart-freetext::placeholder {
  color: var(--ink-faint);
}

.smart-apply {
  padding: 0 1.1rem;
  white-space: nowrap;
}

.smart-guide-actions {
  margin: 0;
}

.smart-skip,
.smart-clear-guide {
  appearance: none;
  padding: 0.35rem 0;
  min-height: 2.25rem;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
}

.smart-skip:hover,
.smart-clear-guide:hover {
  color: var(--accent-strong);
}

.smart-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.smart-status-text {
  font-size: 0.9rem;
  color: var(--ink);
}

.smart-guide--status {
  background: var(--paper-2);
}

/* —— Mobile —— */

@media (max-width: 560px) {
  .site-header {
    padding-top: 2.25rem;
  }

  .site-header--bar {
    padding: 0.75rem 1rem;
  }

  .site-header--compact {
    padding: 0.9rem 1rem 1.75rem;
  }

  .wrap {
    width: min(100% - 1.5rem, var(--max));
  }

  .page-home .search-panel {
    padding: 2rem 0 1rem;
  }

  .hero-wordmark {
    margin-bottom: 1.25rem;
  }

  .card {
    padding: 1.4rem 1.15rem 1.2rem;
  }

  #search {
    min-height: 2.6rem;
    font-size: 0.95rem;
    padding-left: 0.8rem;
  }

  .search-submit {
    min-height: 2.45rem;
    padding: 0 0.85rem;
  }

  .filters-toggle {
    width: 2.4rem;
    height: 2.4rem;
  }
}

@media (max-width: 360px) {
  #search::placeholder {
    font-size: 0.85rem;
  }

  .browse-mode {
    padding: 0.35rem 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }

  .deck-card {
    will-change: opacity;
  }
}

/* —— Bible version (public domain) —— */
.card-text--loading {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.card-version-note {
  order: 2;
  margin: -0.85rem 0 1.2rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-faint);
  font-style: italic;
}

.card-version-note[hidden] {
  display: none;
}

.me-version-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.me-version-label #version-filter {
  width: auto;
  max-width: min(16rem, 55vw);
  min-height: 2.2rem;
  padding: 0.35rem 2rem 0.35rem 0.75rem;
  font-size: 0.82rem;
}

/* —— Legal pages —— */
.legal-page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.legal-page h2 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
}

.host-notice {
  max-width: 32rem;
  margin: 0 auto 1rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}
