/*
  CASE & ASE 2026 Spiritual Program – Modern Styles
  --------------------------------------------------
  Features: CSS variables, dark/light themes, glassmorphism,
  fluid typography, smooth animations, mobile-first responsive.
*/

/* === THEME TOKENS ===
   Shared color/radius/shadow/font tokens live in assets/theme.css
   (linked before this stylesheet in index.html) so the public app
   and the admin dashboard stay visually consistent. */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-gradient);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100dvh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.container {
  width: min(1400px, 96%);
  margin: 0 auto;
}

/* === LOADING OVERLAY === */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === OFFLINE BANNER === */
.offline-banner {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--surface-glass);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  border: 1.5px solid var(--warning);
  border-radius: var(--radius-full);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(245, 158, 11, 0.15);
  animation: offlineSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  white-space: nowrap;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.offline-banner.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-120%);
}

.offline-banner[hidden] {
  display: none !important;
}

.offline-banner svg {
  flex-shrink: 0;
  color: var(--warning);
}

.offline-banner .offline-dot {
  width: 6px;
  height: 6px;
  background: var(--warning);
  border-radius: 50%;
  animation: offlinePulse 2s ease-in-out infinite;
}

@keyframes offlineSlideIn {
  from { transform: translateX(-50%) translateY(-120%); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes offlinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* === HEADER === */
.site-header {
  background: rgba(0, 80, 40, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  padding: 0.7rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.18));
}

.header-text {
  min-width: 0;
}

.header-text h1 {
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle {
  margin-top: 0.05rem;
  opacity: 0.7;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.header-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

/* === LANGUAGE SELECTOR === */
.lang-select {
  height: 32px;
  padding: 0 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background var(--transition), border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.lang-select option {
  background: var(--surface);
  color: var(--text);
}

.lang-select:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.lang-select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* === NAV LINK (cross-link to the Daily Devotion program) === */
.nav-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 32px;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.nav-link-pill:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.nav-link-pill:active {
  transform: scale(0.95);
}

/* === SYNC TOAST === */
.sync-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 999;
  padding: 0.65rem 1.25rem;
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sync-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === CONTROLS === */
/* (controls merged into .tabs bar — old .controls section removed) */

/* === TABS (with integrated controls) === */
.tabs {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem;
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.tabs-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.tabs-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 1;
  min-width: 0;
}

.tabs-right select {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 140px;
}

.tabs-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tabs-search-icon {
  position: absolute;
  left: 0.5rem;
  color: var(--text-secondary);
  opacity: 0.6;
  pointer-events: none;
}

.tabs-right input[type="search"] {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem 0.35rem 1.75rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 160px;
  min-width: 0;
}

.tabs-right select:focus,
.tabs-right input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.55rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 127, 63, 0.35);
}

.tab-btn svg {
  flex-shrink: 0;
}

/* YouVersion button (used when only a YouVersion link is available) */
.youversion-btn {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.youversion-btn:hover {
  background: var(--primary-hover);
}

/* === TAB PANELS === */
.tab-panel {
  margin-top: 1rem;
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.25s ease;
  transition: background var(--transition), border var(--transition);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

/* Verses panel header: title left, language pills right */
.verses-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.verse-lang-pills {
  display: inline-flex;
  gap: 0.25rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.2rem;
}

.verse-lang-pill {
  padding: 0.3rem 0.75rem;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.verse-lang-pill:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.verse-lang-pill.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.panel-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* === LOCATION BAR === */
.location-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.location-bar > svg {
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0.7;
}

.location-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.location-pill {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.location-pill:hover {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--primary);
}

.location-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 127, 63, 0.25);
}

[data-theme="dark"] .location-pill.active {
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.2);
}

/* === CARD GRID === */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  background: var(--surface-soft);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), background var(--transition);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════
   MASTER-DETAIL SERVICES LAYOUT
   ═══════════════════════════════════════════════════ */

/* Container */
.svc-master-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

@media (min-width: 900px) {
  .svc-master-detail {
    flex-direction: row;
    gap: 1.25rem;
    min-height: 480px;
  }
}

/* ── List Panel (Left) ── */
.svc-list-panel {
  flex-shrink: 0;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 900px) {
  .svc-list-panel {
    width: 34%;
    max-height: 72vh;
  }
}

.svc-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.svc-list-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.svc-list-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary-text);
  min-width: 24px;
  text-align: center;
}

.svc-list-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  flex: 1;
}

.svc-list-scroll::-webkit-scrollbar { width: 5px; }
.svc-list-scroll::-webkit-scrollbar-track { background: transparent; }
.svc-list-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}

/* List item */
.svc-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--text);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.svc-list-item:last-child { border-bottom: none; }

.svc-list-item:hover {
  background: var(--surface-soft);
}

.svc-list-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  z-index: 1;
}

.svc-list-item.active {
  background: var(--primary-soft);
  border-left-color: var(--primary);
}

.svc-list-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.svc-list-item-icon svg { width: 18px; height: 18px; }

.svc-list-item.active .svc-list-item-icon {
  background: var(--primary);
  color: #fff;
}

.svc-list-item-info {
  flex: 1;
  min-width: 0;
}

.svc-list-item-title {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-list-item-date {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.svc-list-item-date svg { width: 12px; height: 12px; opacity: 0.65; }

.svc-list-item-badge {
  flex-shrink: 0;
  font-size: 0.66rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.svc-list-item-arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  opacity: 0.35;
  transition: opacity 0.2s;
}

.svc-list-item-arrow svg { width: 14px; height: 14px; }

.svc-list-item.active .svc-list-item-arrow { opacity: 0.8; color: var(--primary); }

/* ── Detail Panel (Right) ── */
.svc-detail-panel {
  flex: 1;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-y: auto;
  min-height: 320px;
}

@media (min-width: 900px) {
  .svc-detail-panel {
    max-height: 72vh;
  }
}

/* Empty state */
.svc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
  height: 100%;
  min-height: 280px;
}

.svc-empty-state svg {
  color: var(--text-secondary);
  opacity: 0.3;
  margin-bottom: 1rem;
}

.svc-empty-state p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* Detail inner wrapper */
@keyframes detailFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.svc-detail-inner {
  padding: 1.5rem;
}

/* Detail header */
.svc-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.svc-detail-header-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  color: var(--primary);
}

.svc-detail-header-icon svg { width: 26px; height: 26px; }

.svc-detail-header-text { flex: 1; min-width: 0; }

/* Location pills inside detail header */
.svc-detail-loc-pills {
  display: inline-flex;
  gap: 0.2rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.15rem;
  flex-shrink: 0;
  align-self: flex-start;
}

@media (max-width: 600px) {
  .svc-detail-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .svc-detail-header-icon {
    display: none;
  }

  .svc-detail-loc-pills {
    align-self: stretch;
    justify-content: center;
    order: -1;
  }

  .svc-detail-title {
    font-size: 1.05rem;
  }
}

.svc-detail-loc-pills .location-pill {
  padding: 0.25rem 0.65rem;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.svc-detail-loc-pills .location-pill:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.svc-detail-loc-pills .location-pill.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.svc-detail-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.35rem 0;
  line-height: 1.25;
}

.svc-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.svc-detail-date {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.svc-detail-date svg { width: 14px; height: 14px; opacity: 0.65; }

.svc-detail-badge {
  font-size: 0.72rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.svc-detail-location-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 600;
}

/* Info cards row */
.svc-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.svc-info-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.svc-info-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
}

.svc-info-icon svg { width: 16px; height: 16px; }

.svc-info-body { flex: 1; min-width: 0; }

.svc-info-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.svc-info-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

/* Theme section */
.svc-theme-section {
  margin-bottom: 1.25rem;
}

.svc-section-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.svc-section-label svg { width: 15px; height: 15px; color: var(--primary); }

.svc-theme-value {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.92rem;
}

/* Service Order — Timeline */
.svc-order-section {
  /* inherits margin from svc-theme-section if empty */
}

.svc-timeline {
  margin-top: 0.25rem;
}

.svc-timeline-step {
  display: flex;
  align-items: stretch;
  gap: 0.85rem;
}

.svc-timeline-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 30px;
}

.svc-timeline-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.svc-timeline-line {
  flex: 1;
  width: 2px;
  background: var(--border-strong);
  margin: 3px 0;
  border-radius: 2px;
}

.svc-timeline-content {
  flex: 1;
  padding: 0.55rem 0.75rem 0.9rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.svc-timeline-step:last-child .svc-timeline-content {
  border-bottom: none;
  padding-bottom: 0.55rem;
}

/* Sub-step styling */
.svc-timeline-sub-step {
  padding-left: 1rem;
}

.svc-timeline-sub-step .svc-timeline-connector {
  width: 34px;
}

.svc-timeline-sub-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.svc-timeline-main {
  font-weight: 600;
}

.svc-timeline-sub-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding-top: 0.35rem;
  padding-bottom: 0.6rem;
}

[data-theme="dark"] .svc-timeline-sub-text,
[data-theme="dark"] .service-order-subs li {
  color: #ffffff;
}

/* Calendar modal sub-items */
.service-order-subs {
  list-style: none;
  padding-left: 1rem;
  margin: 0.25rem 0 0.1rem;
}

.service-order-subs li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.service-order-subs li::before {
  content: '└─ ';
  opacity: 0.45;
}

/* Mobile: detail panel scroll hint */
@media (max-width: 899px) {
  .svc-master-detail {
    flex-direction: column;
  }
  .svc-list-panel {
    max-height: 260px;
  }
  .svc-detail-inner {
    padding: 1.15rem;
  }
  .svc-info-grid {
    grid-template-columns: 1fr;
  }
  .svc-detail-title {
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .svc-list-panel {
    max-height: 200px;
  }
  .svc-list-item {
    padding: 0.7rem 0.75rem;
    gap: 0.55rem;
  }
  .svc-list-item-icon {
    width: 30px;
    height: 30px;
  }
  .svc-list-item-icon svg { width: 15px; height: 15px; }
  .svc-list-item-badge { display: none; }
  .svc-detail-inner { padding: 1rem; }
  .svc-detail-header-icon { width: 42px; height: 42px; }
  .svc-detail-header-icon svg { width: 22px; height: 22px; }
}

/* Old accordion compat (kept for any references) */
.service-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.service-accordion-header h3 {
  margin-bottom: 0;
}

.accordion-chevron {
  flex-shrink: 0;
  transition: transform 0.25s ease;
  color: var(--text-secondary);
}

.service-accordion.expanded .accordion-chevron {
  transform: rotate(180deg);
}

.service-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding-top 0.3s ease;
  padding-top: 0;
}

.service-accordion.expanded .service-accordion-body {
  max-height: 800px;
  padding-top: 0.75rem;
}

.meta {
  margin: 0.3rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.meta strong {
  color: var(--text);
  font-weight: 600;
}

.service-type {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.verse-text {
  margin-top: 0.6rem;
  padding: 0.65rem 0.8rem;
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.verse-ref {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.verse-lines {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.verse-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.2rem 0;
  line-height: 1.65;
  font-style: italic;
}

.verse-section-header {
  display: block;
  margin-top: 0.6rem;
  margin-bottom: 0.15rem;
  padding: 0.15rem 0;
  font-size: 0.88rem;
  font-weight: 700;
  font-style: normal;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.verse-section-header:first-child {
  margin-top: 0;
}

.verse-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 700;
  font-style: normal;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  line-height: 1;
}

.verse-text b, .verse-text strong {
  font-weight: 700;
}

.verse-text i, .verse-text em {
  font-style: italic;
}

.verse-text u {
  text-decoration: underline;
}

.empty-state {
  color: var(--text-secondary);
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.92rem;
}

.highlight {
  background: rgba(245, 158, 11, 0.25);
  border-radius: 3px;
  padding: 0.05rem 0.2rem;
}

/* === CALENDAR === */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.calendar-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.calendar-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 0;
  transition: background var(--transition), transform var(--transition);
}

.calendar-nav:hover {
  background: var(--primary-soft);
  transform: scale(1.05);
}

.calendar-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.calendar-day-name,
.calendar-cell {
  text-align: center;
  padding: 0.5rem 0.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.calendar-day-name {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.calendar-cell {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  min-height: 48px;
  display: grid;
  place-items: center;
  transition: all var(--transition);
}

.calendar-cell.empty {
  border-color: transparent;
  background: transparent;
  color: transparent;
}

.calendar-cell.service {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

.calendar-cell.service:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.calendar-cell.service::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.calendar-cell.selected {
  outline: 2.5px solid var(--primary);
  outline-offset: 1px;
}

/* === SERVICE DETAIL MODAL === */
.service-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modalFadeIn 0.2s ease;
  padding: 1rem;
}

.service-modal-overlay[hidden] {
  display: none !important;
}

.service-modal {
  position: relative;
  width: min(640px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.modal-body h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: 0.75rem;
  padding-right: 2rem;
}

.modal-body .meta {
  margin: 0.4rem 0;
}

.modal-body .service-order {
  margin-top: 0.75rem;
}

.modal-body .service-order ol {
  padding-left: 1.25rem;
  margin-top: 0.4rem;
}

.modal-body .service-order li {
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.calendar-details {
  margin-top: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--surface-soft);
  transition: background var(--transition);
}

/* === BIBLE LOOKUP === */
.bible-lookup {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bible-search-row {
  display: flex;
  gap: 0.5rem;
}

.bible-search-row input {
  flex: 1;
}

.btn-primary {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bible-version-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bible-version-row select {
  min-width: 90px;
}

.bible-result {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 60px;
}

.bible-result .verse-ref {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.bible-result .verse-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}

/* === BIBLE.COM LINK BUTTON === */
.bible-com-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.bible-com-link:hover {
  background: var(--primary-dark, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.bible-com-link:active {
  transform: translateY(0);
}

.bible-com-link svg {
  flex-shrink: 0;
}

.bible-daily {
  margin-top: 1.25rem;
}

.bible-daily h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--primary-text);
}

.bible-daily-content {
  padding: 1rem;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* === SCHEDULES: PROGRAM CATEGORIES & DETAILS === */
.program-categories {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.program-category-btn {
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}

.program-category-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.program-category-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-text);
}

.programs-container {
  margin-top: 1rem;
}

.programs-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.program-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.program-btn:hover {
  background: var(--surface-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.program-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.program-details {
  min-height: 200px;
}

.program-card {
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.program-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.program-card h4 {
  margin-bottom: 1rem;
  color: var(--primary-text);
  font-size: 1.1rem;
  font-weight: 700;
}

.program-info {
  margin-top: 0.5rem;
}

.program-info h3 {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 1.25rem;
}

.program-info p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.program-info .section {
  margin-bottom: 1.5rem;
}

.program-info .section h5 {
  margin-bottom: 0.75rem;
  color: var(--primary-text);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.program-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
}

.program-info dt {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.program-info dd {
  color: var(--text);
  margin-left: 0;
}

.worship-order,
.program-order {
  margin-left: 1.5rem;
  padding: 0;
  counter-reset: item;
  list-style: none;
}

.worship-order li,
.program-order li {
  margin-bottom: 0.75rem;
  counter-increment: item;
  color: var(--text);
  line-height: 1.6;
}

.worship-order li::before {
  content: counter(item) ". ";
  font-weight: 700;
  color: var(--primary);
  margin-right: 0.5rem;
}

.program-order li::before {
  content: counter(item) ". ";
  font-weight: 700;
  color: var(--primary);
  margin-right: 0.5rem;
}

.worship-order li ul,
.program-order li ul {
  margin-top: 0.5rem;
  margin-left: 1.5rem;
  list-style-type: disc;
}

.worship-order li ul li,
.program-order li ul li {
  margin-bottom: 0.3rem;
}

/* === FOOTER === */
.site-footer {
  margin-top: 3rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.85rem;
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur));
  border-top: 1px solid var(--border);
}

.footer-top-border {
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  opacity: 0.6;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2.5rem 0 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 0.8fr;
    gap: 2.5rem;
  }
}

/* Brand column */
.footer-brand-col {}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.footer-logo {
  border-radius: 10px;
  flex-shrink: 0;
}

.footer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.footer-tagline {
  font-size: 0.78rem;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-top: 0.1rem;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

.footer-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  display: inline-block;
  flex-shrink: 0;
}

.footer-status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.footer-status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

/* Links column */
.footer-col-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: color var(--transition), transform var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(3px);
}

.footer-links a svg {
  opacity: 0.6;
  transition: opacity var(--transition);
}

.footer-links a:hover svg {
  opacity: 1;
}

/* Social column */
.footer-social-icons {
  display: flex;
  gap: 0.6rem;
}

.footer-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 127, 63, 0.2);
}

[data-theme="dark"] .footer-social-btn:hover {
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.2);
}

/* Bottom bar */
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1rem 0 1.5rem;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.7;
  text-align: center;
}

.footer-bottom a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--transition);
}

.footer-bottom a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-soft);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Responsive footer */
@media (max-width: 767px) {
  .footer-grid {
    text-align: center;
    padding: 2rem 0 1.5rem;
  }

  .footer-brand {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
  }

  .footer-logo {
    width: 32px;
    height: 32px;
  }

  .footer-status {
    justify-content: center;
  }

  .footer-social-icons {
    justify-content: center;
  }

  .footer-bottom-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0.25rem;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
  }

  .back-to-top svg {
    width: 16px;
    height: 16px;
  }
}


.calendar-prompt {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  font-style: italic;
}

#cache-status {
  font-size: 0.7rem;
}

/* === UTILITIES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-inner {
    gap: 0.4rem;
  }

  .header-text h1 {
    font-size: 0.95rem;
  }

  .subtitle {
    font-size: 0.68rem;
  }

  .header-logo {
    width: 30px;
    height: 30px;
  }

  .header-actions {
    gap: 0.3rem;
  }

  .tabs {
    border-radius: var(--radius-md);
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem;
  }

  .tabs-left {
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs-left::-webkit-scrollbar {
    display: none;
  }

  .tabs-right {
    width: 100%;
    gap: 0.4rem;
  }

  .tabs-right select {
    flex: 1;
    max-width: none;
  }

  .tabs-right input[type="search"] {
    flex: 1;
    width: auto;
  }

  .tab-btn {
    font-size: 0.82rem;
    padding: 0.5rem 0.8rem;
    flex-shrink: 0;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .bible-search-row {
    flex-direction: column;
  }

  .tab-panel {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .calendar-grid {
    gap: 0.25rem;
  }

  .calendar-cell {
    min-height: 44px;
    font-size: 0.85rem;
  }

  .service-modal {
    width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-md);
    padding: 1.5rem 1.15rem 1.25rem;
  }

  .service-modal-overlay {
    padding: 0.5rem;
  }

  .service-accordion-header h3 {
    font-size: 0.95rem;
  }

  .panel-header h2 {
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .container {
    width: 96%;
  }

  .site-header {
    padding: 1.15rem 0 0.85rem;
  }

  .header-text h1 {
    font-size: 1.15rem;
  }

  .subtitle {
    font-size: 0.78rem;
  }

  .header-actions {
    gap: 0.25rem;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .nav-link-pill {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }

  .nav-link-pill span {
    display: none;
  }

  .lang-select {
    height: 32px;
    font-size: 0.75rem;
    padding: 0 0.35rem;
  }

  .tab-panel {
    padding: 0.75rem;
  }

  .tab-btn {
    font-size: 0.78rem;
    padding: 0.45rem 0.65rem;
    gap: 0.25rem;
  }

  .tab-btn svg {
    width: 14px;
    height: 14px;
  }

  .tabs-right select,
  .tabs-right input[type="search"] {
    font-size: 0.78rem;
    padding: 0.3rem 0.4rem;
  }

  .tabs-right input[type="search"] {
    padding-left: 1.5rem;
  }

  .calendar-cell {
    min-height: 38px;
    font-size: 0.8rem;
    padding: 0.25rem;
  }

  .calendar-day-name {
    font-size: 0.65rem;
    padding: 0.3rem 0;
  }

  .calendar-cell.service::after {
    width: 4px;
    height: 4px;
    bottom: 2px;
  }

  .calendar-header h3 {
    font-size: 0.95rem;
  }

  .calendar-nav {
    width: 32px;
    height: 32px;
  }

  .service-modal {
    padding: 1.25rem 1rem 1rem;
  }

  .modal-body h4 {
    font-size: 1rem;
  }

  .card {
    padding: 0.85rem;
  }

  .card h3 {
    font-size: 0.92rem;
  }

  /* Service card mobile */
  .service-card-header {
    padding: 0.85rem 1rem;
    gap: 0.65rem;
  }

  .service-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .service-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .service-card-title {
    font-size: 0.92rem;
  }

  .service-card-content {
    padding: 0 1rem 1rem;
  }

  .service-detail-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .service-order-list li {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
  }

  .service-order-list li::before {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }

  .meta {
    font-size: 0.82rem;
  }

  .verse-text {
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
  }

  .verse-num {
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
  }

  .verse-line {
    gap: 0.35rem;
  }
}

@media (max-width: 360px) {
  .container {
    width: 98%;
  }

  .header-text h1 {
    font-size: 1.05rem;
  }

  .tab-btn span {
    display: none;
  }

  .tab-btn svg {
    width: 18px;
    height: 18px;
  }

  .tab-btn {
    padding: 0.5rem 0.75rem;
  }

  .calendar-cell {
    min-height: 34px;
    font-size: 0.75rem;
  }

  .calendar-day-name {
    font-size: 0.6rem;
  }
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */
@media print {
  .site-header, .tabs, .site-footer, .icon-btn, .sync-toast, .offline-banner {
    display: none !important;
  }

  .tab-panel {
    display: block !important;
    background: #fff;
    border: none;
    box-shadow: none;
  }

  .tab-panel[hidden] {
    display: none !important;
  }
}
