/* =========================================================
   Queen's Highway — DESIGN SYSTEM
   ========================================================= */
/* ---------- GLOBAL TRANSITIONS ---------- */
.pillar-card,
.course-card,
.dash-card,
.dash-card-blush,
.dash-card-sage,
.dash-card-gold,
.dash-card-purple,
.thread-card,
.zone-white,
.zone-blush,
.zone-sage,
.zone-gold,
.auth-card,
.admin-form-card,
.admin-list-card,
.stat-card,
.qa-card,
.thread-detail-body,
.reply-card,
.lesson-viewer,
.panel-section {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.45s ease forwards;
}

.pillar-card:nth-child(1)  { animation-delay: 0.05s; }
.pillar-card:nth-child(2)  { animation-delay: 0.10s; }
.pillar-card:nth-child(3)  { animation-delay: 0.15s; }
.pillar-card:nth-child(4)  { animation-delay: 0.20s; }
.pillar-card:nth-child(5)  { animation-delay: 0.25s; }
.pillar-card:nth-child(6)  { animation-delay: 0.30s; }
.pillar-card:nth-child(7)  { animation-delay: 0.35s; }
.pillar-card:nth-child(8)  { animation-delay: 0.40s; }

.course-card:nth-child(1)  { animation-delay: 0.05s; }
.course-card:nth-child(2)  { animation-delay: 0.10s; }
.course-card:nth-child(3)  { animation-delay: 0.15s; }
.course-card:nth-child(4)  { animation-delay: 0.20s; }
.course-card:nth-child(5)  { animation-delay: 0.25s; }
.course-card:nth-child(6)  { animation-delay: 0.30s; }

.dash-card-blush  { animation-delay: 0.05s; }
.dash-card-sage   { animation-delay: 0.10s; }
.dash-card-gold   { animation-delay: 0.15s; }
.dash-card-purple { animation-delay: 0.20s; }

.thread-card:nth-child(1)  { animation-delay: 0.05s; }
.thread-card:nth-child(2)  { animation-delay: 0.10s; }
.thread-card:nth-child(3)  { animation-delay: 0.15s; }
.thread-card:nth-child(4)  { animation-delay: 0.20s; }
.thread-card:nth-child(5)  { animation-delay: 0.25s; }

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

:root {
  --blush: #F2467B;
  --blush-light: #FBB8C9;
  --sage: #5FAE52;
  --cream: #FDF6EC;
  --gold: #E8A623;
  --charcoal: #2D2D2D;

  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ---------- HEADER ---------- */
.site-header {
  background: linear-gradient(135deg, #FFE3EC 0%, #FDF6EC 100%);
  border-bottom: 1px solid var(--blush-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dashboard-section h1 {
  position: relative;
  z-index: 1;
}

.nav-wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--charcoal);
}

nav { display: flex; align-items: center; gap: 1.8rem; }

nav a:not(.btn) {
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--charcoal);
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--blush);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(244, 167, 185, 0.4);
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--charcoal);
}

.btn-lg { padding: 0.9rem 2rem; font-size: 1rem; }

/* ---------- HERO ---------- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 1.5rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

.hero p {
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 2.2rem;
  color: #5a5a5a;
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- PILLARS ---------- */
.pillars-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  text-align: center;
}

.pillars-section h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

.section-sub {
  color: #6a6a6a;
  margin-bottom: 3rem;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: left;
}

.pillar-card {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  transition: transform 0.15s ease;
}

.pillar-card:hover { transform: translateY(-4px); }

.pillar-card-locked {
  cursor: default;
  opacity: 0.88;
}
.pillar-card-locked:hover { transform: none; }

.pillar-lock {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #bbb;
}

.pillar-icon { font-size: 2rem; margin-bottom: 0.8rem; margin-top: 0.4rem; }

.pillar-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.pillar-card p {
  font-size: 0.9rem;
  color: #6a6a6a;
}

.loading-text {
  grid-column: 1 / -1;
  color: #999;
}

/* ---------- COURSES (HOMEPAGE) ---------- */
.courses-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  text-align: center;
}

.courses-section h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

/* ---------- CTA BANNER (HOMEPAGE) ---------- */
.cta-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  text-align: center;
}

.cta-section h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.cta-section p {
  color: #6a6a6a;
  margin-bottom: 1.8rem;
}

/* ---------- FOOTER ---------- */
.site-footer {
  text-align: center;
  padding: 2.5rem;
  color: #888;
  font-size: 1rem;
  border-top: 1px solid var(--blush-light);
  background: linear-gradient(135deg, #FDF6EC 0%, #FFE3EC 100%);
}

/* ---------- AUTH PAGES (Login / Register) ---------- */
.auth-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 20px;
  padding: 2.8rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}

.auth-sub {
  color: #6a6a6a;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

#register-form label,
#login-form label,
#forgot-password-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  margin-top: 1.1rem;
}

#register-form input,
#login-form input,
#forgot-password-form input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--blush-light);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--cream);
}

#register-form input:focus,
#login-form input:focus,
#forgot-password-form input:focus {
  outline: none;
  border-color: var(--blush);
}

.btn-block {
  width: 100%;
  text-align: center;
  margin-top: 1.8rem;
  border: none;
  cursor: pointer;
}

.form-message {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.form-message.error { color: #c0392b; }
.form-message.success { color: #2e7d4f; }

.auth-switch {
  text-align: center;
  margin-top: 1.8rem;
  font-size: 0.9rem;
  color: #6a6a6a;
}

.auth-switch a {
  color: var(--blush);
  font-weight: 700;
}

/* ---------- DASHBOARD ---------- */
.dashboard-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.dashboard-section h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.dash-card {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  transition: transform 0.15s ease;
  display: block;
}

.dash-card:hover { transform: translateY(-4px); }

.dash-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.dash-card p {
  font-size: 0.9rem;
  color: #6a6a6a;
}

/* ---------- ADMIN TAG ---------- */
.admin-tag {
  background: var(--gold);
  color: #fff;
  font-size: 0.65rem;
  font-family: var(--font-body);
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ---------- ADMIN CONTENT LAYOUT ---------- */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}

.admin-form-card,
.admin-list-card {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.admin-form-card h3,
.admin-list-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
}

#course-form label,
#lesson-form label,
#profile-form label,
#child-form label,
#article-form label,
#ask-question-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

#course-form input,
#course-form select,
#course-form textarea,
#lesson-form input,
#lesson-form select,
#lesson-form textarea,
#profile-form input,
#profile-form select,
#profile-form textarea,
#child-form input,
#child-form select,
#child-form textarea,
#article-form input,
#article-form select,
#article-form textarea,
#ask-question-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--blush-light);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--cream);
}

#course-form textarea,
#lesson-form textarea,
#article-form textarea,
#ask-question-form textarea { resize: vertical; }

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500 !important;
}

.checkbox-label input { width: auto !important; }

.course-item {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--blush-light);
  gap: 0.5rem;
}

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

.course-item-title { font-weight: 700; font-size: 0.95rem; }
.course-item-meta { font-size: 0.8rem; color: #888; }

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.badge-draft { background: #eee; color: #777; }
.badge-published { background: var(--sage); color: #fff; }
.badge-premium { background: var(--gold); color: #fff; }

/* ---------- TOAST CONFIRMATION ---------- */
.toast-confirm {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--charcoal) !important;
  color: #fff !important;
  padding: 0.9rem 1.6rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
}

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

/* ---------- LESSON ROW ACTIONS ---------- */
.lesson-row { align-items: center; }

.lesson-actions {
  display: flex;
  gap: 0.4rem;
}

.icon-btn {
  background: var(--cream);
  border: 1px solid var(--blush-light);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.icon-btn:hover { background: var(--blush-light); }
.icon-btn-danger:hover { background: #fbdede; }

/* ---------- VIEW LESSON MODAL ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  width: 100%;
}

.modal-box h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.modal-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #444;
}

/* ---------- MARKDOWN TOOLBAR ---------- */
.md-toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.md-btn {
  background: var(--cream);
  border: 1px solid var(--blush-light);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}

.md-btn:hover { background: var(--blush-light); }

.md-btn-template {
  background: var(--sage);
  color: #fff;
  border-color: var(--sage);
  margin-left: auto;
}

.field-hint {
  font-size: 0.78rem;
  color: #999;
  margin-top: 0.4rem;
}

/* ---------- LIVE PREVIEW BOX ---------- */
.content-preview-box {
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--cream);
  border: 1px dashed var(--gold);
  border-radius: 12px;
}

/* ---------- RENDERED LESSON CONTENT ---------- */
.lesson-content h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--charcoal);
  margin: 1.5rem 0 0.8rem;
  border-bottom: 2px solid var(--blush-light);
  padding-bottom: 0.4rem;
}

.lesson-content h2:first-child { margin-top: 0; }

.lesson-content h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--blush);
  margin: 1.3rem 0 0.6rem;
}

.lesson-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: #444;
  font-size: 1.1rem;
}

.lesson-content strong { color: var(--charcoal); }

.lesson-content blockquote {
  background: var(--blush-light);
  border-left: 4px solid var(--blush);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: #5a3a42;
  font-size: 1.1rem;
}

.lesson-content ul {
  margin: 0 0 1.2rem 1.2rem;
  padding-left: 0.5rem;
}

.lesson-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  font-size: 1.1rem;
}

.lesson-content img {
  width: 100%;
  border-radius: 14px;
  margin: 1.2rem 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.modal-box .modal-body { font-size: inherit; }

/* ---------- LIBRARY HERO ---------- */
.library-hero {
  text-align: center;
  padding: 4rem 2rem 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.library-hero h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  margin-bottom: 0.6rem;
}

.library-hero p {
  color: #6a6a6a;
  font-size: 1.05rem;
}

/* ---------- PILLAR FILTER CHIPS ---------- */
.library-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem 5rem;
}

.library-filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 3rem;
}

.filter-chip {
  background: #fff;
  border: 1.5px solid var(--blush-light);
  border-radius: 50px;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--charcoal);
}

.filter-chip:hover { border-color: var(--blush); }

.filter-chip.active {
  background: var(--blush);
  border-color: var(--blush);
  color: #fff;
}

/* ---------- COURSE GRID ---------- */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}

.course-card {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(244,167,185,0.25);
}

.course-card-thumb {
  height: 160px;
  background: linear-gradient(135deg, var(--blush-light), var(--cream));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
}

.course-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card-badge {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: var(--gold);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
}

.course-card-body {
  padding: 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-card-pillar {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blush);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.course-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.course-card-desc {
  font-size: 0.88rem;
  color: #6a6a6a;
  flex: 1;
  margin-bottom: 0.8rem;
}

.course-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sage);
  padding-top: 0.8rem;
  border-top: 1px solid var(--blush-light);
}

.course-card-price { color: var(--gold); }

/* Pillar stats on landing page */
.pillar-stats {
  margin-bottom: 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: #e8336d;
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
  letter-spacing: 0.01em;
}

/* Chip course count badge */
.chip-count {
  display: inline-block;
  background: #e8336d;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}

/* Library full-width layout override */
.app-panel-library { display: none !important; }
.app-shell:has(.app-panel-library) .app-main {
  grid-column: 2 / 4;
  max-width: 100%;
}
.app-shell:has(.app-panel-library) #courses-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Admin course list action buttons */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-action:hover { opacity: 0.8; }
.btn-view  { background: #e8f4fd; color: #1a6fb0; }
.btn-edit  { background: #fff8e1; color: #b07a00; }
.btn-delete { background: #fdecea; color: #c0392b; }

/* ---------- COURSE HERO (detail page) ---------- */
.course-hero {
  background: linear-gradient(135deg, var(--blush-light), var(--cream));
  padding: 3.5rem 2rem;
  text-align: center;
}

.course-hero-pillar {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blush);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.course-hero h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  max-width: 700px;
  margin: 0 auto 0.8rem;
}

.course-hero p {
  max-width: 600px;
  margin: 0 auto;
  color: #5a5a5a;
}

.course-hero-meta {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
}

/* ---------- COURSE BODY LAYOUT ---------- */
.course-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.course-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
}

.lessons-sidebar {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 18px;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.lessons-sidebar h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.lesson-nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  transition: background 0.15s ease;
}

.lesson-nav-item:hover { background: var(--cream); }

.lesson-nav-item.active {
  background: var(--blush-light);
  color: var(--charcoal);
}

.lesson-nav-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.lesson-nav-item.locked .lesson-nav-number { background: #ccc; }
.lesson-nav-item.locked { color: #999; cursor: not-allowed; }
.lesson-lock-icon { margin-left: auto; font-size: 0.85rem; }

/* ---------- LESSON VIEWER ---------- */
.lesson-viewer {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 20px;
  padding: 2.5rem;
  min-height: 400px;
}

.lesson-viewer-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 2px solid var(--blush-light);
}

.lesson-locked-message {
  text-align: center;
  padding: 3rem 1rem;
}

.lesson-locked-message h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

.lesson-locked-message p {
  color: #6a6a6a;
  margin-bottom: 1.5rem;
}

/* ---------- PROFILE LAYOUT ---------- */
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.profile-layout input:disabled {
  background: #eee;
  color: #888;
}

.child-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--blush-light);
}

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

/* ---------- ARTICLE DETAIL PAGE ---------- */
.article-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3.5rem 2rem 2.5rem;
  position: relative;
  z-index: 1;
}

.article-pillar-tag {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--blush);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.article-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1.25;
  margin-bottom: 0.8rem;
}

.article-meta {
  font-size: 1rem;
  color: #999;
  margin-bottom: 2.2rem;
  padding-bottom: 1.8rem;
  border-bottom: 2px solid var(--blush-light);
}

.article-thumb {
  width: 100%;
  border-radius: 18px;
  margin-bottom: 2.2rem;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.article-locked-message {
  text-align: center;
  padding: 4rem 1.5rem;
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 18px;
}

.article-locked-message h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

.article-locked-message p {
  color: #6a6a6a;
  margin-bottom: 1.5rem;
}

/* ---------- DECORATIVE PAGE BACKGROUND ---------- */
.page-bg-wrap {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.page-bg-wrap > .site-header,
.page-bg-wrap > .site-footer {
  position: relative;
  z-index: 1;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

.bg-blob-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--blush-light) 0%, transparent 72%);
  top: -120px;
  left: -200px;
}

.bg-blob-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #DFF5D8 0%, transparent 72%);
  top: 28%;
  right: -180px;
}

.bg-blob-3 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #FFF1CC 0%, transparent 72%);
  bottom: -140px;
  left: 8%;
}

/* ---------- COMMUNITY TOOLBAR ---------- */
.community-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

/* ---------- THREADS LIST ---------- */
.thread-card {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 16px;
  padding: 1.5rem 1.8rem;
  margin-bottom: 1rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.thread-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(244,167,185,0.18);
}

.thread-card-pillar {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blush);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.thread-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.thread-card-snippet {
  font-size: 0.9rem;
  color: #6a6a6a;
  margin-bottom: 0.8rem;
}

.thread-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #999;
  padding-top: 0.8rem;
  border-top: 1px solid var(--blush-light);
}

.thread-pinned-tag {
  background: var(--gold);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-right: 0.5rem;
}

/* ---------- THREAD DETAIL PAGE ---------- */
.thread-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.thread-pillar-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blush);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.thread-detail-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.thread-detail-author {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 1.8rem;
}

.thread-detail-body {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 16px;
  padding: 1.8rem;
  font-size: 1rem;
  line-height: 1.75;
  color: #444;
  margin-bottom: 2.5rem;
}

.replies-heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
}

.reply-card {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 0.9rem;
}

.reply-author {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--charcoal);
}

.reply-body {
  font-size: 0.92rem;
  color: #555;
  line-height: 1.6;
}

.reply-date {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.5rem;
}

.no-replies-text {
  color: #999;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ---------- THREAD / REPLY FORMS ---------- */
#new-thread-form label,
#reply-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

#new-thread-form input,
#new-thread-form select,
#new-thread-form textarea,
#reply-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--blush-light);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--cream);
}

#new-thread-form textarea,
#reply-form textarea { resize: vertical; }

/* ---------- USERS MANAGER ---------- */
.users-toolbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.users-toolbar input,
.users-toolbar select {
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--blush-light);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: #fff;
}

.users-toolbar input { flex: 1; min-width: 220px; }

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--blush-light);
  flex-wrap: wrap;
  gap: 0.8rem;
}

.user-row:last-child { border-bottom: none; }

.user-row-name { font-weight: 700; font-size: 0.95rem; }
.user-row-meta { font-size: 0.8rem; color: #888; }

.user-row-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-small {
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-body);
}

.btn-grant { background: var(--sage); color: #fff; }
.btn-admin { background: var(--gold); color: #fff; }
.btn-revoke { background: #eee; color: #777; }
.btn-reset { background: #6B5B95; color: #fff; }

/* ---------- TRANSACTIONS STATS ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-top: 2rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--blush);
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.8rem;
  color: #888;
  font-weight: 600;
}

.txn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--blush-light);
  flex-wrap: wrap;
  gap: 0.6rem;
}

.txn-row:last-child { border-bottom: none; }

.badge-success { background: var(--sage); color: #fff; }
.badge-pending { background: var(--gold); color: #fff; }
.badge-failed { background: #E2415B; color: #fff; }

/* ---------- Q&A MANAGER ---------- */
.qa-card {
  background: #fff;
  border: 1px solid var(--blush-light);
  border-radius: 16px;
  padding: 1.5rem 1.8rem;
  margin-bottom: 1.2rem;
}

.qa-question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.qa-asker-name { font-weight: 700; font-size: 0.95rem; }
.qa-date { font-size: 0.78rem; color: #999; }

.qa-message-text {
  background: var(--cream);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-size: 0.92rem;
  color: #444;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.qa-reply-text {
  background: var(--blush-light);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-size: 0.92rem;
  color: #444;
  line-height: 1.6;
  margin-bottom: 1rem;
  border-left: 3px solid var(--blush);
}

.qa-reply-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blush);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.qa-reply-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--blush-light);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--cream);
  resize: vertical;
  margin-bottom: 0.6rem;
}

/* ---------- Q&A NOTIFICATIONS ---------- */
#qa-notif-badge,
#mother-qa-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blush);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 20px;
  padding: 0 6px;
  margin-left: 0.5rem;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.qa-notification-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: #fff8f9;
  border: 1.5px solid var(--blush);
  border-radius: 14px;
  padding: 1rem 1.3rem;
  margin-bottom: 0.7rem;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
}

.qa-notification-card:hover { background: #fff0f3; }
.qa-notif-dismissing { opacity: 0; transform: translateX(10px); }

.qa-notif-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  background: var(--blush);
  margin-top: 0.3rem;
}

.qa-notif-content { flex: 1; }
.qa-notif-text { font-size: 0.9rem; font-weight: 600; color: var(--charcoal); margin-bottom: 0.25rem; }
.qa-notif-time { font-size: 0.75rem; color: #aaa; }

/* ---------- LANGUAGE TOGGLE ---------- */
.btn-lang {
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1.5px solid var(--blush-light);
  background: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--charcoal);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-lang:hover {
  background: var(--blush-light);
  border-color: var(--blush);
}

/* ---------- M-PESA MODAL ---------- */
.mpesa-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.mpesa-card {
  background: var(--color-surface);
  border-radius: 1.2rem;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mpesa-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.2rem;
}

.mpesa-card label {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.mpesa-card input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: 0.6rem;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
}

/* =========================================================
   3-PANE DASHBOARD LAYOUT
   ========================================================= */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  background: #F7EEF4;
}

.app-shell .site-header {
  grid-column: 1 / -1;
}

.app-sidebar {
  grid-column: 1;
  background: #fff;
  border-right: 1px solid var(--blush-light);
  padding: 2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #bbb;
  margin: 1.2rem 0 0.5rem 0.6rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #555;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--blush-light);
  color: var(--charcoal);
}

.sidebar-link.active {
  background: var(--blush);
  color: #fff;
}

.sidebar-link .sidebar-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.app-main {
  grid-column: 2;
  padding: 2.5rem 2rem;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.app-panel {
  grid-column: 3;
  background: #fff;
  border-left: 1px solid var(--blush-light);
  padding: 2rem 1.4rem;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.panel-section {
  background: var(--cream);
  border: 1px solid var(--blush-light);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
}

.panel-section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
  color: var(--charcoal);
}

/* ---------- ZONE BACKGROUNDS ---------- */
.zone-blush {
  background: linear-gradient(135deg, #FFB8CE 0%, #FFE3EC 100%);
  border-radius: 18px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid #F4789F;
}

.zone-sage {
  background: linear-gradient(135deg, #B5E8A8 0%, #DFF5D8 100%);
  border-radius: 18px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid #7FCB68;
}

.zone-gold {
  background: linear-gradient(135deg, #FFDD85 0%, #FFF1CC 100%);
  border-radius: 18px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid #EFC23E;
}

.zone-white {
  background: #fff;
  border-radius: 18px;
  padding: 2.5rem 3rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--blush-light);
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.zone-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--charcoal);
}

/* ---------- ENHANCED DASH CARDS ---------- */
.dash-card-blush {
  background: linear-gradient(135deg, #FFAFCB, #fff);
  border: 1.5px solid #F4789F;
  border-radius: 16px;
  padding: 1.5rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-card-sage {
  background: linear-gradient(135deg, #9EE08A, #fff);
  border: 1.5px solid #7FCB68;
  border-radius: 16px;
  padding: 1.5rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-card-gold {
  background: linear-gradient(135deg, #FFD659, #fff);
  border: 1.5px solid #EFC23E;
  border-radius: 16px;
  padding: 1.5rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-card-purple {
  background: linear-gradient(135deg, #C9A8F5, #fff);
  border: 1.5px solid #B08CE8;
  border-radius: 16px;
  padding: 1.5rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-card-blush:hover,
.dash-card-sage:hover,
.dash-card-gold:hover,
.dash-card-purple:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.dash-card-blush h3,
.dash-card-sage h3,
.dash-card-gold h3,
.dash-card-purple h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.dash-card-blush p,
.dash-card-sage p,
.dash-card-gold p,
.dash-card-purple p {
  font-size: 0.88rem;
  color: #6a6a6a;
}

/* ---------- WELCOME BANNER ---------- */
.welcome-banner {
  background: linear-gradient(135deg, #F4A7B9 0%, #D4AF70 100%);
  border-radius: 18px;
  padding: 1.8rem 2rem;
  color: #fff;
  margin-bottom: 2rem;
}

.welcome-banner h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
  color: #fff;
}

.welcome-banner p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* =========================================================
   MOBILE BOTTOM NAV BAR
   (hidden on desktop/tablet, shown on phone via media query)
   ========================================================= */
.mobile-nav-bar {
  display: none;
}

/* =========================================================
   RESPONSIVE — LARGE  > 1100px  (right panel collapses)
   ========================================================= */
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 200px 1fr;
  }
  .app-panel {
    display: none;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================
   RESPONSIVE — MEDIUM  560px–900px  (tablet)
   ========================================================= */
@media (max-width: 900px) {

  /* Nav */
  .nav-wrap { padding: 1rem 1.2rem; }
  .logo { font-size: 1.4rem; }
  nav { gap: 0.7rem; }

  /* Hero */
  .hero { padding: 3rem 1.5rem 1.5rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1rem; }

  /* Pillars */
  .pillars-grid { grid-template-columns: repeat(2, 1fr); }
  .pillars-section { padding: 2.5rem 1.5rem 4rem; }

  /* Courses */
  .courses-grid { grid-template-columns: repeat(2, 1fr); }
  .course-layout { grid-template-columns: 1fr; }
  .lessons-sidebar { position: static; top: auto; height: auto; }

  /* Dashboard */
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-section { padding: 2rem 1.5rem 4rem; }

  /* Profile */
  .profile-layout { grid-template-columns: 1fr; }

  /* Admin */
  .admin-layout { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }

  /* 3-pane shell */
  .app-shell { grid-template-columns: 200px 1fr; }
  .app-panel { display: none; }
  .app-main { padding: 1.8rem 1.5rem; max-width: 100%; }
  .app-sidebar { padding: 1.5rem 0.8rem; }
  .sidebar-link { font-size: 0.82rem; padding: 0.55rem 0.7rem; gap: 0.5rem; }

  /* Article */
  .article-title { font-size: 2rem; }
  .bg-blob { display: none; }

  /* Community */
  .thread-page { padding: 2rem 1.5rem 4rem; }
  .thread-detail-title { font-size: 1.6rem; }

  /* Library */
  .library-hero { padding: 2.5rem 1.5rem 1.5rem; }
  .library-hero h1 { font-size: 2rem; }
  .library-section { padding: 1rem 1.5rem 4rem; }

  /* Zone cards */
  .zone-white { padding: 1.8rem 1.5rem; }

  /* Welcome */
  .welcome-banner { padding: 1.4rem 1.5rem; }
  .welcome-banner h1 { font-size: 1.5rem; }
}

/* =========================================================
   RESPONSIVE — SMALL  < 560px  (phone)
   ========================================================= */
@media (max-width: 560px) {

  /* Global */
  body { font-size: 0.95rem; }

  /* Header */
  .nav-wrap { padding: 0.9rem 1rem; flex-wrap: wrap; gap: 0.6rem; }
  .logo { font-size: 1.25rem; }
  nav { gap: 0.5rem; }
  nav a:not(.btn) { display: none; }
  .btn { padding: 0.5rem 1rem; font-size: 0.88rem; }
  .btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }

  /* Hero */
  .hero { padding: 2.5rem 1rem 1.2rem; }
  .hero h1 { font-size: 1.7rem; margin-bottom: 1rem; }
  .hero p { font-size: 0.95rem; margin-bottom: 1.5rem; }
  .hero-actions { flex-direction: column; align-items: center; gap: 0.7rem; }

  /* Pillars */
  .pillars-section { padding: 2rem 1rem 3.5rem; }
  .pillars-section h2 { font-size: 1.7rem; }
  .pillars-grid { grid-template-columns: 1fr; gap: 1rem; }
  .pillar-card { padding: 1.3rem; }

  /* Courses / Library */
  .courses-grid { grid-template-columns: 1fr; }
  .course-card-thumb { height: 140px; }
  .library-section { padding: 0.8rem 1rem 3rem; }
  .library-hero { padding: 2rem 1rem 1rem; }
  .library-hero h1 { font-size: 1.65rem; }
  .library-filters { gap: 0.4rem; margin-bottom: 1.8rem; }
  .filter-chip { font-size: 0.78rem; padding: 0.4rem 0.9rem; }

  /* Course hero */
  .course-hero { padding: 2rem 1rem; }
  .course-hero h1 { font-size: 1.6rem; }
  .course-hero-meta { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

  /* Lesson viewer */
  .lesson-viewer { padding: 1.5rem 1rem; }
  .lesson-viewer-title { font-size: 1.3rem; }
  .lesson-content h2 { font-size: 1.4rem; }
  .lesson-content h3 { font-size: 1.15rem; }
  .lesson-content p, .lesson-content li { font-size: 1rem; }

  /* 3-pane shell */
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .app-panel { display: none; }
  .app-main { grid-column: 1; padding: 1.2rem 1rem 5rem; max-width: 100%; }

  /* Mobile bottom nav bar */
  .mobile-nav-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--blush-light);
    z-index: 200;
    padding: 0.5rem 0 0.6rem;
    justify-content: space-around;
  }
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #888;
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    border-radius: 10px;
    transition: color 0.15s ease;
  }
  .mobile-nav-item .mobile-nav-icon { font-size: 1.25rem; }
  .mobile-nav-item.active { color: var(--blush); }

  /* Welcome banner */
  .welcome-banner { padding: 1.2rem 1rem; border-radius: 14px; margin-bottom: 1.2rem; }
  .welcome-banner h1 { font-size: 1.3rem; }
  .welcome-banner p { font-size: 0.85rem; }

  /* Dashboard cards */
  .dashboard-section { padding: 1.5rem 1rem 4rem; }
  .dashboard-section h1 { font-size: 1.7rem; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 1rem; }
  .dash-card,
  .dash-card-blush,
  .dash-card-sage,
  .dash-card-gold,
  .dash-card-purple { padding: 1.2rem; }

  /* Zone cards */
  .zone-white { padding: 1.4rem 1rem; border-radius: 14px; }
  .zone-blush, .zone-sage, .zone-gold { padding: 1.4rem 1rem; border-radius: 14px; }

  /* Profile / Admin */
  .profile-layout { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-form-card, .admin-list-card { padding: 1.3rem 1rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .stat-card { padding: 1.1rem 0.8rem; }
  .stat-value { font-size: 1.4rem; }
  .user-row { flex-direction: column; align-items: flex-start; gap: 0.7rem; padding: 1.1rem 0; }
  .user-row-actions { flex-wrap: wrap; }
  .txn-row { flex-direction: column; align-items: flex-start; gap: 0.4rem; }

  /* Article */
  .article-page { padding: 2rem 1rem 2rem; }
  .article-title { font-size: 1.65rem; }
  .article-meta { font-size: 0.88rem; }
  .article-locked-message { padding: 2.5rem 1rem; }

  /* Community */
  .thread-page { padding: 1.5rem 1rem 4rem; }
  .thread-detail-title { font-size: 1.4rem; }
  .thread-card { padding: 1.2rem; }
  .thread-card-title { font-size: 1rem; }
  .thread-detail-body { padding: 1.3rem 1rem; }
  .reply-card { padding: 1rem; }

  /* Auth */
  .auth-card { padding: 2rem 1.3rem; border-radius: 16px; }
  .auth-card h1 { font-size: 1.5rem; }
  .auth-section { padding: 2rem 1rem; align-items: flex-start; }

  /* Modals */
  .modal-box { padding: 1.5rem 1.2rem; border-radius: 14px; max-height: 85vh; }
  .modal-overlay { padding: 1rem; }

  /* Toast — lifts above mobile nav bar */
  .toast-confirm { bottom: 5rem; font-size: 0.85rem; padding: 0.75rem 1.2rem; }

  /* Community toolbar */
  .community-toolbar { justify-content: stretch; }
  .community-toolbar .btn { width: 100%; text-align: center; }

  /* Users toolbar */
  .users-toolbar { flex-direction: column; }
  .users-toolbar input, .users-toolbar select { width: 100%; min-width: 0; }

  /* Markdown toolbar */
  .md-toolbar { gap: 0.3rem; }
  .md-btn { font-size: 0.72rem; padding: 0.28rem 0.5rem; }

  /* Q&A */
  .qa-card { padding: 1.2rem 1rem; }
  .qa-question-header { flex-direction: column; gap: 0.3rem; }

  /* Footer */
  .site-footer { padding: 1.5rem 1rem; font-size: 0.85rem; }
}

/* =========================================================
   RESPONSIVE — EXTRA SMALL  < 380px
   ========================================================= */
@media (max-width: 380px) {
  .hero h1 { font-size: 1.45rem; }
  .logo { font-size: 1.1rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.2rem; }
  .course-hero h1 { font-size: 1.35rem; }
  .welcome-banner h1 { font-size: 1.15rem; }
}
/* Fix intl-tel-input country dropdown */
.intl-tel-input {
  width: 100% !important;
}

.intl-tel-input .country-list {
  width: 100% !important;           /* Make dropdown same width as input */
  max-width: 320px;                 /* Reasonable max width */
  min-width: 240px;                 /* Don't make it too narrow */
  left: 0 !important;
  right: auto !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 8px;
  margin-top: 4px;
}

/* Optional: Make the dropdown scrollable and nicer */
.intl-tel-input .country-list .country {
  padding: 8px 12px;
  font-size: 0.95rem;
}

.intl-tel-input .country-list .country:hover {
  background-color: #f5f5f5;
}
/* === INTL TEL INPUT DROPDOWN FIXES === */
.intl-tel-input {
  width: 100% !important;
  position: relative;
}

.intl-tel-input .country-list {
  width: 100% !important;           /* Match input width */
  max-width: 320px !important;      /* Reasonable max size */
  left: 0 !important;
  right: auto !important;
  top: 100% !important;             /* Position right below input */
  margin-top: 4px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow-y: auto;
  max-height: 280px;                /* Scrollable but not too tall */
  z-index: 1000;
  background: white;
}

/* Better list item styling */
.intl-tel-input .country-list .country {
  padding: 10px 14px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.intl-tel-input .country-list .country:hover,
.intl-tel-input .country-list .country.highlight {
  background-color: #f8fafc;
}

/* Highlight selected country */
.intl-tel-input .country-list .country.active {
  background-color: #f0f9ff;
  font-weight: 500;
}

/* Make sure dropdown stays inside the auth card on small screens */
.auth-card,
.auth-section .auth-card {
  overflow: visible;
  position: relative;
}

/* Responsive adjustment for mobile */
@media (max-width: 480px) {
  .intl-tel-input .country-list {
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }
}