/* ============================================================
   DESIGN SYSTEM - CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Colors */
  --color-primary:       #2980b9;
  --color-primary-dark:  #1a5c8a;
  --color-primary-light: #4DA6FF;
  --color-secondary:     #34495e;
  --color-accent:        #27ae60;
  --color-warning:       #f39c12;
  --color-purple:        #8e44ad;
  --color-whatsapp:      #25D366;
  --color-bg:            #f8f9fa;
  --color-bg-alt:        #ffffff;
  --color-bg-dark:       #1a2332;
  --color-text:          #2c3e50;
  --color-text-muted:    #6c757d;
  --color-border:        #dee2e6;
  --color-shadow:        rgba(0, 0, 0, 0.1);

  /* Hero gradient */
  --gradient-hero: linear-gradient(135deg, #1a5c8a 0%, #2980b9 55%, #3498db 100%);

  /* Typography */
  --font-sans:   'Inter', 'Segoe UI', Arial, sans-serif;
  --font-hebrew: 'Assistant', 'Segoe UI', Tahoma, sans-serif;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  2rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;

  /* Border radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);

  /* Nav height */
  --nav-height: 64px;

  /* Transitions */
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

html[lang="he"] body,
html[dir="rtl"] body {
  font-family: var(--font-hebrew);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
}

.site-nav.scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; color: rgba(255,255,255,0.9); }
.site-nav.scrolled .nav-brand { color: var(--color-primary-dark); }

.nav-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
}
.site-nav.scrolled .nav-link { color: var(--color-secondary); }
.site-nav.scrolled .nav-link:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.nav-cta {
  background: transparent;
  border: none;
}
.nav-cta:hover {
  background: transparent !important;
  border: none;
}
.site-nav.scrolled .nav-cta {
  background: transparent;
  border: none;
}
.site-nav.scrolled .nav-cta:hover {
  background: transparent !important;
  border: none;
}

.nav-lang {
  display: flex;
  gap: var(--space-xs);
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all var(--transition);
}
.site-nav.scrolled .nav-toggle span { background: var(--color-secondary); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  min-height: 100vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-lg) var(--space-xl);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.95);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: var(--space-sm);
  font-family: var(--font-hebrew);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-md);
  font-family: var(--font-hebrew);
  font-weight: 300;
  letter-spacing: 0.02em;
}

.hero-desc {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 520px;
  margin: 0 auto var(--space-xl);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: #fff;
  color: var(--color-primary-dark);
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  transition: all var(--transition);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--color-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  text-decoration: none;
  color: var(--color-primary-dark);
}

.btn-secondary {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  text-decoration: none;
  color: #fff;
}

/* ============================================================
   SHARED SECTION STYLES
   ============================================================ */
.section-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
  box-sizing: border-box;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--color-secondary);
  text-align: center;
  margin-bottom: var(--space-sm);
  font-family: var(--font-hebrew);
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: var(--space-xl);
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-section {
  background: var(--color-bg-alt);
}

.about-logo-center {
  display: flex;
  justify-content: center;
  margin: var(--space-lg) auto var(--space-md);
}

.about-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.about-text {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.about-text p {
  color: var(--color-text);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: var(--space-md);
}
.about-text p:last-child { margin-bottom: 0; }

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.stat-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.stat-number--text {
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how-section {
  background: var(--color-bg);
}

.how-steps {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin-top: var(--space-xl);
}

.step-card {
  flex: 1 1 0;
  max-width: 280px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  /* makes all cards the same height as the tallest one */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.step-icon {
  font-size: 2.4rem;
  margin-bottom: var(--space-sm);
  display: block;
}

.step-number {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
}

.step-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.step-mode-list {
  list-style: disc;
  padding-left: 1.2rem;
  margin-top: var(--space-sm);
  text-align: left;
}
html[dir="rtl"] .step-mode-list {
  padding-left: 0;
  padding-right: 1.2rem;
  text-align: right;
}
.step-mode-list li {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 0.35rem;
}
.step-mode-list li:last-child { margin-bottom: 0; }

.how-mode-list {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
  text-align: left;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.how-mode-list li {
  margin-bottom: var(--space-xs);
  padding-left: 1em;
  position: relative;
}

.how-mode-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-primary);
}

[dir="rtl"] .how-mode-list {
  text-align: right;
}

[dir="rtl"] .how-mode-list li {
  padding-left: 0;
  padding-right: 1em;
}

[dir="rtl"] .how-mode-list li::before {
  left: auto;
  right: 0;
}

.step-connector {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  align-self: center;
  flex-shrink: 0;
}

/* ============================================================
   APP PAGE HERO BANNER (compact version for /app page)
   ============================================================ */
.app-hero-section {
  background: var(--gradient-hero);
  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-lg) var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.app-hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.app-hero-content {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.app-hero-content .hero-desc {
  margin-bottom: 0;
}

/* ============================================================
   APP SECTION (existing functionality)
   ============================================================ */
.app-section {
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.app-section .section-container {
  padding-bottom: var(--space-2xl);
}

.app-section .container {
  width: 100%;
  max-width: 800px;
  margin: var(--space-lg) auto 0;
  text-align: center;
  position: relative;
  background: var(--color-bg-alt);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ============================================================
   FAQ SECTION
   ============================================================ */
.faq-section {
  background: var(--color-bg);
}

.faq-list {
  max-width: 720px;
  margin: var(--space-xl) auto 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq-item {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item:hover { box-shadow: var(--shadow-md); }
.faq-item[open] { box-shadow: var(--shadow-md); }

.faq-item summary {
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--color-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  user-select: none;
  transition: background var(--transition);
}
.faq-item summary:hover { background: var(--color-bg); }
.faq-item[open] summary { background: var(--color-bg); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--color-primary);
  font-weight: 300;
  flex-shrink: 0;
  transition: transform var(--transition);
  line-height: 1;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  color: var(--color-text-muted);
  font-size: 0.93rem;
  line-height: 1.75;
  border-top: 1px solid var(--color-border);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-xl) var(--space-lg);
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-lg);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.footer-name {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.footer-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  transition: color var(--transition);
  text-decoration: none;
}
.footer-links a:hover { color: #fff; text-decoration: none; }

.footer-copy {
  text-align: right;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ============================================================
   LANGUAGE SWITCHER (inside nav)
   ============================================================ */
.lang-btn {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
  font-family: inherit;
}
.lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.site-nav.scrolled .lang-btn {
  border-color: var(--color-border);
  color: var(--color-secondary);
}
.site-nav.scrolled .lang-btn:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

/* ============================================================
   BUTTON CONTAINER & ACTION BUTTONS
   ============================================================ */
.button-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.action-btn {
  padding: 12px 25px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: transform var(--transition), box-shadow var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  min-width: 120px;
  font-family: inherit;
}
.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* Show text + Get chapter: equal width, centered */
#toggleButtonContainer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
}
#toggleButtonContainer .action-btn {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Uniform sizing for main action buttons */
#openBtn, #joinBtn, #allocateBtn, #statusBtn,
#shareBtn, #duplicateBtn {
  width: 150px;
  height: 60px;
  padding: 12px 25px;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  min-width: 120px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

/* Button colors */
#openBtn      { background-color: #2980b9; color: white; }
#joinBtn      { background-color: #27ae60; color: white; }
#allocateBtn  { background-color: #8e44ad; color: white; }
#statusBtn    { background-color: #f39c12; color: white; }
#shareBtn     { background-color: #25D366; color: white; }
#duplicateBtn { background-color: #4DA6FF; color: white; }
#checkSelectedBtn {
  background-color: #f39c12;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 25px;
  cursor: pointer;
  font-weight: 500;
  transition: transform var(--transition), box-shadow var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  min-width: 120px;
  margin-top: 20px;
}

#openBtn:hover, #joinBtn:hover, #allocateBtn:hover,
#statusBtn:hover, #shareBtn:hover, #checkSelectedBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.read-all-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}
.read-all-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: var(--space-xl);
  border: none;
  width: 90%;
  max-width: 420px;
  text-align: center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.close {
  color: var(--color-text-muted);
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}
.close:hover { color: var(--color-text); }

/* ============================================================
   TABLE STYLING
   ============================================================ */
.table-container,
#tableStatus {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
}

#tableStatus table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 20px auto;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 20px auto;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table th, table td {
  border: 1px solid var(--color-border);
  padding: 10px 8px;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

table th {
  background-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

table tr:nth-child(even) { background-color: #f9f9f9; }
table tr:hover { background-color: #f0f4f8; }

/* Highlight current user's row */
#tableStatus table tr.highlight { background-color: #d6eaf8; }

/* Action buttons inside table cells */
#tableStatus table td .action-btn {
  min-width: 0;
  padding: 8px 12px;
  font-size: 0.75rem;
}
/* Override UA centering; use start so LTR = left, RTL = right */
#tableStatus table td:last-child .action-btn,
#tableStatus table td:last-child .read-all-btn {
  text-align: start;
}
#tableStatus table td:last-child .status-actions-cell {
  align-items: stretch;
}

/* ============================================================
   DISPLAY AREAS
   ============================================================ */
#codeDisplay {
  font-size: 1.2rem;
  margin: 20px 0;
  font-weight: bold;
  color: var(--color-primary);
}

.dedication-display {
  font-size: 0.95rem;
  font-style: italic;
  color: #5a6b7a;
  margin: -12px 0 16px;
  line-height: 1.4;
  /* Do not inherit .app-section .container text-align: center */
  text-align: left;
}

html[dir="rtl"] .dedication-display {
  text-align: right;
}

/* Recent books chips in join modal */
.recent-books-label {
  font-size: 0.82rem;
  color: var(--color-text-muted, #888);
  margin: 0.75rem 0 0.4rem;
  text-align: center;
}
#recentBooksChips,
#recentBooksMainChips {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.5rem;
  overflow-x: auto;
}
#recentBooksMainChips .recent-book-chip {
  flex: 1 1 0;
  min-width: 90px;
  max-width: 160px;
}

/* Modal: chips stacked vertically, full width like inputs */
#recentBooksModalChips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.5rem;
  width: 100%;
}
#recentBooksModalChips .recent-book-chip {
  width: 100%;
  max-width: 100%;
  flex-direction: row;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  box-sizing: border-box;
}
.recent-book-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--color-primary, #2176ae);
  border-radius: 12px;
  background: transparent;
  color: var(--color-primary, #2176ae);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  min-width: 90px;
  text-align: center;
}
.recent-book-chip:hover {
  background: #e8f3fb;
  color: var(--color-primary, #2176ae);
  box-shadow: 0 2px 8px rgba(33,118,174,0.12);
}
.recent-book-chip.selected {
  background: #daeef9;
  color: var(--color-primary-dark, #1a5c8a);
  border-color: #7bbfdf;
  box-shadow: 0 2px 10px rgba(33,118,174,0.15);
}
#recentBooksModalChips .recent-book-chip.selected {
  background: #daeef9;
  color: var(--color-primary-dark, #1a5c8a);
  border-color: #7bbfdf;
  box-shadow: 0 2px 10px rgba(33,118,174,0.15);
  font-weight: 700;
}
#recentBooksModalChips .recent-book-chip.selected .rb-progress,
#recentBooksModalChips .recent-book-chip.selected .rb-meta,
#recentBooksModalChips .recent-book-chip.selected .rb-code {
  color: var(--color-primary-dark, #1a5c8a);
  opacity: 1;
}
.recent-book-chip .rb-code {
  font-weight: 700;
  font-size: 1rem;
}
.recent-book-chip .rb-owner {
  font-size: 0.8rem;
  opacity: 0.85;
}
.recent-book-chip .rb-progress {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.9;
}
.recent-book-chip .rb-meta {
  font-size: 0.72rem;
  opacity: 0.7;
}

#openBookModal .modal-content { max-width: 480px; }

#openBookModal .form-group {
  margin: 1rem 0;
  text-align: left;
}

#openBookModal .form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  text-align: center;
}

#openBookModal .dedicated-to-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#openBookModal .dedicated-to-row select,
#openBookModal .dedicated-to-row input[type="text"] {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--color-border, #ddd);
  font-family: inherit;
  font-size: 1rem;
}

#openBookModal .dedicated-to-row select {
  flex: 1 1 auto;
  min-height: 2.5rem;
  appearance: auto;
  padding-right: 2rem;
  text-overflow: ellipsis;
}

#openBookModal .dedication-entry {
  margin-bottom: 0.5rem;
}

#openBookModal .dedication-entry:last-of-type {
  margin-bottom: 0;
}

#openBookModal .dedicated-to-row {
  position: relative;
  padding-right: 2rem;
}

html[dir="rtl"] #openBookModal .dedicated-to-row {
  padding-right: 0;
  padding-left: 2rem;
}

#openBookModal .dedication-remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-border, #ddd);
  color: var(--color-text-muted, #666);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

#openBookModal .dedication-remove-btn:hover {
  background: #ccc;
  color: #333;
}

html[dir="rtl"] #openBookModal .dedication-remove-btn {
  right: auto;
  left: 0;
}
html[dir="rtl"] #openBookModal .dedication-add-btn {
  margin-right: 0;
  margin-left: auto;
  text-align: right;
}
html[dir="rtl"] #openBookModal .form-group {
  text-align: right;
}

#openBookModal .dedication-add-btn {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.5rem;
  margin-left: 0;
  margin-right: auto;
  text-align: left;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  background: transparent;
  color: var(--color-primary, #2980b9);
  border: 1px dashed var(--color-primary, #2980b9);
}

#openBookModal .dedication-add-btn:hover {
  background: rgba(41, 128, 185, 0.08);
}

#openBookModal .form-group small {
  display: block;
  margin-top: 0.35rem;
  color: #666;
  font-size: 0.85em;
}

#tableStatus .status-dedication {
  font-style: italic;
  color: #5a6b7a;
  margin: 0 0 12px;
  font-size: 0.95rem;
}

#tableStatus { margin-top: 20px; }

#textStatus {
  margin-top: 20px;
  white-space: pre-line;
  background: #fff;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: left;
  border: 1px solid var(--color-border);
}

#textStatus [dir="rtl"]         { text-align: right; }
#textStatus [dir="ltr"]         { text-align: left; }
#textStatus div[dir="rtl"] h4   { text-align: right; }
#textStatus div[dir="ltr"] h4   { text-align: left; }
/* English UI: keep chapter titles (e.g. Psalm N) on the left when body is RTL Hebrew */
html[dir="ltr"] #textStatus div[dir="rtl"] h4 { text-align: left; }
/* English UI: Mark as read (and other chapter action buttons) on the left when body is RTL Hebrew */
html[dir="ltr"] #textStatus div[dir="rtl"] .action-btn {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-left: 0;
  margin-right: auto;
}

/* ============================================================
   TEXT CONTROLS (font size + language toggle)
   ============================================================ */
.text-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.text-controls button {
  border: none;
  background-color: var(--color-primary-light);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-family: inherit;
}
.text-controls button:hover {
  background-color: #3d96ef;
  transform: scale(1.05);
}
.text-controls button:active { transform: scale(0.98); }

#decreaseFontBtn, #increaseFontBtn {
  width: 36px;
  height: 36px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#textLangHebrew, #textLangTranslit, #textLangEnglish {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  min-width: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity 0.2s, background-color 0.2s, transform 0.1s;
}
#textLangHebrew.active,
#textLangTranslit.active,
#textLangEnglish.active {
  opacity: 1;
  background-color: var(--color-primary-dark);
  font-weight: bold;
}
#textLangHebrew:hover,
#textLangTranslit:hover,
#textLangEnglish:hover { opacity: 1; }

/* ============================================================
   INPUTS
   ============================================================ */
input[type="text"] {
  padding: 10px 14px;
  margin-bottom: 15px;
  font-size: 1rem;
  width: 260px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
  background: #fff;
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.12);
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.hidden { display: none !important; }

#loadingOverlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  backdrop-filter: blur(2px);
}

.spinner {
  border: 4px solid #eee;
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   HEADINGS
   ============================================================ */
h1, h2, h3 {
  font-family: var(--font-hebrew);
}

/* ============================================================
   RESPONSIVE - 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    max-width: 500px;
    margin: 0 auto;
  }
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-md);
  }
  .footer-brand   { justify-content: center; }
  .footer-copy    { text-align: center; }
}

/* ============================================================
   RESPONSIVE - 768px (tablet / mobile nav)
   ============================================================ */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--color-border);
  }
  .nav-menu.open { display: flex; }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-link {
    color: var(--color-secondary) !important;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
  }
  .nav-link:hover {
    background: var(--color-bg);
    color: var(--color-primary) !important;
  }
  .nav-cta {
    background: transparent !important;
    border: none !important;
    text-align: center;
    margin-top: var(--space-xs);
  }
  .nav-lang {
    justify-content: center;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-sm);
  }
  .lang-btn {
    border-color: var(--color-border);
    color: var(--color-secondary);
  }

  .how-steps {
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
  }
  .step-connector {
    width: 2px;
    height: 40px;
    margin: calc(-1 * var(--space-lg)) 0;
    background: linear-gradient(180deg, var(--color-primary), var(--color-primary-light));
  }
  .step-card { max-width: 340px; width: 100%; }

  .footer-links { gap: var(--space-sm); }

  /* Status table: compact on tablet */
  #tableStatus table {
    font-size: 0.85rem;
    table-layout: fixed;
    width: 100%;
  }
  #tableStatus table th,
  #tableStatus table td {
    padding: 8px 6px;
  }
  #tableStatus table td .action-btn {
    padding: 8px 12px;
    font-size: 0.7rem;
  }
  /* Stack action buttons vertically on tablet and below */
  #tableStatus table td:last-child .status-actions-cell {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch;
    gap: 6px;
  }
}

/* ============================================================
   RESPONSIVE - 480px (mobile)
   ============================================================ */
@media (max-width: 480px) {
  .section-container {
    padding: var(--space-xl) var(--space-md);
    max-width: 100%;
  }
  .hero-section {
    padding: calc(var(--nav-height) + var(--space-lg)) var(--space-md) var(--space-xl);
  }

  input[type="text"] { width: 90%; }

  .about-stats { grid-template-columns: 1fr; gap: var(--space-sm); }

  .button-container { gap: 8px; }
  #openBtn, #joinBtn, #allocateBtn,
  #statusBtn, #shareBtn, #duplicateBtn {
    width: 150px;
    min-height: 60px;
    height: auto;
    font-size: 0.78rem;
    padding: 10px 8px;
    white-space: normal;
    line-height: 1.3;
  }
  #checkSelectedBtn {
    max-width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 0.75rem;
  }

  .app-section .container {
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--radius-lg);
  }

  .modal-content {
    margin: 15% auto;
    padding: var(--space-lg);
  }

  /* Status table: fully responsive on mobile, no overflow */
  #tableStatus {
    max-width: 100%;
  }
  #tableStatus table {
    font-size: 12px;
    table-layout: fixed;
    width: 100%;
  }
  #tableStatus table th,
  #tableStatus table td {
    padding: 6px 4px;
    font-size: 12px;
  }
  #tableStatus table td .action-btn {
    padding: 6px 8px;
    font-size: 0.65rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  /* Stack action buttons vertically in Actions column */
  #tableStatus table td:last-child .status-actions-cell {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch;
    gap: 4px;
  }
  #tableStatus table td:last-child .status-actions-cell .action-btn {
    width: 100%;
  }
}

/* ============================================================
   DONATE PAGE
   ============================================================ */
.donate-hero-section {
  background: var(--gradient-hero);
  color: #fff;
  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-lg) var(--space-xl);
  text-align: center;
}
.donate-hero-section .hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}
.donate-hero-section .hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.5;
}
.donate-hero-section .hero-desc {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(255, 255, 255, 0.85);
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Purpose cards */
.donate-purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
  max-width: 900px;
  margin: var(--space-lg) auto 0;
}
.donate-purpose-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--color-border);
  cursor: pointer;
  transition: all 0.25s ease;
}
.donate-purpose-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}
.donate-purpose-card.selected {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  background: rgba(41, 128, 185, 0.06);
}
.donate-purpose-card input[type="radio"] { display: none; }
.donate-purpose-card .purpose-icon { font-size: 2rem; margin-bottom: var(--space-sm); display: block; }
.donate-purpose-card h3 { font-size: 1rem; font-weight: 600; color: var(--color-secondary); margin: 0 0 var(--space-xs); }
.donate-purpose-card p { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; margin: 0; }

/* Amount grid */
.donate-currency-toggle {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-md) auto 0;
}
.donate-currency-btn {
  padding: 0.4rem 1.2rem;
  border: 2px solid var(--color-primary, #2176ae);
  border-radius: 999px;
  background: transparent;
  color: var(--color-primary, #2176ae);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.donate-currency-btn.selected {
  background: var(--color-primary, #2176ae);
  color: #fff;
}
.donate-currency-btn:hover:not(.selected) {
  background: var(--color-primary-light, #e8f1fb);
}
.donate-amount-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  max-width: 600px;
  margin: var(--space-lg) auto 0;
}
.donate-amount-card {
  min-width: 90px;
  padding: 0.8rem 1.5rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-alt);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: inherit;
}
.donate-amount-card:hover {
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.donate-amount-card.selected {
  border-color: var(--color-primary);
  background: rgba(41, 128, 185, 0.06);
  color: var(--color-primary-dark);
}
.donate-custom-input {
  width: 120px;
  padding: 0.8rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease;
}
.donate-custom-input:focus {
  border-color: var(--color-primary);
}

/* Prayer names board */
.prayer-board-section {
  padding-top: 0;
}

/* Prayer names dedicated page - footer pinned to bottom */
.prayer-names-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.prayer-names-page .prayer-board-section {
  flex: 1;
}
.prayer-names-page .hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
  font-weight: 400;
}

/* Prayer names button below payment buttons */
.donate-btn-prayer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.donate-btn-prayer-link:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}
.prayer-board-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-top: var(--space-md);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
html[dir="rtl"] .prayer-board-chips {
  flex-direction: row-reverse;
}
.prayer-board-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
  color: var(--color-secondary);
  cursor: default;
  position: relative;
  max-width: 100%;
}
.prayer-board-chip.prayer-board-chip--voted {
  border-color: var(--color-primary);
  background: rgba(41, 128, 185, 0.06);
}
.prayer-board-chip-intent {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  line-height: 1.2;
}
.prayer-board-chip-intent--healing {
  background: rgba(39, 174, 96, 0.18);
  color: #1e8449;
}
.prayer-board-chip-intent--memory {
  background: rgba(142, 68, 173, 0.15);
  color: #6c3483;
}
.prayer-board-chip-intent--general {
  background: rgba(127, 140, 141, 0.2);
  color: #566573;
}
.prayer-board-chip-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.prayer-board-chip-count {
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  min-width: 1.25em;
  text-align: center;
  flex-shrink: 0;
}
.prayer-board-chip-toggle {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: #fff;
  color: var(--color-primary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
}
.prayer-board-chip-toggle:hover {
  background: rgba(41, 128, 185, 0.12);
}
.prayer-board-chip-toggle[aria-pressed="true"] {
  background: var(--color-primary);
  color: #fff;
}
.prayer-board-chip-toggle[aria-pressed="true"]:hover {
  background: var(--color-primary-dark, #1a5c8a);
  color: #fff;
  opacity: 0.85;
}
.prayer-board-empty {
  text-align: center;
  margin-top: var(--space-md);
}

.thankyou-prayer-block {
  margin-top: var(--space-lg);
  text-align: inherit;
}
html[dir="rtl"] .thankyou-prayer-block {
  text-align: right;
}
html[dir="ltr"] .thankyou-prayer-block {
  text-align: left;
}
.thankyou-prayer-rule {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-md) 0;
}
.thankyou-prayer-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin: 0 0 0.35rem;
}
.thankyou-prayer-sub {
  font-size: 0.9rem;
  margin: 0 0 var(--space-sm);
}
.thankyou-prayer-intent {
  border: none;
  padding: 0;
  margin: 0 0 var(--space-md);
}
.thankyou-prayer-intent-legend {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-secondary);
  padding: 0;
  margin: 0 0 0.5rem;
}
.thankyou-prayer-intent-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.thankyou-prayer-intent-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1.35;
}
.thankyou-prayer-intent-option input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.thankyou-prayer-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-secondary);
}
.thankyou-prayer-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-family: inherit;
}
html[dir="rtl"] .thankyou-prayer-input {
  text-align: right;
}
.thankyou-prayer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}
html[dir="rtl"] .thankyou-prayer-actions {
  flex-direction: row-reverse;
}
.thankyou-prayer-skip {
  background: none;
  border: none;
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  font-family: inherit;
}
.thankyou-prayer-success {
  color: var(--color-primary-dark);
  font-weight: 600;
  margin-top: var(--space-sm);
}

/* Payment buttons */
.donate-payment-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin: var(--space-xl) auto 0;
  flex-wrap: wrap;
}
/* Author display:* rules override the default [hidden] UA style - force hide when JS sets hidden */
.donate-payment-buttons[hidden],
#paypalForm[hidden],
a.donate-btn[hidden] {
  display: none !important;
}
.donate-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
}
.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;
}

/* PayPal styled button */
#paypalForm {
  display: inline-block;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}
.donate-btn.donate-btn-paypal {
  background: #ffc439;
  color: #003087;
  border-radius: 50px;
  gap: 0.6rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.donate-btn-paypal__logo {
  height: 22px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.donate-btn-paypal:hover {
  background: #f0b429;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.donate-btn-paypal:focus-visible {
  outline: 2px solid #003087;
  outline-offset: 2px;
  border-radius: 50px;
}
.donate-btn-stripe {
  background: #635bff;
}
.donate-btn-stripe:hover {
  background: #4b45c6;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Trust section */
.donate-trust-section {
  background: var(--color-bg);
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}
.donate-trust-items {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.donate-trust-item {
  flex: 1 1 150px;
  max-width: 200px;
}
.donate-trust-item .trust-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: var(--space-xs);
}
.donate-trust-item h4 {
  font-size: 0.95rem;
  color: var(--color-secondary);
  margin: 0 0 var(--space-xs);
}
.donate-trust-item p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Thank you modal (?thanks=1) */
body.donate-modal-open {
  overflow: hidden;
}
.donate-thankyou-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  box-sizing: border-box;
}
.donate-thankyou-modal[hidden] {
  display: none !important;
}
.donate-thankyou-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}
.donate-thankyou-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--color-border);
  animation: donate-modal-in 0.25s ease;
}
@keyframes donate-modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.donate-thankyou-modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.donate-thankyou-modal__close:hover {
  background: var(--color-bg-alt);
  color: var(--color-secondary);
}
.donate-thankyou-modal__close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.donate-thankyou-modal__body {
  padding: 2.25rem 1.75rem 1.75rem;
  text-align: center;
}
.donate-thankyou-modal .donate-thankyou-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}
.donate-thankyou-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin: 0 0 0.65rem;
  font-family: var(--font-hebrew);
}
.donate-thankyou-msg {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

html[dir="rtl"] .donate-thankyou-modal__close {
  right: auto;
  left: var(--space-sm);
}

/* Donate CTA banner (used in app popups and about section) */
.donate-cta-banner {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: rgba(41, 128, 185, 0.06);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--color-border);
}
.donate-cta-banner p {
  margin: 0 0 var(--space-sm);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.donate-cta-banner .donate-cta-link {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.donate-cta-banner .donate-cta-link:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}
.donate-cta-dismiss {
  display: inline-block;
  margin-left: var(--space-sm);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  border: none;
  background: none;
  font-family: inherit;
}

/* About section donate card */
.about-donate-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-top: var(--space-lg);
}
.about-donate-card h3 {
  color: var(--color-secondary);
  margin: 0 0 var(--space-sm);
}
.about-donate-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0 0 var(--space-md);
}
.about-donate-card .donate-cta-link {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s ease;
}
.about-donate-card .donate-cta-link:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

@media (max-width: 600px) {
  .donate-purpose-grid { grid-template-columns: 1fr 1fr; }
  .donate-payment-buttons { flex-direction: column; align-items: center; }
  .donate-amount-grid { gap: var(--space-sm); }
  .donate-amount-card { min-width: 70px; padding: 0.6rem 1rem; font-size: 1rem; }
  .donate-trust-items { gap: var(--space-lg); }
}

/* ============================================================
   RTL / HEBREW OVERRIDES
   ============================================================ */
html[dir="rtl"] .nav-container    { flex-direction: row-reverse; }
html[dir="rtl"] .nav-brand        { flex-direction: row-reverse; }
html[dir="rtl"] .nav-menu         { flex-direction: row-reverse; }
html[dir="rtl"] .footer-brand     { flex-direction: row-reverse; }
html[dir="rtl"] .footer-copy      { text-align: left; }
html[dir="rtl"] .close            { float: left; }
/* Toolbar flush right in Hebrew UI (ltr flex axis + flex-end = end is physical right) */
html[dir="rtl"] .text-controls {
  direction: ltr;
  flex-direction: row;
  justify-content: flex-end;
}
html[dir="rtl"] .faq-item summary { flex-direction: row-reverse; }
html[dir="rtl"] .about-text p     { direction: rtl; }
html[dir="rtl"] .step-connector   { transform: scaleX(-1); }
html[dir="rtl"] .hero-actions     { flex-direction: row-reverse; }
html[dir="rtl"] .hero-content     { direction: rtl; }
html[dir="rtl"] .app-hero-content { direction: rtl; }
html[dir="rtl"] .footer-links     { direction: rtl; }
html[dir="rtl"] .donate-hero-section { direction: rtl; }
html[dir="rtl"] .donate-payment-buttons { flex-direction: row-reverse; }
html[dir="rtl"] .donate-cta-dismiss { margin-left: 0; margin-right: var(--space-sm); }

@media (max-width: 768px) {
  html[dir="rtl"] .nav-menu { flex-direction: column; }
  html[dir="rtl"] .step-connector { transform: none; }
}

/* --- Prayer name entries in Open Book modal --- */
.prayer-name-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}
.prayer-name-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-family: inherit;
}
html[dir="rtl"] .prayer-name-input {
  text-align: right;
}
.prayer-name-remove-btn {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: none;
  background: #eee;
  color: #999;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.prayer-name-remove-btn:hover {
  background: #ccc;
  color: #333;
}

/* --- Prayer checkbox list in Join modal --- */
#joinPrayerSelection h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--color-secondary);
}
#joinPrayerList {
  max-height: min(50vh, 20rem);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  margin: 0 -2px 0 0;
}
.prayer-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.15s ease;
}
.prayer-checkbox-label:hover {
  background: rgba(41, 128, 185, 0.06);
}
.prayer-checkbox {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}
.prayer-checkbox-name {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
html[dir="rtl"] .prayer-checkbox-name {
  text-align: right;
}
.prayer-checkbox-count {
  font-size: 0.8rem;
  color: #888;
}
.skip-link {
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
}
