/* ==========================================================================
   Auth Pages — Shared Styles (Login, Signup, Password Reset)
   Sobolo v2 "Warm & Cultural" — Fraunces + Plus Jakarta Sans
   ========================================================================== */

/* Outer wrapper — dark gradient with Adinkra texture */
.auth-page {
  background: linear-gradient(135deg, var(--crimson-dark) 0%, var(--charcoal) 50%, var(--purple) 100%);
  min-height: 100vh;
  position: relative;
}

.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cpath d='M36 5 L67 36 L36 67 L5 36 Z' fill='none' stroke='rgba(212%2C168%2C67%2C0.09)' stroke-width='1'/%3E%3Cpath d='M36 20 L52 36 L36 52 L20 36 Z' fill='none' stroke='rgba(255%2C255%2C255%2C0.04)' stroke-width='0.75'/%3E%3C/svg%3E");
  background-size: 72px 72px;
  pointer-events: none;
  z-index: 0;
}

.auth-page::after {
  content: '';
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg,
    #8B1A4A 0, #8B1A4A 18px,
    #D4A843 18px, #D4A843 36px,
    #1A7A6D 36px, #1A7A6D 50px,
    #5B2C6F 50px, #5B2C6F 64px
  );
  z-index: 1;
}

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem;
  position: relative;
  z-index: 2;
}

/* Auth card — white, warm, Kente strip at top */
.auth-card {
  background: var(--white);
  border-radius: var(--r-2xl);
  box-shadow: 0 32px 64px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.08);
  padding: 3rem 2.75rem 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  display: block;
  height: 5px;
  background: repeating-linear-gradient(90deg,
    #8B1A4A 0, #8B1A4A 18px,
    #D4A843 18px, #D4A843 36px,
    #1A7A6D 36px, #1A7A6D 50px,
    #5B2C6F 50px, #5B2C6F 64px
  );
  position: absolute;
  top: 0; left: 0; right: 0;
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo {
  margin-bottom: 1.75rem;
  display: flex;
  justify-content: center;
}

.auth-logo img {
  filter: drop-shadow(0 4px 12px rgba(139, 26, 74, 0.2));
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--crimson);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.auth-subtitle {
  color: var(--tx-muted);
  font-size: 1rem;
  margin: 0;
  font-weight: 400;
  line-height: 1.5;
}

/* Social auth buttons — warm borders, gold hover */
.social-auth {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2.25rem;
}

.social-auth form,
.social-auth .oauth-form {
  width: 100%;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  border: 2px solid var(--border-warm);
  border-radius: var(--r-lg);
  background: var(--white);
  color: var(--tx-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-social:hover {
  border-color: var(--gold);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}

.btn-social.google:hover {
  border-color: #4285F4;
}

.btn-social.facebook:hover {
  border-color: #1877F2;
}

.btn-social.apple:hover {
  border-color: var(--tx-primary);
}

.btn-social span {
  font-weight: 600;
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--tx-muted);
  font-size: 0.82rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-warm);
}

/* OAuth not configured fallback */
.oauth-fallback {
  padding: 2rem;
  text-align: center;
  background: rgba(139, 26, 74, 0.08);
  border-radius: var(--r-lg);
  border: 1px solid rgba(139, 26, 74, 0.2);
}

.oauth-fallback-title {
  color: var(--crimson);
  margin: 0;
  font-weight: 600;
}

.oauth-fallback-text {
  color: var(--tx-muted);
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

/* Password reset form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tx-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.auth-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-warm);
  border-radius: var(--r-md);
  background: var(--white);
  color: var(--tx-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.15);
}

.auth-field input::placeholder {
  color: var(--tx-muted);
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: var(--r-lg);
  background: var(--crimson);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.auth-submit:hover {
  background: var(--crimson-dark);
  box-shadow: var(--sh-md);
  transform: translateY(-1px);
}

/* Footer area */
.auth-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-warm);
}

.privacy-note {
  margin: 0;
  color: var(--tx-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.signin-link {
  margin: 0.6rem 0 0;
  color: var(--tx-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.auth-link {
  color: var(--crimson);
  text-decoration: none;
  font-weight: 700;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Devise error messages */
.auth-errors {
  background: rgba(139, 26, 74, 0.08);
  border: 1px solid rgba(139, 26, 74, 0.2);
  border-radius: var(--r-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.auth-errors h2 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--crimson);
  margin-bottom: 0.5rem;
}

.auth-errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-errors li {
  font-size: 0.85rem;
  color: var(--crimson);
  padding: 0.25rem 0;
}

/* Staggered animation for auth elements */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-card {
    animation: fadeSlideUp 0.5s var(--ease-spring) both;
  }

  .auth-logo {
    animation: fadeSlideUp 0.5s var(--ease-spring) both;
    animation-delay: 0.05s;
  }

  .auth-title {
    animation: fadeSlideUp 0.5s var(--ease-spring) both;
    animation-delay: 0.1s;
  }

  .auth-subtitle {
    animation: fadeSlideUp 0.5s var(--ease-spring) both;
    animation-delay: 0.15s;
  }

  .social-auth form:nth-child(1),
  .social-auth .oauth-form:nth-child(1),
  .social-auth > :nth-child(1) {
    animation: fadeSlideUp 0.5s var(--ease-spring) both;
    animation-delay: 0.2s;
  }

  .social-auth form:nth-child(2),
  .social-auth .oauth-form:nth-child(2),
  .social-auth > :nth-child(2) {
    animation: fadeSlideUp 0.5s var(--ease-spring) both;
    animation-delay: 0.28s;
  }

  .social-auth form:nth-child(3),
  .social-auth .oauth-form:nth-child(3),
  .social-auth > :nth-child(3) {
    animation: fadeSlideUp 0.5s var(--ease-spring) both;
    animation-delay: 0.36s;
  }

  .auth-footer {
    animation: fadeSlideUp 0.5s var(--ease-spring) both;
    animation-delay: 0.4s;
  }
}

/* Mobile responsive */
@media (max-width: 480px) {
  .auth-container {
    padding: 1rem;
  }

  .auth-card {
    padding: 2.25rem 1.5rem 2rem;
  }

  .auth-title {
    font-size: 1.6rem;
  }

  .auth-subtitle {
    font-size: 0.95rem;
  }
}

/* Focus visible for auth elements */
.btn-social:focus-visible,
.auth-submit:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(139, 26, 74, 0.15);
}

/* Theme toggle on auth pages — fixed top-right */
.auth-theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
}

/* ==========================================================================
   Dark Mode — Auth Pages
   ========================================================================== */

html[data-theme="dark"] .auth-page {
  background: #0A060D;
}

html[data-theme="dark"] .auth-page::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M32 4 L60 32 L32 60 L4 32 Z' fill='none' stroke='rgba(212%2C168%2C67%2C0.18)' stroke-width='1'/%3E%3Cpath d='M32 18 L46 32 L32 46 L18 32 Z' fill='none' stroke='rgba(139%2C26%2C74%2C0.14)' stroke-width='0.75'/%3E%3Ccircle cx='32' cy='32' r='2.5' fill='none' stroke='rgba(212%2C168%2C67%2C0.2)' stroke-width='0.75'/%3E%3C/svg%3E");
}

html[data-theme="dark"] .auth-card {
  background: #1A1020;
  border: 1px solid rgba(212,168,67,0.18);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,168,67,0.08);
}

html[data-theme="dark"] .auth-title { color: var(--tx-primary); }
html[data-theme="dark"] .auth-subtitle { color: var(--tx-secondary); }

html[data-theme="dark"] .auth-footer,
html[data-theme="dark"] .privacy-note,
html[data-theme="dark"] .signin-link { color: var(--tx-muted); }

html[data-theme="dark"] .auth-footer { border-top-color: rgba(212,168,67,0.14); }

html[data-theme="dark"] .auth-link { color: var(--gold-light); }

html[data-theme="dark"] .btn-social {
  background: var(--surface-warm);
  border-color: rgba(255,255,255,0.1);
  color: var(--tx-primary);
}

html[data-theme="dark"] .btn-social:hover {
  border-color: var(--gold);
  background: rgba(212,168,67,0.08);
}

html[data-theme="dark"] .auth-errors {
  background: rgba(139, 26, 74, 0.2);
  border-color: rgba(139, 26, 74, 0.35);
}

html[data-theme="dark"] .auth-errors h2 { color: #F5A0BE; }
html[data-theme="dark"] .auth-errors li { color: #F5A0BE; }
/* ==========================================================================
   Community / Contribute Page Styles
   ========================================================================== */

.contribute-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Hero */
.contribute-hero {
  background: linear-gradient(135deg, var(--rich-purple) 0%, var(--teal-green) 100%);
  border-radius: var(--radius-xl);
  padding: 4rem 2rem;
  text-align: center;
  color: white;
  margin-bottom: 4rem;
}

.contribute-hero .hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.contribute-hero .hero-symbol {
  animation: pulse 2s infinite ease-in-out;
}

.contribute-hero .hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contribute-hero .hero-actions {
  margin-bottom: 3rem;
}

/* Community Stats */
.community-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.community-stats .stat-item {
  text-align: center;
}

.community-stats .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
}

.community-stats .stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
  color: white;
}

/* Contribution Categories */
.contribution-categories {
  margin-bottom: 4rem;
}

.contribute-container .category-card {
  display: block;
}

.contribute-container .category-icon {
  margin-bottom: 1rem;
}

.category-action {
  text-align: center;
}

/* Featured Contributions */
.featured-contributions {
  margin-bottom: 4rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.featured-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--warm-gold);
  position: relative;
}

.featured-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.contribution-category {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.featured-badge {
  background: var(--warm-gold);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.contribution-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover {
  color: var(--warm-gold);
  text-decoration: underline;
}

.contribution-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.translation-preview {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.featured-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.contributor {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.contributor-icon {
  font-size: 1rem;
}

.contribution-votes {
  font-size: 0.9rem;
  color: var(--teal-green);
}

.helpful-votes {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Recent Contributions */
.recent-contributions {
  margin-bottom: 4rem;
}

.contributions-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contribution-item {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.contribution-item:hover {
  transform: translateY(-2px);
}

.contribution-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.contribute-container .category-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  background: var(--background);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  color: var(--text-secondary);
}

.contribution-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contribution-item .contribution-title {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.contribution-summary {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.contribution-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.contributor-info {
  color: var(--text-secondary);
}

.contribution-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.votes-summary {
  color: var(--teal-green);
}

.language-tag {
  background: var(--warm-gold);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

/* How It Works */
.how-it-works {
  margin-bottom: 4rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.step-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  position: relative;
}

.step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--deep-crimson), var(--rich-purple));
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

.step-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* CTA */
.contribute-container .cta-section {
  background: linear-gradient(135deg, var(--deep-crimson) 0%, var(--warm-gold) 100%);
  border-radius: var(--radius-xl);
}

/* --- Contribute Form Pages (new + edit) --- */
.contribute-new-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.contribute-header {
  margin-bottom: 2rem;
}

.form-card {
  background: var(--color-surface);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.form-errors {
  background: var(--error-light);
  border: 1px solid var(--error-border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: var(--error);
}

.form-errors h4 { margin: 0 0 0.5rem; font-size: 0.9rem; }
.form-errors ul { margin: 0; padding-left: 1.25rem; }
.form-errors li { font-size: 0.85rem; }

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--dark-charcoal);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--deep-crimson);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.type-option { cursor: pointer; }
.type-radio { display: none; }

.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  transition: all 0.2s;
  gap: 0.25rem;
}

.type-radio:checked + .type-card {
  border-color: var(--deep-crimson);
  background: rgba(139, 26, 74, 0.05);
}

.type-card:hover {
  border-color: var(--warm-gold);
}

.type-icon { font-size: 1.5rem; }
.type-name { font-weight: 600; font-size: 0.9rem; color: var(--dark-charcoal); }
.type-desc { font-size: 0.75rem; color: var(--text-secondary); }

.form-actions {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* --- Contribute Show Page --- */
.contribute-show-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.show-header { margin-bottom: 1.5rem; }

.contribution-card {
  background: var(--color-surface);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.contribute-show-container .contribution-meta {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.contribution-type, .contribution-status, .contribution-lang {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.contribution-type {
  background: var(--soft-cream);
  color: var(--deep-crimson);
}

.contribution-lang {
  background: var(--info-light);
  color: var(--info);
}

.status-pending { background: var(--warning-light); color: var(--warning); }
.status-approved { background: var(--success-light); color: var(--success); }
.status-rejected { background: var(--error-light); color: var(--error); }

.text-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.text-block {
  padding: 1.25rem;
  border-radius: 0.75rem;
}

.text-block.source {
  background: #f8fafc;
  border: 1px solid var(--border);
}

.text-block.translation {
  background: var(--soft-cream);
  border: 1px solid var(--warm-gold);
}

.text-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.5rem;
}

.text-content {
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 0;
  color: var(--dark-charcoal);
}

.translation .text-content {
  font-family: var(--font-heading);
  color: var(--deep-crimson);
}

.context-section {
  background: #f8fafc;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.context-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dark-charcoal);
  margin: 0 0 0.5rem;
}

.context-section p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-secondary);
}

.contribute-show-container .contribution-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1rem;
}

.contribute-show-container .contributor-name { font-weight: 600; color: var(--dark-charcoal); }
.contribution-date { color: var(--text-secondary); font-size: 0.85rem; margin-left: 0.5rem; }

.quality-badge {
  background: var(--teal-green);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.owner-actions { display: flex; gap: 0.5rem; }
.btn-danger { background: var(--error); color: white; border: none; border-radius: 0.5rem; cursor: pointer; }
.btn-danger:hover { background: var(--error-border); }

/* Section header with multiple links */
.section-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* ==========================================================================
   Community Challenges
   ========================================================================== */

.challenges-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.challenges-hero {
  background: linear-gradient(135deg, var(--warm-gold) 0%, var(--deep-crimson) 100%);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  color: white;
  margin-bottom: 3rem;
}

.challenges-hero .hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.challenges-hero .hero-subtitle {
  font-size: 1.15rem;
  opacity: 0.92;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.challenges-section {
  margin-bottom: 3rem;
}

.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* Challenge Card */
.challenge-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

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

.challenge-card--upcoming {
  opacity: 0.75;
  border-style: dashed;
}

.challenge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.challenge-type-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.challenge-type-badge--weekly {
  background: var(--teal-pale);
  color: var(--teal);
}

.challenge-type-badge--monthly {
  background: var(--purple-pale);
  color: var(--purple);
}

.challenge-type-badge--language_specific {
  background: var(--gold-pale);
  color: var(--gold-deep);
}

.challenge-type-badge--community_wide {
  background: var(--crimson-pale);
  color: var(--crimson);
}

.challenge-multiplier {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--warm-gold);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.challenge-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.challenge-card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1rem;
  flex: 1;
}

.challenge-card-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.challenge-stat {
  display: flex;
  flex-direction: column;
}

.challenge-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.challenge-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Challenge Progress */
.challenge-progress {
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.challenge-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.challenge-progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.challenge-progress-tokens {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--warm-gold);
}

.challenge-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.challenge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-light) 100%);
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-spring);
}

.challenge-progress-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Join/Leave Buttons */
.challenge-join-btn {
  width: 100%;
  text-align: center;
  display: block;
}

.challenge-leave-btn {
  width: 100%;
  text-align: center;
  display: block;
  color: var(--text-muted);
  border-color: var(--border);
}

.challenge-leave-btn:hover {
  color: var(--error);
  border-color: var(--error);
}

/* Challenge card meta */
.challenge-card-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.challenge-starts {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .form-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .form-label {
  color: var(--tx-primary);
}

html[data-theme="dark"] .form-input {
  background: var(--surface);
  color: var(--tx-primary);
  border-color: var(--border);
}

html[data-theme="dark"] .form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

html[data-theme="dark"] .type-card {
  border-color: var(--border);
  color: var(--tx-primary);
}

html[data-theme="dark"] .type-card:hover {
  border-color: var(--gold);
}

html[data-theme="dark"] .type-radio:checked + .type-card {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.1);
}

html[data-theme="dark"] .type-name {
  color: var(--tx-primary);
}

html[data-theme="dark"] .text-block.source {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .text-block.translation {
  background: var(--surface-warm);
  border-color: var(--border-gold);
}

html[data-theme="dark"] .text-content {
  color: var(--tx-primary);
}

html[data-theme="dark"] .context-section {
  background: var(--surface);
}

html[data-theme="dark"] .context-section h3 {
  color: var(--tx-primary);
}

html[data-theme="dark"] .contribute-show-container .contributor-name {
  color: var(--tx-primary);
}

html[data-theme="dark"] .contribution-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .contribution-type {
  background: rgba(139, 26, 74, 0.2);
  color: var(--crimson-mid);
}

html[data-theme="dark"] .contribution-item {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .featured-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

html[data-theme="dark"] .step-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .challenge-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

html[data-theme="dark"] .challenge-card:hover {
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .challenge-progress {
  background: var(--surface);
}

html[data-theme="dark"] .team-create-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
  .contribute-hero .hero-title {
    font-size: 2rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .community-stats {
    gap: 2rem;
  }

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

  .contribution-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .contribution-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

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

  .type-grid { grid-template-columns: 1fr 1fr; }
  .form-actions { flex-direction: column; }
  .text-pair { grid-template-columns: 1fr; }
  .contribute-show-container .contribution-footer { flex-direction: column; align-items: flex-start; }

  .challenges-hero .hero-title {
    font-size: 2rem;
  }

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

  .section-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
/* ==========================================================================
   Daily Challenge Page Styles
   ========================================================================== */

.daily-index-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
.daily-header {
  text-align: center;
  margin-bottom: 3rem;
}

.header-content {
  margin-bottom: 2rem;
}

.daily-header .page-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.page-icon {
  font-size: 3rem;
  animation: sparkle 2s infinite ease-in-out;
}

.daily-header .page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Streak Display */
.streak-display {
  background: linear-gradient(135deg, var(--warm-gold) 0%, var(--deep-crimson) 100%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: white;
  display: inline-block;
}

.streak-content {
  text-align: center;
}

.streak-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.streak-label {
  font-size: 1.1rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.streak-fire {
  font-size: 1.5rem;
}

/* Today's Challenge */
.todays-challenge {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  margin-bottom: 3rem;
  overflow: hidden;
}

.challenge-header {
  background: linear-gradient(135deg, var(--deep-crimson) 0%, var(--rich-purple) 100%);
  padding: 2rem;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.challenge-date {
  font-size: 1.1rem;
  opacity: 0.9;
  display: block;
  margin-bottom: 0.5rem;
}

.challenge-language {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.challenge-header .language-flag {
  font-size: 1.5rem;
  width: auto;
  height: auto;
  background: none;
}

.challenge-category {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.challenge-header .category-badge {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
}

.difficulty-badge {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--warm-gold);
  color: var(--text-primary);
}

/* Challenge Content */
.challenge-content {
  padding: 2.5rem;
}

.phrase-section {
  margin-bottom: 3rem;
}

.phrase-display {
  text-align: center;
  margin-bottom: 2rem;
}

.source-phrase,
.translated-phrase {
  margin-bottom: 1.5rem;
}

.phrase-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.5rem;
}

.daily-index-container .phrase-text {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.daily-index-container .phrase-text.translated {
  color: var(--deep-crimson);
  font-size: 2rem;
}

.daily-index-container .translation-arrow {
  font-size: 2rem;
  color: var(--warm-gold);
  margin: 1rem 0;
}

.daily-index-container .pronunciation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.pronunciation-icon {
  font-size: 1.2rem;
}

.pronunciation-text {
  font-family: monospace;
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Audio */
.audio-section {
  text-align: center;
}

.audio-play-btn {
  background: linear-gradient(135deg, var(--teal-green) 0%, var(--warm-gold) 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.audio-play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.play-icon {
  font-size: 1.3rem;
}

/* Cultural Context */
.daily-index-container .cultural-context {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  border-left: none;
}

.context-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.context-icon {
  font-size: 1.8rem;
}

.context-content {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.context-significance,
.usage-tips,
.related-phrases {
  margin-bottom: 2rem;
}

.significance-title,
.tips-title,
.related-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.significance-text {
  color: var(--text-secondary);
  line-height: 1.6;
}

.tips-list {
  list-style: none;
  padding: 0;
}

.tip-item {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
}

.tip-item:before {
  content: "\1F4A1"; /* lightbulb emoji */
  position: absolute;
  left: 0;
  top: 0;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.related-phrase {
  background: var(--color-surface);
  padding: 1rem;
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  align-items: center;
}

.related-akan {
  font-weight: 600;
  color: var(--deep-crimson);
}

.related-english {
  color: var(--text-secondary);
}

.related-pronunciation {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Proverb Section */
.proverb-section {
  background: linear-gradient(135deg, var(--rich-purple) 0%, var(--deep-crimson) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.proverb-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.proverb-akan {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-style: italic;
  margin-bottom: 1rem;
}

.proverb-translation {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.meaning-title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.meaning-text,
.meaning-context {
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* Challenge Actions */
.challenge-actions {
  text-align: center;
}

.complete-btn {
  font-size: 1.2rem;
  padding: 1rem 2.5rem;
  margin-bottom: 2rem;
}

.auth-prompt {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.auth-message {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.auth-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Sharing */
.sharing-section {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.sharing-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.sharing-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  background: var(--color-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.share-btn:hover {
  border-color: var(--warm-gold);
  background: var(--warm-gold);
  color: white;
}

/* User Stats */
.user-stats {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 3rem;
}

.stats-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 2rem;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-md);
}

.favorite-category {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, var(--teal-green) 0%, var(--warm-gold) 100%);
  border-radius: var(--radius-md);
  color: white;
}

.favorite-label {
  opacity: 0.9;
}

.favorite-badge {
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Recent Challenges Timeline */
.recent-challenges {
  margin-bottom: 2rem;
}

.challenges-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-item {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.timeline-item:hover {
  transform: translateX(4px);
}

.timeline-item.completed {
  border-left: 4px solid var(--teal-green);
}

.timeline-date {
  text-align: center;
  min-width: 60px;
}

.date-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-weight: 600;
}

.timeline-item.completed .date-circle {
  background: var(--teal-green);
  color: white;
}

.timeline-item:not(.completed) .date-circle {
  background: var(--border);
  color: var(--text-secondary);
}

.completion-icon {
  font-size: 1.2rem;
}

.day-number {
  font-size: 1rem;
}

.date-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.timeline-content {
  flex: 1;
}

.challenge-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.challenge-phrase {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
}

.source-preview {
  color: var(--text-primary);
}

.arrow-preview {
  color: var(--text-secondary);
}

.translation-preview {
  color: var(--deep-crimson);
  font-weight: 500;
}

.challenge-meta-preview {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
}

.category-preview,
.language-preview {
  color: var(--text-secondary);
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .todays-challenge {
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

html[data-theme="dark"] .difficulty-badge {
  background: var(--gold);
  color: var(--ink);
}

html[data-theme="dark"] .audio-play-btn:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .share-btn {
  background: var(--color-surface);
  border-color: var(--border);
  color: var(--tx-primary);
}

html[data-theme="dark"] .share-btn:hover {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

html[data-theme="dark"] .user-stats {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .timeline-item {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .related-phrase {
  background: var(--color-surface);
}

html[data-theme="dark"] .related-akan {
  color: var(--gold-light);
}

html[data-theme="dark"] .auth-prompt {
  background: var(--surface);
}

/* Responsive */
@media (max-width: 768px) {
  .challenge-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .daily-header .page-title {
    font-size: 2rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .daily-index-container .phrase-text {
    font-size: 1.4rem;
  }

  .daily-index-container .phrase-text.translated {
    font-size: 1.6rem;
  }

  .related-phrase {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .challenge-phrase {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .timeline-item {
    gap: 1rem;
  }
}
/* ==========================================================================
   Dashboard Page Styles
   ========================================================================== */

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Greeting Section */
.dashboard-greeting {
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 50%, var(--purple) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  color: var(--tx-on-dark);
}

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

.greeting-twi {
  font-family: var(--ff-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--tx-on-dark);
}

.greeting-english {
  font-size: 1rem;
  margin: 0;
  opacity: 0.87;
  color: var(--tx-on-dark);
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-badge.tier-free {
  background: rgba(255, 255, 255, 0.2);
  color: var(--tx-on-dark);
}

.tier-badge.tier-plus {
  background: var(--gold);
  color: var(--ink);
}

.tier-badge.tier-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--ink);
}

/* Stats Grid */
.dashboard-stats {
  margin-bottom: 2rem;
}

.dashboard-stats .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.dashboard-stats .stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-stats .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.dashboard-stats .stat-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.dashboard-stats .stat-value {
  font-family: var(--ff-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.dashboard-stats .stat-label {
  font-size: 0.8rem;
  color: var(--tx-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-card.stat-streak .stat-value { color: var(--terracotta); }
.stat-card.stat-xp .stat-value { color: var(--gold-deep); }
.stat-card.stat-lessons .stat-value { color: var(--crimson); }
.stat-card.stat-translations .stat-value { color: var(--teal); }

/* Dashboard Grid (Main + Sidebar) */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

.dashboard-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.dashboard-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.dashboard-section .section-title {
  font-family: var(--ff-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--tx-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-link {
  font-size: 0.85rem;
  color: var(--crimson);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.view-link:hover {
  color: var(--crimson-dark);
  text-decoration: underline;
}

/* Quick Actions */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.quick-action-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--tx-primary);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  background: var(--surface-warm);
}

.quick-action-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--crimson);
}

.quick-action-card .action-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.quick-action-card .action-content {
  flex: 1;
  min-width: 0;
}

.quick-action-card .action-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.quick-action-card .action-desc {
  font-size: 0.78rem;
  color: var(--tx-muted);
  margin: 0.15rem 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-action-card .action-arrow {
  font-size: 1.1rem;
  color: var(--tx-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.quick-action-card:hover .action-arrow {
  transform: translateX(3px);
  color: var(--crimson);
}

/* Action card accent borders */
.action-translate { border-left: 3px solid var(--teal); }
.action-learn { border-left: 3px solid var(--crimson); }
.action-phrasebook { border-left: 3px solid var(--gold); }
.action-daily { border-left: 3px solid var(--purple); }
.action-community { border-left: 3px solid var(--terracotta); }
.action-wallet { border-left: 3px solid var(--forest); }

/* Recent Translations */
.translations-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.translation-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-warm);
  transition: background 0.15s;
}

.translation-item:hover {
  background: var(--ivory);
}

.translation-languages {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.lang-badge {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.source-badge {
  background: var(--teal-pale);
  color: var(--teal);
}

.target-badge {
  background: var(--crimson-pale);
  color: var(--crimson);
}

.translation-arrow-small {
  color: var(--tx-muted);
  font-size: 0.75rem;
}

.translation-texts {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.translation-source {
  font-size: 0.9rem;
  color: var(--tx-primary);
}

.translation-target {
  font-size: 0.9rem;
  color: var(--crimson);
  font-weight: 500;
}

.translation-time {
  font-size: 0.72rem;
  color: var(--tx-muted);
}

/* Daily Challenge Card */
.daily-challenge-card {
  border-top: 3px solid var(--gold);
}

.challenge-preview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.challenge-date-badge {
  font-size: 0.78rem;
  color: var(--tx-muted);
}

.challenge-language-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--crimson);
}

.challenge-phrase-preview {
  background: var(--ivory);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.phrase-label-small {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tx-muted);
  font-weight: 600;
}

.phrase-text-preview {
  font-size: 1rem;
  margin: 0.25rem 0 0;
  color: var(--tx-primary);
  font-weight: 500;
}

.phrase-text-preview.translated {
  color: var(--crimson);
  font-family: var(--ff-display);
}

.phrase-divider {
  text-align: center;
  color: var(--tx-muted);
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.challenge-context-preview {
  font-size: 0.85rem;
  color: var(--tx-secondary);
  line-height: 1.5;
  padding: 0.5rem;
  background: var(--ivory);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
}

.challenge-context-preview p {
  margin: 0;
}

.challenge-completed-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--teal-pale);
  color: var(--teal);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Learning Progress */
.learning-progress-card {
  background: var(--ivory);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.progress-header {
  margin-bottom: 0.75rem;
}

.progress-lesson-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--tx-primary);
}

.progress-unit {
  font-size: 0.78rem;
  color: var(--tx-muted);
}

.progress-bar-container {
  height: 8px;
  background: var(--sand);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--crimson), var(--crimson-mid));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  min-width: 0;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--tx-muted);
  margin-bottom: 0.75rem;
}

.progress-pct {
  font-weight: 600;
  color: var(--crimson);
}

.completed-lessons-list {
  margin-top: 0.75rem;
}

.sub-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tx-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}

.completed-lesson-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

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

.completed-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
  margin-top: 0.1rem;
}

.completed-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tx-primary);
}

.completed-meta {
  font-size: 0.72rem;
  color: var(--tx-muted);
  margin-top: 0.15rem;
}

/* Empty States */
.empty-state-compact {
  text-align: center;
  padding: 1.5rem 1rem;
}

.empty-state-compact .empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.empty-state-compact .empty-text {
  font-size: 0.88rem;
  color: var(--tx-muted);
  margin: 0 0 0.75rem;
}

/* Button utilities */
.btn-full-width {
  width: 100%;
  text-align: center;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .dashboard-section {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

html[data-theme="dark"] .dashboard-stats .stat-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

html[data-theme="dark"] .dashboard-stats .stat-card:hover {
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .quick-action-card {
  background: var(--surface-warm);
  border-color: var(--border);
}

html[data-theme="dark"] .quick-action-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

html[data-theme="dark"] .quick-action-card:hover .action-arrow {
  color: var(--gold-light);
}

html[data-theme="dark"] .translation-item {
  background: var(--surface-warm);
  border-color: var(--border);
}

html[data-theme="dark"] .translation-item:hover {
  background: var(--surface);
}

html[data-theme="dark"] .learning-progress-card {
  background: var(--surface);
}

html[data-theme="dark"] .challenge-phrase-preview {
  background: var(--surface);
}

html[data-theme="dark"] .challenge-context-preview {
  background: var(--surface);
  border-left-color: var(--gold);
}

/* Responsive */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stats .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .dashboard-container {
    padding: 1rem 0.75rem;
  }

  .dashboard-greeting {
    padding: 1.5rem;
  }

  .greeting-twi {
    font-size: 1.35rem;
  }

  .dashboard-stats .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .dashboard-stats .stat-card {
    padding: 1rem;
  }

  .dashboard-stats .stat-value {
    font-size: 1.35rem;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .greeting-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* ==========================================================================
   Invite Friends Page Styles
   ========================================================================== */

.invite-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.invite-page .page-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.invite-page .page-subtitle {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* Invite Form */
.invite-form-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.invite-form-section .section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.invite-form .form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.invite-form .input-row {
  display: flex;
  gap: 0.75rem;
}

.invite-form .form-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s ease;
}

.invite-form .form-input:focus {
  outline: none;
  border-color: var(--deep-crimson);
  box-shadow: 0 0 0 3px rgba(139, 26, 74, 0.15);
}

.invite-form .form-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

/* Stats */
.invite-stats-section {
  margin-bottom: 2.5rem;
}

.invite-stats-section .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.invite-stats-section .stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.invite-stats-section .stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--deep-crimson);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.invite-stats-section .stat-label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Invite Sections */
.invite-section {
  margin-bottom: 2.5rem;
}

.invite-section .section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

/* Invites List */
.invites-list {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.invite-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

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

.invite-recipient {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.invite-date {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.invite-status {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.invite-status.pending {
  background: var(--warm-gold);
  color: white;
}

.invite-status.accepted {
  background: var(--teal-green);
  color: white;
}

.invite-status.expired {
  background: var(--color-text-secondary);
  color: white;
  opacity: 0.6;
}

/* Invitees List */
.invitees-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.invitee-row {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.invitee-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--deep-crimson), var(--rich-purple));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.invitee-name {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.1rem;
}

.invitee-date {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* Empty State */
.invite-page .empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.invite-page .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.invite-page .empty-title { font-weight: 700; margin-bottom: 0.5rem; color: var(--color-text); }
.invite-page .empty-description { color: var(--color-text-secondary); max-width: 400px; margin: 0 auto; }

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .invite-form-section {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .invite-form .form-input:focus {
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

html[data-theme="dark"] .invite-stats-section .stat-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .invites-list {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .invite-row {
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .invitee-row {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .invite-page .empty-state {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

/* Responsive */
@media (max-width: 600px) {
  .invite-form .input-row {
    flex-direction: column;
  }
  .invite-stats-section .stats-grid {
    grid-template-columns: 1fr;
  }
}
/* ==========================================================================
   Leaderboard Page Styles
   ========================================================================== */

.leaderboard-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* Header */
.leaderboard-header {
  text-align: center;
  margin-bottom: 2rem;
}

.leaderboard-header .page-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.leaderboard-header .page-icon { margin-left: 0.5rem; }

.leaderboard-header .page-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Tab Navigation */
.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
  box-shadow: var(--shadow-sm);
}

.leaderboard-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.leaderboard-tab:hover {
  color: var(--color-text);
  background: var(--ivory-deep);
}

.leaderboard-tab.active {
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-mid) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 26, 74, 0.25);
}

.tab-icon { font-size: 1.1rem; }

/* Banner */
.leaderboard-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.925rem;
}

.monthly-banner {
  background: var(--gold-pale);
  color: var(--gold-deep);
  border: 1px solid var(--gold-light);
}

/* Language Filter Chips */
.language-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.language-chip {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all 0.2s;
}

.language-chip:hover {
  border-color: var(--crimson-mid);
  color: var(--crimson-mid);
}

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

/* ==========================================================================
   Podium Section
   ========================================================================== */

.podium-section {
  margin-bottom: 2rem;
}

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem 0;
}

.podium-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1rem 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
  width: 180px;
  position: relative;
}

.podium-card.is-current-user {
  box-shadow: 0 0 0 2px var(--gold), 0 4px 16px rgba(212, 168, 67, 0.25);
}

.podium-first {
  width: 200px;
  padding-top: 1.5rem;
}

.podium-medal {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.podium-first .podium-medal { font-size: 2.25rem; }

/* Avatar */
.podium-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.podium-first .podium-avatar {
  width: 80px;
  height: 80px;
}

.avatar-img,
.avatar-img-sm {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--crimson) 0%, var(--purple) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  font-family: var(--font-heading);
}

.podium-first .avatar-initials { font-size: 1.5rem; }

.podium-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.adinkra-badge { font-size: 1rem; }
.adinkra-badge-sm { font-size: 0.85rem; }

.rank-title { font-weight: 500; }

.podium-score {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--gold-deep);
  margin-bottom: 0.75rem;
}

.podium-first .podium-score { font-size: 1.35rem; }

.score-unit {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.7;
}

/* Pedestals */
.podium-pedestal {
  width: calc(100% + 2rem);
  margin: 0 -1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  color: #fff;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.pedestal-rank { font-size: 1.5rem; }

.pedestal-first {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  height: 56px;
}

.pedestal-second {
  background: linear-gradient(135deg, #a0a0a0 0%, #787878 100%);
  height: 40px;
}

.pedestal-third {
  background: linear-gradient(135deg, var(--terracotta) 0%, #A04E1F 100%);
  height: 32px;
}

/* ==========================================================================
   Ranked List (4th and beyond)
   ========================================================================== */

.ranked-list-section {
  margin-bottom: 2rem;
}

.ranked-list {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ranked-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}

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

.ranked-row:hover { background: var(--ivory-deep); }

.ranked-row.is-current-user {
  background: var(--gold-pale);
  border-left: 3px solid var(--gold);
}

.rank-number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-secondary);
  min-width: 40px;
  text-align: center;
}

.rank-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-img-sm {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials-sm {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--crimson) 0%, var(--purple) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  font-family: var(--font-heading);
}

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

.rank-name {
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.rank-title-sm { font-weight: 500; }

.rank-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold-deep);
  white-space: nowrap;
}

.score-unit-sm {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.6;
}

/* ==========================================================================
   Current User Rank Card (sticky bottom)
   ========================================================================== */

.user-rank-card {
  position: sticky;
  bottom: 1rem;
  background: linear-gradient(135deg, var(--crimson-dark) 0%, var(--purple) 100%);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  color: #fff;
  box-shadow: 0 4px 24px rgba(139, 26, 74, 0.35);
  z-index: 10;
}

.user-rank-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-rank-position {
  text-align: center;
  min-width: 65px;
}

.your-rank-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.your-rank-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.user-rank-info {
  flex: 1;
  min-width: 0;
}

.your-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-rank-info .adinkra-badge-sm { opacity: 0.9; }
.user-rank-info .rank-title-sm { opacity: 0.85; font-size: 0.8rem; color: #fff; }

.user-rank-score {
  text-align: right;
}

.your-score {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-light);
}

.user-rank-score .score-unit-sm {
  color: rgba(255, 255, 255, 0.7);
}

.user-rank-cta {
  margin-top: 0.75rem;
  text-align: center;
}

/* Auth prompt inside rank card */
.auth-prompt-card {
  text-align: center;
}

.auth-prompt-card p {
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.auth-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.leaderboard-empty {
  margin: 3rem 0;
}

.leaderboard-page .empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.leaderboard-page .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.leaderboard-page .empty-title { font-weight: 700; margin-bottom: 0.5rem; color: var(--color-text); }
.leaderboard-page .empty-description { color: var(--color-text-secondary); margin-bottom: 1.5rem; }

/* ==========================================================================
   Teams View
   ========================================================================== */

/* Current team banner */
.team-current-banner {
  background: linear-gradient(135deg, var(--crimson-dark) 0%, var(--purple) 100%);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  color: #fff;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 24px rgba(139, 26, 74, 0.25);
}

.team-current-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.team-current-info { flex: 1; min-width: 0; }

.team-current-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  margin-bottom: 0.15rem;
}

.team-current-name {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
}

.team-current-stats {
  text-align: right;
}

.team-current-tokens {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--gold-light);
}

.team-current-members {
  display: block;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Create team section */
.team-create-section {
  margin-bottom: 1.75rem;
}

.team-create-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px dashed var(--color-border);
}

.team-create-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.team-create-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.team-create-form .form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.team-create-form .form-group {
  flex: 1;
  min-width: 180px;
}

.team-create-form .form-group.form-actions {
  flex: 0 0 auto;
  min-width: auto;
}

.team-create-form .form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.team-create-form .form-hint {
  font-weight: 400;
  color: var(--color-text-secondary);
}

.team-create-form .form-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s;
}

.team-create-form .form-input:focus {
  outline: none;
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px rgba(139, 26, 74, 0.1);
}

/* Teams grid */
.teams-list-section {
  margin-bottom: 2rem;
}

.teams-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.team-card {
  display: flex;
  align-items: stretch;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.team-card:hover {
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.1));
}

.team-card.is-user-team {
  box-shadow: 0 0 0 2px var(--gold), 0 4px 16px rgba(212, 168, 67, 0.2);
}

.team-card-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text-secondary);
  background: var(--ivory-deep, rgba(0, 0, 0, 0.03));
  border-right: 1px solid var(--color-border);
}

.team-card-body {
  flex: 1;
  padding: 1rem 1.25rem;
  min-width: 0;
}

.team-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.team-card-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-card-tokens {
  white-space: nowrap;
  flex-shrink: 0;
}

.team-token-value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--gold-deep);
}

.team-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.team-card-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.825rem;
  color: var(--color-text-secondary);
  flex-wrap: wrap;
}

.team-card-captain strong {
  color: var(--color-text);
}

.team-card-count {
  white-space: nowrap;
}

.team-card-actions {
  margin-top: 0.75rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .leaderboard-page { padding: 1.25rem 0.75rem 5rem; }

  .leaderboard-header .page-title { font-size: 1.5rem; }

  .leaderboard-tabs { gap: 0.25rem; padding: 0.25rem; }
  .leaderboard-tab { padding: 0.5rem 0.85rem; font-size: 0.85rem; }

  .podium { gap: 0.5rem; }
  .podium-card { width: 110px; padding: 0.75rem 0.5rem 0; }
  .podium-first { width: 130px; }
  .podium-avatar { width: 48px; height: 48px; }
  .podium-first .podium-avatar { width: 60px; height: 60px; }
  .podium-name { font-size: 0.8rem; }
  .podium-title { font-size: 0.7rem; }
  .podium-score { font-size: 0.95rem; }
  .podium-first .podium-score { font-size: 1.1rem; }
  .pedestal-first { height: 44px; }
  .pedestal-second { height: 32px; }
  .pedestal-third { height: 24px; }
  .podium-pedestal { width: calc(100% + 1rem); margin: 0 -0.5rem; }

  .ranked-row { padding: 0.75rem 1rem; gap: 0.75rem; }
  .rank-number { min-width: 32px; font-size: 0.875rem; }
  .rank-avatar { width: 36px; height: 36px; }
  .rank-name { font-size: 0.85rem; }

  .user-rank-inner { gap: 0.75rem; }
  .your-rank-number { font-size: 1.35rem; }
  .your-score { font-size: 1.15rem; }
  .user-rank-position { min-width: 50px; }

  .language-chip { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

  /* Teams responsive */
  .team-current-inner { gap: 0.75rem; }
  .team-current-name { font-size: 1.05rem; }
  .team-current-tokens { font-size: 1.1rem; }

  .team-create-form .form-row { flex-direction: column; }
  .team-create-form .form-group { min-width: 100%; }

  .team-card-rank { min-width: 40px; font-size: 0.875rem; }
  .team-card-body { padding: 0.85rem 1rem; }
  .team-card-name { font-size: 0.95rem; }
  .team-card-meta { gap: 0.75rem; font-size: 0.8rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .podium-card:hover {
    transform: translateY(-3px);
  }
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .leaderboard-tabs {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .leaderboard-tab:hover {
  background: var(--surface-warm);
}

html[data-theme="dark"] .leaderboard-tab.active {
  box-shadow: 0 2px 8px rgba(139, 26, 74, 0.4);
}

html[data-theme="dark"] .podium-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .ranked-list {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .ranked-row:hover {
  background: var(--surface-warm);
}

html[data-theme="dark"] .ranked-row.is-current-user {
  background: rgba(212, 168, 67, 0.12);
}

html[data-theme="dark"] .language-chip {
  background: var(--color-surface);
  border-color: var(--border);
}

html[data-theme="dark"] .language-chip:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

html[data-theme="dark"] .monthly-banner {
  background: rgba(212, 168, 67, 0.12);
  border-color: var(--border-gold);
}

html[data-theme="dark"] .leaderboard-page .empty-state {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .team-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .team-card:hover {
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .team-card-rank {
  background: var(--surface);
  border-right-color: var(--border);
}
/* ==========================================================================
   Learn Pages Styles (index + show)
   ========================================================================== */

/* --- Learn Index --- */
.learn-index-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.learn-hero {
  text-align: center;
  margin-bottom: 4rem;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--deep-crimson) 0%, var(--rich-purple) 100%);
  border-radius: var(--radius-lg);
  color: white;
}

.learn-hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.learn-hero-title .hero-symbol {
  animation: bounce 2s infinite;
}

.learn-hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Language Cards Grid */
.languages-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .languages-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  }
}

.language-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.language-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.language-flag {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 50%;
}

.language-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
}

.language-native {
  color: var(--text-secondary);
  margin: 0.25rem 0 0;
}

.language-card-body {
  padding: 1.5rem;
}

.language-description {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.language-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.language-stats .stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stat-icon {
  font-size: 1.1rem;
}

.stat-text {
  font-size: 0.9rem;
}

.cultural-focus {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cultural-icon {
  font-size: 1.1rem;
}

/* Progress Preview */
.progress-preview {
  margin-bottom: 1rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.progress-text {
  color: var(--text-secondary);
}

.progress-percentage {
  font-weight: 600;
  color: var(--teal-green);
}

/* Language Card Footer */
.language-card-footer {
  padding: 1.5rem;
  background: var(--surface);
}

/* --- Learn Show (Curriculum) --- */
.learn-show-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.learn-show-container .language-header {
  background: linear-gradient(135deg, var(--deep-crimson) 0%, var(--rich-purple) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: white;
  margin-bottom: 3rem;
}

.learn-show-container .back-link {
  color: rgba(255, 255, 255, 0.8);
}

.learn-show-container .back-link:hover {
  color: white;
}

.language-title {
  margin-bottom: 2rem;
}

.learn-show-container .language-name {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.learn-show-container .language-flag {
  font-size: 2rem;
  width: auto;
  height: auto;
  background: none;
}

.learn-show-container .language-description {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0;
  color: white;
}

.progress-summary {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  color: #1a1a2e;
}

.progress-summary .stat-value {
  color: var(--crimson);
  font-weight: 700;
}

.progress-summary .stat-label {
  color: #4a4a5a;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
}

/* Curriculum Units */
.curriculum-section {
  margin-bottom: 3rem;
}

.unit-container {
  margin-bottom: 3rem;
}

.unit-header {
  margin-bottom: 2rem;
}

.unit-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.unit-number {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.unit-name {
  font-size: 1.75rem;
}

.unit-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.unit-progress-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-width: 100px;
}

.unit-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.unit-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-green), var(--warm-gold));
  transition: width 0.3s ease;
}

/* Lesson Cards */
.lessons-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .lessons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .lessons-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.lesson-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lesson-card.lesson-locked {
  opacity: 0.6;
  background: var(--surface);
}

.lesson-card.lesson-completed {
  border: 2px solid var(--teal-green);
}

.lesson-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.status-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
}

.status-icon.completed {
  background: var(--teal-green);
  color: white;
}

.status-icon.unlocked {
  background: var(--warm-gold);
  color: white;
}

.status-icon.locked {
  background: var(--border);
  color: var(--text-secondary);
}

.lesson-content {
  padding-right: 2rem;
}

.lesson-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

.lesson-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.lesson-duration,
.lesson-activities {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.meta-icon {
  font-size: 0.9rem;
}

.lesson-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.lesson-actions {
  margin-top: auto;
}

/* CTA section in learn index */
.learn-index-container .cta-section {
  background: linear-gradient(135deg, var(--deep-crimson) 0%, var(--rich-purple) 100%);
}

/* Auth CTA in learn show */
.auth-cta {
  background: linear-gradient(135deg, var(--teal-green) 0%, var(--warm-gold) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: white;
}

.auth-cta .cta-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.auth-cta .cta-subtitle {
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .progress-summary {
  background: rgba(30, 20, 34, 0.95);
  color: var(--tx-primary);
}

html[data-theme="dark"] .progress-summary .stat-label {
  color: var(--tx-muted);
}

html[data-theme="dark"] .lesson-card:hover {
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .lesson-card.lesson-completed {
  border-color: var(--teal);
}

html[data-theme="dark"] .status-icon.completed {
  background: var(--teal);
}

html[data-theme="dark"] .status-icon.unlocked {
  background: var(--gold);
}

html[data-theme="dark"] .status-icon.locked {
  background: var(--border);
  color: var(--tx-muted);
}

html[data-theme="dark"] .progress-percentage {
  color: var(--teal-light);
}
/* ==========================================================================
   Legal Pages (Privacy Policy, Terms of Service)
   ========================================================================== */

.legal-page {
  padding: 3rem 0 4rem;
  background-color: var(--background);
}

.legal-page .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.legal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 3rem;
}

.legal-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--gold-light);
}

.legal-header h1 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--deep-crimson);
  margin-bottom: 0.5rem;
}

.legal-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.legal-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.legal-section {
  margin-bottom: 2.5rem;
}

.legal-section h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--deep-crimson);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.legal-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--rich-purple);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-section p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.legal-section ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

.legal-section ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.legal-section ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--warm-gold);
}

.legal-section a {
  color: var(--deep-crimson);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.legal-section a:hover {
  color: var(--rich-purple);
}

.legal-address {
  font-style: normal;
  background: var(--soft-cream);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  line-height: 1.75;
  border-left: 3px solid var(--warm-gold);
}

.legal-footer {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 2px solid var(--gold-light);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .legal-page {
  background-color: var(--background);
}

html[data-theme="dark"] .legal-content {
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .legal-header {
  border-bottom-color: var(--border-gold);
}

html[data-theme="dark"] .legal-header h1 {
  color: var(--gold-light);
}

html[data-theme="dark"] .legal-section h2 {
  color: var(--gold-light);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .legal-section h3 {
  color: var(--purple-light);
}

html[data-theme="dark"] .legal-section a {
  color: var(--gold-light);
}

html[data-theme="dark"] .legal-section a:hover {
  color: var(--gold);
}

html[data-theme="dark"] .legal-address {
  background: var(--surface);
  border-left-color: var(--gold);
}

html[data-theme="dark"] .legal-footer {
  border-top-color: var(--border-gold);
}

/* Responsive */
@media (max-width: 768px) {
  .legal-page {
    padding: 1.5rem 0 2rem;
  }

  .legal-content {
    padding: 1.5rem;
  }

  .legal-header h1 {
    font-size: 1.75rem;
  }

  .legal-meta {
    flex-direction: column;
    gap: 0.25rem;
  }
}
/* ==========================================================================
   Lesson Page Styles (learn/lesson)
   ========================================================================== */

.lesson-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.lesson-header {
  margin-bottom: 2rem;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lesson-info {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.lesson-container > .lesson-header .lesson-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--deep-crimson);
  margin: 0 0 0.5rem;
}

.lesson-container .lesson-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

/* Progress dots */
.activity-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}

.progress-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.progress-dot.active {
  background: var(--deep-crimson);
  color: white;
}

.progress-dot.completed {
  background: var(--teal-green);
  color: white;
}

.progress-line {
  height: 3px;
  width: 40px;
  background: var(--border);
}

.progress-line.completed {
  background: var(--teal-green);
}

/* Activity card */
.activity-card {
  background: var(--color-surface);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.activity-header {
  margin-bottom: 2rem;
  text-align: center;
}

.activity-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--dark-charcoal);
  margin: 0 0 0.5rem;
}

.activity-instructions {
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}

.activity-type-badge {
  background: var(--soft-cream);
  color: var(--deep-crimson);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.activity-body { margin-bottom: 2rem; }

/* Flashcards */
.flashcard-deck { text-align: center; }

.flashcard {
  display: none;
  perspective: 1000px;
  cursor: pointer;
  margin: 0 auto 1.5rem;
  max-width: 400px;
  height: 220px;
}

.flashcard.active { display: block; }

.flashcard-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 0.75rem;
}

.flashcard-front {
  background: linear-gradient(135deg, var(--soft-cream), white);
  border: 2px solid var(--warm-gold);
}

.flashcard-back {
  background: linear-gradient(135deg, var(--deep-crimson), var(--rich-purple));
  color: white;
  transform: rotateY(180deg);
}

.card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}

.card-text {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
}

.card-pronunciation {
  font-size: 1rem;
  opacity: 0.9;
  font-style: italic;
}

.flashcard-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.card-counter {
  font-weight: 600;
  color: var(--text-secondary);
}

/* Listen & Repeat */
.listen-repeat-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.listen-item {
  background: var(--soft-cream);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.listen-phrase {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--deep-crimson);
  flex: 1;
  min-width: 150px;
}

.listen-translation {
  color: var(--text-secondary);
  flex: 1;
  min-width: 150px;
}

.listen-pronunciation {
  font-style: italic;
  color: var(--rich-purple);
  width: 100%;
  font-size: 0.9rem;
}

/* Quiz */
.quiz-question { display: none; }
.quiz-question.active { display: block; }

.question-fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.question-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--dark-charcoal);
  margin-bottom: 1.5rem;
  text-align: center;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
}

.option-btn {
  background: var(--color-surface);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.option-btn:hover { border-color: var(--deep-crimson); }
.option-btn.correct { background: var(--success-light); border-color: var(--teal-green); }
.option-btn.incorrect { background: var(--error-light); border-color: var(--error); }
.option-btn.disabled { pointer-events: none; opacity: 0.7; }

.question-feedback {
  text-align: center;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.quiz-score {
  text-align: center;
  padding: 2rem;
}

.quiz-score h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--deep-crimson);
}

/* Conversation */
.conversation-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.dialogue-line {
  padding: 1rem;
  border-radius: 1rem;
  max-width: 85%;
}

.dialogue-other {
  background: var(--border-light);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.dialogue-user {
  background: var(--deep-crimson);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.dialogue-speaker {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.dialogue-text {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.dialogue-translation {
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.8;
}

/* Navigation */
.activity-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-success {
  background: var(--teal-green);
  color: white;
}

.btn-success:hover { opacity: 0.9; transform: translateY(-1px); }

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .activity-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .activity-title {
  color: var(--tx-primary);
}

html[data-theme="dark"] .activity-type-badge {
  background: rgba(139, 26, 74, 0.2);
  color: var(--crimson-mid);
}

html[data-theme="dark"] .flashcard-front {
  background: linear-gradient(135deg, var(--surface-warm), var(--surface));
  border-color: var(--border-gold);
}

html[data-theme="dark"] .listen-item {
  background: var(--surface);
}

html[data-theme="dark"] .listen-phrase {
  color: var(--gold-light);
}

html[data-theme="dark"] .listen-pronunciation {
  color: var(--purple-light);
}

html[data-theme="dark"] .question-text {
  color: var(--tx-primary);
}

html[data-theme="dark"] .option-btn {
  background: var(--color-surface);
  border-color: var(--border);
  color: var(--tx-primary);
}

html[data-theme="dark"] .option-btn:hover {
  border-color: var(--gold);
}

html[data-theme="dark"] .dialogue-other {
  background: var(--surface);
  color: var(--tx-primary);
}

html[data-theme="dark"] .quiz-score h3 {
  color: var(--gold-light);
}

/* Responsive */
@media (max-width: 600px) {
  .lesson-container > .lesson-header .lesson-title { font-size: 1.5rem; }
  .flashcard { height: 180px; }
  .card-text { font-size: 1.5rem; }
  .lesson-nav { flex-direction: column; align-items: flex-start; }
}
/* ==========================================================================
   Maintenance / Coming Soon Page
   ========================================================================== */

.maintenance-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #1A1A2E 0%, #8B1A4A 40%, #5B2C6F 70%, #D4A843 100%);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Subtle animated background glow */
.maintenance-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(212, 168, 67, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(139, 26, 74, 0.08) 0%, transparent 50%);
  animation: gentleFloat 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes gentleFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2%, 2%); }
}

.maintenance-container {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
}

.maintenance-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  text-align: center;
  color: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.maintenance-logo {
  margin-bottom: 1.75rem;
}

.maintenance-logo img {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.maintenance-title {
  font-family: var(--font-heading, 'Crimson Text', Georgia, serif);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  color: white;
  line-height: 1.2;
}

.maintenance-greeting {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.maintenance-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--warm-gold, #D4A843), var(--deep-crimson, #8B1A4A));
  border-radius: 2px;
  margin: 0 auto 1.5rem;
}

.maintenance-description {
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 1.75rem;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.maintenance-languages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}

.language-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2rem;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

.maintenance-promise {
  font-size: 1rem;
  font-weight: 500;
  color: var(--warm-gold, #D4A843);
  margin: 0 0 1.75rem;
}

.maintenance-cta {
  margin-bottom: 2rem;
}

.maintenance-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.maintenance-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

.maintenance-btn:active {
  transform: translateY(0);
}

.maintenance-footer {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.maintenance-sign-off {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 0.75rem;
  font-style: italic;
}

.maintenance-brand {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.maintenance-brand .brand-sobolo {
  font-family: var(--font-heading, 'Crimson Text', Georgia, serif);
  font-weight: 700;
  color: white;
}

.maintenance-brand .brand-ai {
  font-family: var(--font-heading, 'Crimson Text', Georgia, serif);
  font-weight: 700;
  color: var(--warm-gold, #D4A843);
}

.maintenance-tagline {
  font-family: var(--font-heading, 'Crimson Text', Georgia, serif);
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  letter-spacing: 0.04em;
}

/* Responsive */
@media (max-width: 480px) {
  .maintenance-card {
    padding: 2.25rem 1.5rem;
    border-radius: 20px;
  }

  .maintenance-title {
    font-size: 1.85rem;
  }

  .maintenance-greeting {
    font-size: 0.95rem;
  }
}
/* ==========================================================================
   Phrasebook Pages Styles (index + show + category)
   ========================================================================== */

/* --- Phrasebook Index --- */
.phrasebook-index-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.phrasebook-hero {
  text-align: center;
  margin-bottom: 4rem;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--warm-gold) 0%, var(--deep-crimson) 100%);
  border-radius: var(--radius-lg);
  color: white;
}

.phrasebook-hero .hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.phrasebook-hero .hero-symbol {
  animation: flip 3s infinite ease-in-out;
}

.phrasebook-hero .hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Category Cards */
.featured-categories {
  margin-bottom: 4rem;
}

.categories-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.category-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.category-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.category-info {
  flex: 1;
}

.category-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.category-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.category-samples {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sample-phrase {
  font-size: 0.8rem;
  background: var(--warm-gold);
  color: #3D1A0A;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 500;
  text-align: center;
}

.sample-phrase .sample-original,
.sample-phrase .sample-translation {
  color: #3D1A0A;
}

/* Phrasebook Language Cards (smaller variant) */
.phrasebook-index-container .language-card {
  padding: 1.5rem;
}

.phrasebook-index-container .language-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.phrasebook-index-container .language-flag {
  font-size: 2rem;
  width: 50px;
  height: 50px;
}

.phrasebook-index-container .language-name {
  font-size: 1.1rem;
}

.phrasebook-index-container .language-native {
  font-size: 0.9rem;
}

.phrasebook-index-container .language-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.language-actions {
  margin-top: auto;
}

@media (min-width: 1024px) {
  .phrasebook-index-container .languages-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Recent Phrases */
.recent-phrases {
  margin-bottom: 4rem;
}

.phrases-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.phrase-item {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.phrase-text {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.source-text {
  font-weight: 500;
  color: var(--text-primary);
}

.arrow {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.phrase-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.time-ago {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Phrasebook Features */
.phrasebook-features {
  margin-bottom: 4rem;
}

.phrasebook-index-container .cta-section {
  background: linear-gradient(135deg, var(--rich-purple) 0%, var(--teal-green) 100%);
}

/* --- Phrasebook Show --- */
.phrasebook-show-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.phrasebook-header {
  text-align: center;
  margin-bottom: 3rem;
}

.header-nav {
  text-align: left;
  margin-bottom: 1rem;
}

.phrasebook-show-container .page-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--deep-crimson);
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.lang-flag {
  font-size: 2rem;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

.categories-section {
  margin-bottom: 3rem;
}

.phrasebook-show-container .categories-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.phrasebook-show-container .category-card {
  padding: 1.5rem;
  align-items: flex-start;
  border: 2px solid transparent;
}

.phrasebook-show-container .category-card:hover {
  border-color: var(--warm-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.phrasebook-show-container .category-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--soft-cream);
  border-radius: 12px;
}

.phrasebook-show-container .category-name {
  font-size: 1rem;
  font-weight: 700;
}

.category-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--deep-crimson);
  background: rgba(139, 26, 74, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Phrase Cards */
.popular-section {
  margin-bottom: 3rem;
}

.phrase-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.phrase-source {
  font-weight: 600;
  color: var(--dark-charcoal);
  margin-bottom: 0.25rem;
}

.phrase-translation {
  font-family: var(--font-heading);
  color: var(--deep-crimson);
  font-size: 1.1rem;
  font-weight: 600;
}

.phrase-pronunciation {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--rich-purple);
  margin-top: 0.25rem;
}

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

.phrase-context {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 150px;
  text-align: right;
}

/* --- Phrasebook Category Page --- */
.phrasebook-category-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.category-header {
  margin-bottom: 2rem;
}

.category-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.category-title-row .category-icon {
  font-size: 2.5rem;
}

.category-title-row .page-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--deep-crimson);
  margin: 0 0 0.25rem;
}

.phrasebook-category-container .phrase-card {
  transition: transform 0.2s ease;
}

.phrasebook-category-container .phrase-card:hover {
  transform: translateX(4px);
}

.phrasebook-category-container .phrase-context {
  font-size: 0.85rem;
  color: var(--teal-green);
  margin-top: 0.5rem;
  max-width: none;
  text-align: left;
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .phrase-source {
  color: var(--tx-primary);
}

html[data-theme="dark"] .phrase-translation {
  color: var(--gold-light);
}

html[data-theme="dark"] .phrase-pronunciation {
  color: var(--purple-light);
}

html[data-theme="dark"] .phrase-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .category-count {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold-light);
}

html[data-theme="dark"] .phrasebook-show-container .category-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .phrasebook-show-container .category-icon {
  background: var(--surface);
}

html[data-theme="dark"] .sample-phrase {
  background: var(--gold);
  color: #1A0A12;
}

html[data-theme="dark"] .sample-phrase .sample-original,
html[data-theme="dark"] .sample-phrase .sample-translation {
  color: #1A0A12;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .sample-phrase {
    background: var(--gold);
    color: #1A0A12;
  }

  html:not([data-theme="light"]) .sample-phrase .sample-original,
  html:not([data-theme="light"]) .sample-phrase .sample-translation {
    color: #1A0A12;
  }
}

html[data-theme="dark"] .phrasebook-category-container .phrase-context {
  color: var(--teal-light);
}

/* Responsive */
@media (max-width: 600px) {
  .phrasebook-show-container .page-title {
    font-size: 1.75rem;
  }

  .phrasebook-show-container .categories-grid {
    grid-template-columns: 1fr;
  }

  .phrase-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .phrase-actions {
    align-self: flex-end;
  }

  .phrase-context {
    max-width: none;
    text-align: left;
  }
}
/* ==========================================================================
   Profile Page Styles
   ========================================================================== */

.profile-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Profile Header */
.profile-header {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.profile-actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

/* Learning Stats */
.learning-stats {
  margin-bottom: 3rem;
}

.profile-container .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.profile-container .stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-container .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.profile-container .stat-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.profile-container .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-card.primary .stat-value { color: var(--deep-crimson); }
.stat-card.secondary .stat-value { color: var(--rich-purple); }
.stat-card.accent .stat-value { color: var(--warm-gold); }
.stat-card.fire .stat-value { color: var(--deep-crimson); }

.detailed-stats {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

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

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

.detail-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Subscription */
.subscription-section {
  margin-bottom: 3rem;
}

.subscription-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.subscription-card.active {
  border: 2px solid var(--teal-green);
}

.subscription-card.free {
  border: 2px solid var(--border);
}

.subscription-status {
  margin-bottom: 2rem;
}

.status-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.subscription-card.active .status-badge {
  background: var(--teal-green);
  color: white;
}

.subscription-card.free .status-badge {
  background: var(--border);
  color: var(--text-secondary);
}

.next-billing {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.subscription-features h4,
.subscription-features h3,
.subscription-features-title {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.features-list,
.benefits-list {
  list-style: none;
  padding: 0;
  margin-bottom: 2rem;
}

.feature-item,
.benefit-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.profile-container .feature-icon {
  color: var(--teal-green);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0;
}

.benefit-icon {
  color: var(--warm-gold);
}

.usage-remaining {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 2rem;
}

.usage-remaining p {
  margin: 0 0 0.5rem;
  color: var(--text-secondary);
}

.usage-remaining p:last-child {
  margin-bottom: 0;
}

.upgrade-action {
  text-align: center;
}

/* Plans Grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.plan-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

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

.plan-card.recommended {
  border-color: var(--deep-crimson);
  box-shadow: var(--shadow-md);
}

.plan-badge {
  position: absolute;
  top: -12px;
  right: 1.5rem;
  background: var(--warm-gold);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.plan-price {
  margin-bottom: 1.5rem;
}

.price-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--deep-crimson);
}

.price-interval {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  flex: 1;
}

.plan-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.feature-check {
  color: var(--teal-green);
  font-weight: 700;
  flex-shrink: 0;
}

.plans-note {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .plans-grid {
    grid-template-columns: 1fr;
  }
}

/* Achievements */
.achievements-section {
  margin-bottom: 3rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.achievement-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.achievement-card:hover {
  transform: translateY(-2px);
}

.achievement-card.earned {
  border: 2px solid var(--warm-gold);
}

.achievement-card.locked {
  opacity: 0.6;
  border: 2px solid var(--border);
}

.achievement-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.achievement-icon.dimmed {
  filter: grayscale(100%);
  opacity: 0.5;
}

.achievement-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.achievement-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.achievement-date {
  font-size: 0.8rem;
  color: var(--warm-gold);
  font-weight: 500;
}

.achievement-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Activity Feed */
.activity-section {
  margin-bottom: 3rem;
}

.activity-feed {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

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

.activity-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.activity-title {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.activity-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.activity-time {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Quick Actions */
.quick-actions {
  margin-bottom: 2rem;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.action-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
}

.action-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.action-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.action-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* --- Profile Info Partial --- */
.profile-basic-info {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.avatar-section {
  flex-shrink: 0;
  text-align: center;
}

.user-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
  cursor: pointer;
  border: 4px solid var(--warm-gold);
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--deep-crimson), var(--rich-purple));
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-initials {
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.avatar-upload {
  margin-top: 0.5rem;
}

.avatar-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.avatar-input {
  font-size: 0.8rem;
  width: 100%;
}

.user-details {
  flex: 1;
}

.user-name {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.premium-badge {
  font-size: 0.8rem;
  background: linear-gradient(135deg, var(--warm-gold), #ffd700);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-weight: 500;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.meta-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.meta-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.user-bio {
  background: var(--surface);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--warm-gold);
}

.user-bio p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.user-stats-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 0.5rem;
}

.stat-summary-item {
  text-align: center;
}

.summary-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--deep-crimson);
  margin-bottom: 0.25rem;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.member-since {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.member-label {
  color: var(--text-secondary);
}

.member-date {
  color: var(--text-primary);
  font-weight: 500;
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .profile-header {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .profile-container .stat-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .profile-container .stat-card:hover {
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .detailed-stats {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .detail-item {
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .subscription-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .subscription-card.free .status-badge {
  background: var(--border);
  color: var(--tx-secondary);
}

html[data-theme="dark"] .plan-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

html[data-theme="dark"] .plan-card:hover {
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .plan-card.recommended {
  border-color: var(--crimson-mid);
}

html[data-theme="dark"] .achievement-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .achievement-card.earned {
  border-color: var(--gold);
}

html[data-theme="dark"] .achievement-card.locked {
  border-color: var(--border);
}

html[data-theme="dark"] .activity-feed {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .action-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .action-card:hover {
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .user-avatar {
  border-color: var(--gold);
}

/* Responsive */
@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-actions {
    justify-content: center;
  }

  .profile-container .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detailed-stats {
    grid-template-columns: 1fr;
  }

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

  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-basic-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .user-avatar {
    width: 100px;
    height: 100px;
  }

  .avatar-initials {
    font-size: 2rem;
  }

  .user-name {
    justify-content: center;
  }

  .user-meta {
    align-items: center;
  }

  .meta-item {
    justify-content: center;
  }

  .user-stats-summary {
    justify-content: center;
  }

  .member-since {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .user-stats-summary {
    flex-direction: column;
    gap: 1rem;
  }

  .user-name {
    font-size: 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }
}
/* ==========================================================================
   Translate Page Styles
   ========================================================================== */

.translate-main {
  padding: 2rem 0 4rem;
  min-height: 80vh;
}

.translate-header {
  text-align: center;
  margin-bottom: 3rem;
}

.translate-header .page-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--deep-crimson);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.hibiscus-icon {
  font-size: 2rem;
}

.page-description {
  font-size: 1.125rem;
  color: var(--dark-charcoal);
  opacity: 0.8;
}

.translate-interface {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(139, 26, 74, 0.1);
  border: 1px solid var(--warm-gold);
}

.translate-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: start;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.language-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.language-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--warm-gold);
  border-radius: 8px;
  background: var(--soft-cream);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--deep-crimson);
  cursor: pointer;
}

.language-select:focus {
  border-color: var(--deep-crimson);
}

.translate-textarea {
  min-height: 150px;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.translate-textarea:focus {
  border-color: var(--deep-crimson);
}

.source-textarea {
  background: var(--color-surface);
}

.result-textarea {
  background: var(--soft-cream);
  border-color: var(--warm-gold);
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.mic-button,
.play-audio,
.save-translation,
.share-translation {
  background: var(--teal-green);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mic-button:hover,
.play-audio:hover,
.save-translation:hover,
.share-translation:hover {
  background: var(--teal-light);
  transform: translateY(-1px);
}

.char-counter {
  font-size: 0.75rem;
  color: var(--dark-charcoal);
  opacity: 0.6;
}

.translate-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0;
}

.swap-languages {
  background: var(--warm-gold);
  color: var(--dark-charcoal);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.swap-languages:hover {
  background: var(--gold-light);
  transform: rotate(180deg) scale(1.1);
}

.translate-btn {
  background: var(--deep-crimson);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.translate-btn:hover {
  background: var(--crimson-light);
  transform: translateY(-2px);
}

/* Translation Result */
.translation-content {
  padding: 1rem;
}

.translated-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--deep-crimson);
  font-family: var(--font-heading);
  margin-bottom: 1rem;
}

.pronunciation {
  background: rgba(212, 168, 67, 0.1);
  padding: 0.75rem;
  border-radius: 8px;
  font-style: italic;
  color: var(--rich-purple);
  margin-bottom: 1rem;
}

.cultural-context {
  background: rgba(91, 44, 111, 0.05);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--rich-purple);
  margin-bottom: 1rem;
}

.cultural-context h4 {
  color: var(--rich-purple);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.alternatives {
  margin-top: 1rem;
}

.alternatives h4 {
  color: var(--teal-green);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.alternatives ul {
  list-style: none;
  padding: 0;
}

.alternatives li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--dark-charcoal);
}

.alternatives li:last-child {
  border-bottom: none;
}

.result-placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1rem;
}

.translation-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.confidence-score {
  background: rgba(139, 26, 74, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Error States */
.error-message {
  padding: 1rem;
  text-align: center;
  color: var(--error);
}

.error-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.error-text h4 {
  color: var(--error);
  margin-bottom: 0.5rem;
}

.retry-button {
  background: var(--error);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 1rem;
}

.retry-button:hover {
  background: var(--error-border);
}

/* Usage Limit */
.usage-limit-message {
  padding: 1rem;
  text-align: center;
}

.limit-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.limit-content h4 {
  color: var(--deep-crimson);
  margin-bottom: 0.5rem;
}

.upgrade-benefits {
  margin: 1rem 0;
  text-align: left;
}

.upgrade-benefits ul {
  list-style: none;
  padding: 0;
}

.upgrade-benefits li {
  padding: 0.25rem 0;
}

.reset-info {
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* Focus styles for interactive elements — WCAG 2.4.7 */
.mic-button:focus-visible,
.play-audio:focus-visible,
.save-translation:focus-visible,
.share-translation:focus-visible {
  outline: 2px solid var(--deep-crimson);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(139, 26, 74, 0.15);
}

.swap-languages:focus-visible {
  outline: 2px solid var(--deep-crimson);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(139, 26, 74, 0.15);
}

.translate-btn:focus-visible {
  outline: 2px solid var(--warm-gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.25);
}

.language-select:focus-visible {
  outline: 2px solid var(--deep-crimson);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(139, 26, 74, 0.15);
}

.retry-button:focus-visible {
  outline: 2px solid var(--deep-crimson);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(139, 26, 74, 0.15);
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .translate-interface {
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  border-color: var(--border-gold);
}

html[data-theme="dark"] .page-description {
  color: var(--tx-secondary);
}

html[data-theme="dark"] .language-select {
  background: var(--surface);
  border-color: var(--border-gold);
  color: var(--gold-light);
}

html[data-theme="dark"] .source-textarea {
  background: var(--color-surface);
  color: var(--tx-primary);
}

html[data-theme="dark"] .result-textarea {
  background: var(--surface);
  border-color: var(--border-gold);
  color: var(--tx-primary);
}

html[data-theme="dark"] .char-counter {
  color: var(--tx-muted);
}

html[data-theme="dark"] .pronunciation {
  background: rgba(212, 168, 67, 0.12);
  color: var(--purple-light);
}

html[data-theme="dark"] .cultural-context {
  background: rgba(91, 44, 111, 0.15);
  border-left-color: var(--purple-light);
}

html[data-theme="dark"] .cultural-context h4 {
  color: var(--purple-light);
}

html[data-theme="dark"] .alternatives li {
  color: var(--tx-secondary);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .confidence-score {
  background: rgba(139, 26, 74, 0.2);
  color: var(--crimson-mid);
}

html[data-theme="dark"] .limit-content h4 {
  color: var(--gold-light);
}

/* Responsive */
@media (max-width: 768px) {
  .translate-inputs {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .translate-controls {
    padding: 1rem 0;
  }

  .swap-languages {
    transform: rotate(90deg);
  }

  .swap-languages:hover {
    transform: rotate(270deg) scale(1.1);
  }

  .translate-header .page-title {
    font-size: 2rem;
  }

  .textarea-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
}
/* ==========================================================================
   Translation History Page Styles
   ========================================================================== */

.history-main {
  padding: 2rem 0 4rem;
  min-height: 80vh;
}

/* Header */
.history-header {
  margin-bottom: 2rem;
}

.history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.history-title-row .page-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--deep-crimson);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

/* Search & Filter Controls */
.history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.history-search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 480px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dark-charcoal);
  opacity: 0.4;
  pointer-events: none;
}

.history-search-input {
  width: 100%;
  padding: 0.625rem 2.25rem 0.625rem 2.5rem;
  border: 1px solid rgba(139, 26, 74, 0.2);
  border-radius: var(--radius-md, 8px);
  font-size: 0.9375rem;
  font-family: var(--font-body);
  background: var(--color-surface);
  color: var(--dark-charcoal);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.history-search-input:focus {
  outline: none;
  border-color: var(--deep-crimson);
  box-shadow: 0 0 0 3px rgba(139, 26, 74, 0.1);
}

.history-search-input::placeholder {
  color: var(--dark-charcoal);
  opacity: 0.4;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dark-charcoal);
  opacity: 0.4;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, background 0.2s;
}

.search-clear:hover {
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.05);
}

/* Tabs */
.history-tabs {
  display: flex;
  gap: 0.25rem;
  background: rgba(139, 26, 74, 0.06);
  border-radius: var(--radius-md, 8px);
  padding: 3px;
}

.history-tab {
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark-charcoal);
  text-decoration: none;
  transition: all 0.2s ease;
}

.history-tab:hover {
  background: rgba(139, 26, 74, 0.08);
  color: var(--deep-crimson);
}

.history-tab.active {
  background: var(--color-surface);
  color: var(--deep-crimson);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Results Summary */
.history-results-summary {
  font-size: 0.875rem;
  color: var(--dark-charcoal);
  opacity: 0.7;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.history-results-summary strong {
  font-weight: 600;
}

/* Translation Cards */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
  border: 1px solid rgba(139, 26, 74, 0.08);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.history-card:hover {
  box-shadow: 0 4px 12px rgba(139, 26, 74, 0.12);
  transform: translateY(-1px);
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.language-pair-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lang-badge.source {
  background: rgba(139, 26, 74, 0.08);
  color: var(--deep-crimson);
}

.lang-badge.target {
  background: rgba(212, 168, 67, 0.15);
  color: #8B6914;
}

.history-timestamp {
  font-size: 0.8125rem;
  color: var(--dark-charcoal);
  opacity: 0.5;
}

/* Text Pair */
.history-card-body {
  margin-bottom: 0.75rem;
}

.history-text-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.history-source,
.history-translated {
  min-width: 0;
}

.text-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dark-charcoal);
  opacity: 0.45;
  margin-bottom: 0.375rem;
}

.text-content {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--dark-charcoal);
  margin: 0;
  word-break: break-word;
}

.text-content.translated {
  color: var(--deep-crimson);
  font-weight: 500;
}

/* Card Actions */
.history-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(139, 26, 74, 0.06);
}

.history-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--dark-charcoal);
  opacity: 0.6;
  font-size: 0.8125rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-action-btn:hover {
  opacity: 1;
  background: rgba(139, 26, 74, 0.06);
}

.history-action-btn.favorite-btn.active {
  opacity: 1;
  color: var(--deep-crimson);
}

.history-action-btn.favorite-btn.active:hover {
  background: rgba(139, 26, 74, 0.1);
}

.history-action-btn.copy-btn.copied {
  color: #10B981;
  opacity: 1;
}

/* Pagination */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(139, 26, 74, 0.08);
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--dark-charcoal);
  opacity: 0.7;
}

.pagination-info strong {
  font-weight: 700;
}

.pagination-controls .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.pagination-controls .btn.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

/* Empty State */
.history-list .empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
}

.history-list .empty-icon {
  margin-bottom: 1.5rem;
}

.history-list .empty-title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--deep-crimson);
  margin-bottom: 0.5rem;
}

.history-list .empty-description {
  font-size: 1rem;
  color: var(--dark-charcoal);
  opacity: 0.7;
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.history-list .empty-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .history-search-input {
  background: var(--surface);
  color: var(--tx-primary);
  border-color: var(--border);
}

html[data-theme="dark"] .history-search-input::placeholder {
  color: var(--tx-muted);
}

html[data-theme="dark"] .history-search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

html[data-theme="dark"] .search-input-wrapper .search-icon,
html[data-theme="dark"] .search-clear {
  color: var(--tx-muted);
}

html[data-theme="dark"] .search-clear:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .history-tabs {
  background: rgba(212, 168, 67, 0.08);
}

html[data-theme="dark"] .history-tab {
  color: var(--tx-secondary);
}

html[data-theme="dark"] .history-tab:hover {
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold-light);
}

html[data-theme="dark"] .history-tab.active {
  background: var(--color-surface);
  color: var(--gold-light);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .history-results-summary {
  color: var(--tx-secondary);
}

html[data-theme="dark"] .history-card {
  background: var(--color-surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .history-card:hover {
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .lang-badge.source {
  background: rgba(139, 26, 74, 0.2);
}

html[data-theme="dark"] .lang-badge.target {
  background: rgba(212, 168, 67, 0.2);
  color: var(--gold-light);
}

html[data-theme="dark"] .history-timestamp {
  color: var(--tx-muted);
}

html[data-theme="dark"] .text-label {
  color: var(--tx-muted);
}

html[data-theme="dark"] .text-content {
  color: var(--tx-primary);
}

html[data-theme="dark"] .history-action-btn {
  color: var(--tx-muted);
}

html[data-theme="dark"] .history-action-btn:hover {
  background: rgba(212, 168, 67, 0.1);
  color: var(--tx-primary);
}

html[data-theme="dark"] .history-action-btn.copy-btn.copied {
  color: var(--teal-light);
}

html[data-theme="dark"] .history-card-actions {
  border-top-color: var(--border);
}

html[data-theme="dark"] .pagination-controls {
  border-top-color: var(--border);
}

html[data-theme="dark"] .pagination-info {
  color: var(--tx-secondary);
}

html[data-theme="dark"] .history-list .empty-state {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .history-list .empty-title {
  color: var(--gold-light);
}

html[data-theme="dark"] .history-list .empty-description {
  color: var(--tx-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .history-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .history-search-form {
    max-width: none;
  }

  .history-tabs {
    align-self: flex-start;
  }

  .history-text-pair {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .history-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .history-card {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .history-title-row .page-title {
    font-size: 1.5rem;
  }

  .pagination-controls {
    gap: 0.5rem;
  }
}
/* ==========================================================================
   Token Wallet Page Styles
   ========================================================================== */

.wallet-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Balance Card */
.wallet-balance-card {
  background: linear-gradient(135deg, var(--deep-crimson) 0%, var(--rich-purple) 100%);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  color: white;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 20px rgba(139, 26, 74, 0.3);
}

.balance-main {
  text-align: center;
  margin-bottom: 2rem;
}

.balance-label {
  font-size: 0.9rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.balance-amount {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.balance-unit {
  font-size: 1.5rem;
  font-weight: 600;
  opacity: 0.8;
}

.balance-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.balance-stat {
  text-align: center;
}

.balance-stat .stat-label {
  font-size: 0.8rem;
  opacity: 0.8;
  display: block;
  margin-bottom: 0.25rem;
}

.balance-stat .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.balance-stat .stat-value.earned { color: var(--warm-gold); }
.balance-stat .stat-value.spent { color: rgba(255, 255, 255, 0.7); }

/* Sections */
.wallet-section {
  margin-bottom: 2.5rem;
}

.wallet-section .section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

/* Earn Grid */
.earn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.earn-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .earn-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  }
}

.earn-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

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

.earn-content p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Transactions */
.transactions-list {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.transaction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

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

.transaction-description {
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.transaction-date {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.transaction-amount {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.transaction-amount.positive { color: var(--teal-green); }
.transaction-amount.negative { color: var(--deep-crimson); }

/* Redemptions */
.redemptions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.redemption-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--teal-green);
}

.redemption-name {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.redemption-expiry {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.redemption-status.active {
  background: var(--teal-green);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Empty State */
.wallet-page .empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.wallet-page .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.wallet-page .empty-title { font-weight: 700; margin-bottom: 0.5rem; color: var(--color-text); }
.wallet-page .empty-description { color: var(--color-text-secondary); margin-bottom: 1.5rem; }

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

html[data-theme="dark"] .earn-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .earn-card:hover {
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .transactions-list {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .transaction-row {
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .transaction-amount.positive {
  color: var(--teal-light);
}

html[data-theme="dark"] .redemption-card {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .wallet-page .empty-state {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

/* Responsive */
@media (max-width: 600px) {
  .balance-amount { font-size: 2.5rem; }
  .balance-stats { gap: 1.5rem; }
  .earn-grid { grid-template-columns: 1fr; }
}
/*
 * Sobolo AI — Master Stylesheet
 *
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *


 */

/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Brand colors — Sobolo v2 "Warm & Cultural" */
  --crimson:        #8B1A4A;
  --crimson-mid:    #A8365F;
  --crimson-dark:   #6A1238;
  --crimson-pale:   #FDE8F0;
  --gold:           #D4A843;
  --gold-light:     #E8C76A;
  --gold-pale:      #FBF0D0;
  --gold-deep:      #B8902C;
  --purple:         #5B2C6F;
  --purple-light:   #7B4F8A;
  --purple-pale:    #F0E6F6;
  --teal:           #1A7A6D;
  --teal-light:     #2A9A8D;
  --teal-pale:      #E0F4F1;
  --terracotta:     #C4622D;
  --terracotta-lt:  #E07A45;
  --forest:         #2D5016;
  --charcoal:       #1A1A2E;
  --ink:            #1A0A12;

  /* Backgrounds — ivory warmth, never cold white */
  --ivory:          #FFF8F0;
  --ivory-deep:     #F5ECD7;
  --sand:           #EFE2C4;
  --surface:        #FFFDF9;
  --surface-warm:   #FEF9F0;
  --white:          #FFFFFF;

  /* Text */
  --tx-primary:     #1A0A12;
  --tx-secondary:   #5A3D40;
  --tx-muted:       #8A7070;
  --tx-on-dark:     rgba(255,255,255,0.94);
  --tx-on-dark-dim: rgba(255,255,255,0.62);

  /* Borders */
  --border:         rgba(139,26,74,0.13);
  --border-gold:    rgba(212,168,67,0.32);
  --border-warm:    #E2CCA8;

  /* Shadows — golden-crimson tinted */
  --sh-xs:   0 1px 4px rgba(139,26,74,0.07);
  --sh-sm:   0 2px 10px rgba(139,26,74,0.09);
  --sh-md:   0 6px 20px rgba(139,26,74,0.13);
  --sh-lg:   0 12px 40px rgba(139,26,74,0.18);
  --sh-gold: 0 6px 24px rgba(212,168,67,0.28);
  --sh-glow: 0 0 48px rgba(212,168,67,0.22);

  /* Radii */
  --r-xs:   0.375rem;
  --r-sm:   0.625rem;
  --r-md:   0.9rem;
  --r-lg:   1.25rem;
  --r-xl:   1.75rem;
  --r-2xl:  2.5rem;
  --r-full: 9999px;

  /* Typography — Fraunces (display) + Plus Jakarta Sans (body) */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Backwards-compat aliases */
  --deep-crimson: var(--crimson);
  --warm-gold:    var(--gold);
  --rich-purple:  var(--purple);
  --teal-green:   var(--teal);
  --dark-charcoal: var(--charcoal);
  --soft-cream:   var(--ivory);
  --crimson-light: var(--crimson-mid);
  --font-sans: var(--font-body);
  --font-serif: var(--font-display);
  --font-heading: var(--font-display);
  --heading-weight: 800;
  --heading-letter-spacing: -0.015em;

  /* Semantic state colors */
  --error: var(--crimson);
  --error-light: var(--crimson-pale);
  --error-border: var(--crimson-mid);
  --success: var(--teal);
  --success-light: var(--teal-pale);
  --success-border: var(--teal-light);
  --warning: var(--gold);
  --warning-light: var(--gold-pale);
  --warning-border: var(--gold-light);
  --info: var(--purple);
  --info-light: var(--purple-pale);
  --info-border: var(--purple-light);

  /* Semantic surface aliases (for existing CSS that uses --color-* tokens) */
  --background: var(--ivory);
  --text-primary: var(--tx-primary);
  --text-secondary: var(--tx-secondary);
  --text-muted: var(--tx-muted);
  --border-light: rgba(139,26,74,0.07);
  --color-bg: var(--ivory);
  --color-surface: var(--white);
  --color-surface-raised: var(--white);
  --color-text-primary: var(--tx-primary);
  --color-text-secondary: var(--tx-secondary);
  --color-text-muted: var(--tx-muted);
  --color-text: var(--tx-primary);
  --color-border: var(--border);
  --color-border-light: var(--border-light);

  /* Motion */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadow aliases */
  --shadow-sm: var(--sh-sm);
  --shadow-md: var(--sh-md);
  --shadow-lg: var(--sh-lg);
  --shadow-xl: var(--sh-lg);

  /* Radius aliases */
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-xl: var(--r-xl);
  --radius-full: var(--r-full);
}

/* ==========================================================================
   1b. Kente & Adinkra Pattern Utilities
   ========================================================================== */

/* Kente strip — horizontal repeating color bands */
.kente-strip {
  height: 7px;
  width: 100%;
  flex-shrink: 0;
  background: repeating-linear-gradient(90deg,
    #8B1A4A 0px, #8B1A4A 18px,
    #D4A843 18px, #D4A843 36px,
    #1A7A6D 36px, #1A7A6D 50px,
    #5B2C6F 50px, #5B2C6F 64px,
    #C4622D 64px, #C4622D 78px,
    #D4A843 78px, #D4A843 92px,
    #2D5016 92px, #2D5016 106px,
    #8B1A4A 106px, #8B1A4A 120px
  );
}

/* Adinkra diamond grid — SVG data-URI texture */
.adinkra-tex {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M32 4 L60 32 L32 60 L4 32 Z' fill='none' stroke='rgba(212%2C168%2C67%2C0.1)' stroke-width='1'/%3E%3Cpath d='M32 18 L46 32 L32 46 L18 32 Z' fill='none' stroke='rgba(139%2C26%2C74%2C0.07)' stroke-width='0.75'/%3E%3Ccircle cx='32' cy='32' r='2.5' fill='none' stroke='rgba(212%2C168%2C67%2C0.12)' stroke-width='0.75'/%3E%3C/svg%3E");
  background-size: 64px 64px;
}

/* Kente checker — small 4-color checker for card accents */
.kente-checker {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect width='8' height='8' x='0' y='0' fill='rgba(139%2C26%2C74%2C0.08)'/%3E%3Crect width='8' height='8' x='8' y='0' fill='rgba(212%2C168%2C67%2C0.09)'/%3E%3Crect width='8' height='8' x='16' y='0' fill='rgba(26%2C122%2C109%2C0.07)'/%3E%3Crect width='8' height='8' x='24' y='0' fill='rgba(91%2C44%2C111%2C0.07)'/%3E%3C/svg%3E");
  background-size: 32px 32px;
}

/* ==========================================================================
   1b. Keyframes & Animation Utilities
   ========================================================================== */

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

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

@media (prefers-reduced-motion: no-preference) {
  .animate-fade-up {
    animation: fadeUp 0.6s var(--ease-spring) both;
  }
  .animate-delay-1 { animation-delay: 0.08s; }
  .animate-delay-2 { animation-delay: 0.16s; }
  .animate-delay-3 { animation-delay: 0.24s; }
  .animate-delay-4 { animation-delay: 0.32s; }
  .animate-delay-5 { animation-delay: 0.40s; }
  .animate-delay-6 { animation-delay: 0.48s; }
}

/* ==========================================================================
   1c. Button Hierarchy (Large CTA)
   ========================================================================== */

.btn-primary-lg,
.btn-secondary-lg,
.btn-tertiary-lg,
.btn-ghost-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  border: none;
}

.btn-primary-lg {
  background: var(--gold);
  color: var(--ink);
}

.btn-primary-lg:hover {
  background: var(--gold-deep);
  transform: translateY(-1px);
  box-shadow: var(--sh-gold);
}

.btn-secondary-lg {
  background: var(--crimson);
  color: #FFFFFF;
  border: none;
}

.btn-secondary-lg:hover {
  background: var(--crimson-dark);
  box-shadow: var(--sh-md);
  transform: translateY(-1px);
}

.btn-tertiary-lg {
  background: transparent;
  color: var(--crimson);
  border: 2px solid var(--crimson);
}

.btn-tertiary-lg:hover {
  background: var(--crimson);
  color: #FFFFFF;
}

.btn-ghost-lg {
  background: transparent;
  color: var(--tx-secondary);
}

.btn-ghost-lg:hover {
  color: var(--crimson);
  background: var(--crimson-pale);
}

/* ==========================================================================
   2. Reset & Foundation
   ========================================================================== */

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

/* Headings use display serif (Fraunces) */
h1, h2, h3, h4, h5, h6,
.font-display,
.hero-title,
.page-title,
.section-title,
.auth-title,
.brand-text,
.logo-text {
  font-family: var(--font-display);
  line-height: 1.18;
  letter-spacing: -0.015em;
}

body {
  font-family: var(--font-body);
  color: var(--tx-primary);
  background-color: var(--ivory);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.auth-page {
  background: linear-gradient(135deg, var(--crimson-dark) 0%, var(--charcoal) 50%, var(--purple) 100%);
  min-height: 100vh;
}

.auth-alert {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease-out;
}

.auth-alert-success {
  background: var(--color-surface);
  color: var(--teal-green);
  border: 1px solid var(--teal-green);
}

.auth-alert-error {
  background: var(--color-surface);
  color: var(--deep-crimson);
  border: 1px solid var(--deep-crimson);
}

/* ==========================================================================
   2b. Accessibility Utilities
   ========================================================================== */

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--deep-crimson);
  color: white;
  padding: 8px 16px;
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top 0.2s;
}

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

/* Fieldset reset for accessible radio/checkbox groups */
.form-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

/* Inline error messages for form fields */
.form-error-message {
  display: block;
  color: var(--deep-crimson);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Focus indicators — WCAG 2.4.7 */
:focus-visible {
  outline: 2px solid var(--deep-crimson);
  outline-offset: 2px;
}

/* Buttons and interactive elements with custom focus */
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-outline:focus-visible,
.btn-icon:focus-visible {
  outline: 2px solid var(--deep-crimson);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(139, 26, 74, 0.15);
}

.nav-link:focus-visible {
  outline: 2px solid var(--deep-crimson);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Form inputs focus */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--deep-crimson);
  outline-offset: 1px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================================================================
   3. Header / Navigation
   ========================================================================== */

.navbar {
  display: flex;
  flex-direction: column;
  background: var(--ivory);
  border-bottom: 1px solid var(--border-warm);
  box-shadow: var(--sh-xs);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar::before, .header::before {
  content: '';
  display: block;
  height: 5px;
  background: repeating-linear-gradient(90deg,
    #8B1A4A 0px, #8B1A4A 18px,
    #D4A843 18px, #D4A843 36px,
    #1A7A6D 36px, #1A7A6D 50px,
    #5B2C6F 50px, #5B2C6F 64px,
    #C4622D 64px, #C4622D 78px,
    #D4A843 78px, #D4A843 92px
  );
}

.navbar > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.navbar-brand {
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--deep-crimson);
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--deep-crimson);
  letter-spacing: -0.02em;
}

.brand-ai {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--warm-gold);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
  justify-content: flex-end;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-left: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.65rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--crimson);
  background: var(--crimson-pale);
  border-bottom-color: transparent;
  border-radius: var(--r-sm);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Legacy class aliases */
.header {
  background: var(--ivory);
  box-shadow: 0 1px 0 var(--border-warm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--deep-crimson);
  flex-shrink: 0;
  gap: 0.4rem;
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-icon-svg {
  width: 28px;
  height: 28px;
  vertical-align: middle;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-menu {
  display: flex;
  gap: 1rem;
}

.user-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
}

.user-link:hover {
  color: var(--deep-crimson);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  padding: 0.5rem;
  gap: 0.25rem;
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 1.5rem;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s;
}

/* ==========================================================================
   4. Footer
   ========================================================================== */

.footer {
  background: var(--ink);
  color: var(--tx-on-dark-dim);
  padding: 3rem 0 0;
  position: relative;
  margin-top: 0;
}

.footer::before {
  content: '';
  display: block;
  height: 6px;
  background: repeating-linear-gradient(90deg,
    #8B1A4A 0px, #8B1A4A 20px,
    #D4A843 20px, #D4A843 40px,
    #1A7A6D 40px, #1A7A6D 58px,
    #5B2C6F 58px, #5B2C6F 74px,
    #C4622D 74px, #C4622D 90px,
    #D4A843 90px, #D4A843 106px
  );
  position: absolute;
  top: 0; left: 0; right: 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem 0;
}

.footer-brand {
  flex: 1;
}

.footer-brand h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.87);
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 3rem;
  flex-shrink: 0;
}

.footer-column h5 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.95);
}

.footer-column a {
  display: block;
  color: rgba(255, 255, 255, 0.87);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: var(--warm-gold);
}

.footer-brand .logo {
  color: var(--white);
  margin-bottom: 1rem;
}

.tagline {
  color: var(--warm-gold);
  font-style: italic;
  margin: 0.5rem 0;
}

.footer .description {
  color: rgba(255, 255, 255, 0.87);
  line-height: 1.6;
}

.link-group h4 {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.link-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link-group li {
  margin-bottom: 0.5rem;
}

.link-group a {
  color: rgba(255, 255, 255, 0.87);
  text-decoration: none;
  transition: color 0.2s;
}

.link-group a:hover {
  color: var(--warm-gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.social-link:hover {
  color: var(--warm-gold);
}

/* ==========================================================================
   5. Main Content Area
   ========================================================================== */

.main-content {
  min-height: calc(100vh - 400px);
}

/* ==========================================================================
   6. Buttons
   ========================================================================== */

.btn,
.btn-primary,
.btn-secondary {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--gold);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--gold-deep);
  transform: translateY(-1px);
  box-shadow: var(--sh-gold);
}

.btn-secondary {
  background: var(--crimson);
  color: white;
  border: none;
}

.btn-secondary:hover {
  background: var(--crimson-dark);
  box-shadow: var(--sh-md);
  transform: translateY(-1px);
}

/* Override for .btn-secondary on dark gradient backgrounds */
.hero-gradient .btn-secondary,
.cta-section .btn-secondary,
.page-hero .btn-secondary,
.contribute-hero .btn-secondary,
.learn-hero .btn-secondary,
.phrasebook-hero .btn-secondary {
  color: white;
  border-color: rgba(255, 255, 255, 0.87);
  background: transparent;
}

.hero-gradient .btn-secondary:hover,
.cta-section .btn-secondary:hover,
.page-hero .btn-secondary:hover,
.contribute-hero .btn-secondary:hover,
.learn-hero .btn-secondary:hover,
.phrasebook-hero .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
  color: white;
}

.btn-outline {
  border: 2px solid var(--crimson);
  color: var(--crimson);
  padding: 0.5rem 1rem;
  border-radius: var(--r-md);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.btn-outline:hover {
  background: var(--crimson);
  color: white;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-full-width {
  width: 100%;
  justify-content: center;
}

.btn-disabled {
  background: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
}

.btn-premium {
  display: inline-block;
  background: linear-gradient(135deg, var(--deep-crimson), var(--rich-purple));
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  margin: 1rem 0;
  transition: transform 0.2s;
}

.btn-premium:hover {
  transform: translateY(-2px);
}

.btn-arrow {
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--surface-warm);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.btn-icon:hover {
  background: var(--gold-pale);
  box-shadow: var(--sh-xs);
}


/* ==========================================================================
   7. Alerts / Flash Messages
   ========================================================================== */

.alert {
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 16px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background: rgba(45, 125, 91, 0.1);
  color: var(--teal-green);
  border: 1px solid var(--teal-light);
}

.alert-error {
  background: rgba(139, 26, 74, 0.1);
  color: var(--deep-crimson);
  border: 1px solid var(--crimson-light);
}

/* ==========================================================================
   8. Shared Section Patterns
   ========================================================================== */

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-letter-spacing);
  color: var(--color-text-primary);
  margin-bottom: 2rem;
  text-align: center;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header .section-title {
  margin-bottom: 0;
  text-align: left;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.view-link,
.view-all-link {
  color: var(--warm-gold);
  text-decoration: none;
  font-weight: 500;
}

.view-link:hover,
.view-all-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   9. Page Container Pattern
   ========================================================================== */

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ==========================================================================
   10. Hero Section Pattern
   ========================================================================== */

.page-hero {
  text-align: center;
  margin-bottom: 4rem;
  padding: 3rem 1rem;
  border-radius: var(--radius-lg);
  color: white;
}

.page-hero .hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-letter-spacing);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.hero-symbol {
  font-size: 3rem;
}

.page-hero .hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

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

/* ==========================================================================
   11. Card Patterns
   ========================================================================== */

.card {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-warm);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
}

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

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

/* Feature Cards (used in Learn, Phrasebook, Contribute) */
.features-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature-card {
  background: var(--color-surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

.feature-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   12. CTA Section Pattern (used in Learn, Phrasebook, Contribute)
   ========================================================================== */

.cta-section {
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  color: white;
}

.cta-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-letter-spacing);
  margin-bottom: 1rem;
}

.cta-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-buttons .btn {
  min-width: 150px;
}

/* ==========================================================================
   13. Empty State Pattern
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

.empty-description {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.empty-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ==========================================================================
   14. Progress Bar Pattern
   ========================================================================== */

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-green), var(--warm-gold));
  transition: width 0.3s ease;
}

/* ==========================================================================
   15. Stat Patterns
   ========================================================================== */

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--deep-crimson);
  display: block;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   16. Badge Patterns
   ========================================================================== */

.language-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
  background: var(--teal-green);
  color: white;
}

.category-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
  background: var(--warm-gold);
  color: white;
}

/* ==========================================================================
   17. Back Link Pattern
   ========================================================================== */

.back-link {
  color: var(--deep-crimson);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 1rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   18. Gradient Helpers
   ========================================================================== */

.hero-gradient {
  background: linear-gradient(135deg, var(--deep-crimson), var(--rich-purple));
}

.text-gradient {
  background: linear-gradient(135deg, var(--deep-crimson), var(--rich-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   19. Animations
   ========================================================================== */

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.1) rotate(10deg); opacity: 0.8; }
}

@keyframes flip {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

/* ==========================================================================
   20. Responsive — Global
   ========================================================================== */

@media (max-width: 768px) {
  .navbar > .container {
    flex-wrap: wrap;
  }

  .navbar-nav {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
    width: 100%;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .nav-auth {
    gap: 0.5rem;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-actions .btn-secondary {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .empty-actions {
    flex-direction: column;
    align-items: center;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ==========================================================================
   DARK MODE — html[data-theme="dark"]
   Warm-ink blacks, full brand chroma preserved. Gold/crimson/teal stay vivid.
   ========================================================================== */

/* ── Dark mode toggle button ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: rgba(212,168,67,0.1);
  border: 1px solid rgba(212,168,67,0.25);
  border-radius: var(--r-full);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.03em;
  transition: background 0.2s, border-color 0.2s;
}
.theme-toggle:hover { background: rgba(212,168,67,0.2); border-color: rgba(212,168,67,0.45); }
.theme-toggle .theme-icon { font-size: 1rem; line-height: 1; }

/* ── Token overrides ── */
html[data-theme="dark"] {
  --ivory:          #0D0810;
  --ivory-deep:     #130C16;
  --sand:           #1C1120;
  --surface:        #17101A;
  --surface-warm:   #1E1422;
  --white:          #1E1422;
  --background:     #0D0810;

  --tx-primary:      rgba(255, 248, 240, 0.96);
  --tx-secondary:    rgba(255, 230, 200, 0.70);
  --tx-muted:        rgba(255, 210, 180, 0.45);
  --text-primary:    rgba(255, 248, 240, 0.96);
  --text-secondary:  rgba(255, 230, 200, 0.70);
  --text-muted:      rgba(255, 210, 180, 0.45);

  --border:         rgba(212, 168, 67, 0.14);
  --border-light:   rgba(255, 255, 255, 0.05);
  --border-gold:    rgba(212, 168, 67, 0.22);
  --border-warm:    rgba(255, 255, 255, 0.09);

  --crimson-pale:   rgba(139, 26, 74,  0.28);
  --gold-pale:      rgba(212, 168, 67, 0.18);
  --teal-pale:      rgba(26,  122, 109, 0.22);
  --purple-pale:    rgba(91,  44,  111, 0.25);

  --sh-xs:   0 1px 4px  rgba(0,0,0,0.4);
  --sh-sm:   0 2px 10px rgba(0,0,0,0.45);
  --sh-md:   0 6px 22px rgba(0,0,0,0.55);
  --sh-lg:   0 12px 40px rgba(0,0,0,0.65);
  --sh-gold: 0 6px 24px rgba(212,168,67,0.22);
  --sh-glow: 0 0 48px  rgba(212,168,67,0.18);

  --color-bg: var(--ivory);
  --color-surface: var(--white);
  --color-surface-raised: var(--white);
  --color-text-primary: var(--tx-primary);
  --color-text-secondary: var(--tx-secondary);
  --color-text-muted: var(--tx-muted);
  --color-text: var(--tx-primary);
  --color-text: var(--tx-primary);
  --color-border: var(--border);
  --color-border-light: var(--border-light);
}

/* ── Foundation ── */
html[data-theme="dark"] body {
  background: var(--ivory);
  color: var(--tx-primary);
}

/* ── Navigation ── */
html[data-theme="dark"] .header,
html[data-theme="dark"] nav.container,
html[data-theme="dark"] .navbar {
  background: #13090F;
  border-bottom-color: rgba(212,168,67,0.14);
  box-shadow: 0 1px 0 rgba(212,168,67,0.1);
}

html[data-theme="dark"] .logo-text {
  color: var(--gold-light);
}

html[data-theme="dark"] .nav-link {
  color: rgba(255,240,220,0.65);
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link.active {
  color: var(--gold-light);
  background: rgba(212,168,67,0.1);
}

html[data-theme="dark"] .user-link {
  color: rgba(255,240,220,0.65);
}

html[data-theme="dark"] .user-link:hover {
  color: var(--gold-light);
  background: rgba(212,168,67,0.1);
}

html[data-theme="dark"] .mobile-menu-toggle span {
  background: var(--gold);
}

/* ── Cards ── */
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-warm {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--sh-sm);
}

html[data-theme="dark"] .card:hover {
  box-shadow: var(--sh-md);
  border-color: var(--border-gold);
}

html[data-theme="dark"] .language-card {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .language-card:hover {
  border-color: var(--gold);
}

html[data-theme="dark"] .language-name { color: var(--tx-primary); }
html[data-theme="dark"] .language-native { color: var(--tx-muted); }

/* Lesson cards */
html[data-theme="dark"] .lesson-card {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .lesson-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--sh-sm);
}

html[data-theme="dark"] .lesson-card.lesson-completed {
  background: rgba(26,122,109,0.08);
  border-color: rgba(26,122,109,0.25);
}

html[data-theme="dark"] .lesson-card.lesson-locked {
  background: rgba(255,255,255,0.03);
  opacity: 0.55;
}

html[data-theme="dark"] .lesson-title { color: var(--tx-primary); }
html[data-theme="dark"] .lesson-description,
html[data-theme="dark"] .lesson-meta { color: var(--tx-muted); }

/* Unit containers */
html[data-theme="dark"] .unit-container {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .unit-header {
  background: var(--surface-warm);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .unit-number { color: var(--tx-muted); }
html[data-theme="dark"] .unit-name { color: var(--tx-primary); }
html[data-theme="dark"] .unit-progress-text { color: var(--tx-muted); }

html[data-theme="dark"] .unit-progress-bar {
  background: rgba(255,255,255,0.08);
}

/* Phrase cards */
html[data-theme="dark"] .phrase-card {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .phrase-card:hover { border-color: var(--border-gold); }
html[data-theme="dark"] .phrase-text { color: var(--tx-primary); }
html[data-theme="dark"] .phrase-translation,
html[data-theme="dark"] .phrase-romanization,
html[data-theme="dark"] .phrase-phonetic { color: var(--tx-muted); }

/* Feature cards */
html[data-theme="dark"] .feature-card {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .feature-title { color: var(--tx-primary); }
html[data-theme="dark"] .feature-description { color: var(--tx-secondary); }

/* Stat cards */
html[data-theme="dark"] .stat-card {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .stat-card .stat-value { color: var(--tx-primary); }
html[data-theme="dark"] .stat-card .stat-label { color: var(--tx-muted); }

/* Contribution cards */
html[data-theme="dark"] .contribution-card,
html[data-theme="dark"] .recent-contribution {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .contribution-text,
html[data-theme="dark"] .contribution-translation { color: var(--tx-primary); }

html[data-theme="dark"] .contribution-meta,
html[data-theme="dark"] .contributor-info { color: var(--tx-muted); }

/* Category cards */
html[data-theme="dark"] .category-card,
html[data-theme="dark"] .contribution-category {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .category-card:hover { border-color: var(--border-gold); }

html[data-theme="dark"] .category-name,
html[data-theme="dark"] .category-title { color: var(--tx-primary); }

html[data-theme="dark"] .category-count,
html[data-theme="dark"] .category-description { color: var(--tx-muted); }

/* Achievement cards */
html[data-theme="dark"] .achievement-card {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .achievement-title { color: var(--tx-primary); }
html[data-theme="dark"] .achievement-description { color: var(--tx-secondary); }

/* Activity items */
html[data-theme="dark"] .activity-item {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .activity-text { color: var(--tx-primary); }
html[data-theme="dark"] .activity-time { color: var(--tx-muted); }

/* Challenge / daily cards */
html[data-theme="dark"] .challenge-card {
  background: linear-gradient(135deg, #5A0D2E 0%, #3A0E4A 100%);
}

html[data-theme="dark"] .daily-card,
html[data-theme="dark"] .challenge-option {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .challenge-option:hover { border-color: var(--gold); }

html[data-theme="dark"] .challenge-option.selected {
  background: rgba(212,168,67,0.12);
  border-color: var(--gold);
}

/* Timeline / progress */
html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .challenge-timeline-item {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .timeline-label { color: var(--tx-secondary); }
html[data-theme="dark"] .timeline-score { color: var(--tx-primary); }

/* Quick actions */
html[data-theme="dark"] .quick-action,
html[data-theme="dark"] .quick-action-card,
html[data-theme="dark"] .action-card {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .quick-action:hover,
html[data-theme="dark"] .quick-action-card:hover { border-color: var(--border-gold); }

/* ── Forms ── */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: var(--surface-warm);
  border-color: rgba(255,255,255,0.1);
  color: var(--tx-primary);
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.18);
  background: var(--surface);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--tx-muted); }

html[data-theme="dark"] label { color: var(--tx-secondary); }
html[data-theme="dark"] .form-hint { color: var(--tx-muted); }

html[data-theme="dark"] .language-select {
  background: var(--surface-warm);
  border-color: rgba(212,168,67,0.25);
  color: var(--gold-light);
}

/* ── Translate page ── */
html[data-theme="dark"] .translate-section,
html[data-theme="dark"] .translate-container { background: var(--ivory); }

html[data-theme="dark"] .translate-panel,
html[data-theme="dark"] .translate-input-panel,
html[data-theme="dark"] .translate-output-panel,
html[data-theme="dark"] .translate-inputs,
html[data-theme="dark"] .translate-box {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .translate-header,
html[data-theme="dark"] .translate-panel-header {
  background: var(--surface-warm);
  border-bottom-color: var(--border);
  color: var(--tx-secondary);
}

html[data-theme="dark"] .translate-text-input,
html[data-theme="dark"] .translate-output-text,
html[data-theme="dark"] .translate-textarea {
  background: var(--surface);
  color: var(--tx-primary);
  border-color: transparent;
}

html[data-theme="dark"] .swap-btn,
html[data-theme="dark"] .swap-button {
  background: var(--surface-warm);
  border-color: var(--border-gold);
  color: var(--gold);
}

html[data-theme="dark"] .swap-btn:hover { background: rgba(212,168,67,0.12); }

html[data-theme="dark"] .translate-actions { border-top-color: var(--border); }

html[data-theme="dark"] .translate-action-btn { color: var(--tx-muted); }
html[data-theme="dark"] .translate-action-btn:hover {
  color: var(--gold);
  background: rgba(212,168,67,0.1);
}

html[data-theme="dark"] .insight-card,
html[data-theme="dark"] .cultural-insight {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .insight-title,
html[data-theme="dark"] .insight-heading { color: var(--gold-light); }

html[data-theme="dark"] .insight-text,
html[data-theme="dark"] .insight-body { color: var(--tx-secondary); }

html[data-theme="dark"] .history-item {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .history-item:hover { border-color: var(--border-gold); }

html[data-theme="dark"] .history-source,
html[data-theme="dark"] .history-target { color: var(--tx-primary); }

html[data-theme="dark"] .history-time,
html[data-theme="dark"] .history-lang { color: var(--tx-muted); }

/* ── Hero sections (already dark — deepen) ── */
html[data-theme="dark"] .hero {
  background: linear-gradient(145deg, #3D0820 0%, #1A0A2E 55%, #0A0F20 100%);
}

html[data-theme="dark"] .cta-section {
  background: linear-gradient(135deg, #3D0820 0%, #251040 100%);
}

html[data-theme="dark"] .learn-hero {
  background: linear-gradient(135deg, #3D0820 0%, #1E1040 100%);
}

html[data-theme="dark"] .contribute-hero {
  background: linear-gradient(135deg, #251040 0%, #0A1A20 100%);
}

html[data-theme="dark"] .phrasebook-hero {
  background: linear-gradient(135deg, #3D0820 0%, #251040 100%);
}

html[data-theme="dark"] .learn-show-container .language-header {
  background: linear-gradient(135deg, #4A0E28 0%, #2A1050 100%);
}

/* ── Profile page ── */
html[data-theme="dark"] .profile-header {
  background: linear-gradient(135deg, #3D0820 0%, #251040 100%);
}

html[data-theme="dark"] .profile-section,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .profile-grid > * {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .profile-name { color: var(--tx-primary); }
html[data-theme="dark"] .profile-bio  { color: var(--tx-secondary); }
html[data-theme="dark"] .profile-meta { color: var(--tx-muted); }

html[data-theme="dark"] .subscription-card,
html[data-theme="dark"] .subscription-info {
  background: var(--surface);
  border-color: var(--border-gold);
}

/* ── Daily challenge ── */
html[data-theme="dark"] .daily-container,
html[data-theme="dark"] .daily-section { background: var(--ivory); }

html[data-theme="dark"] .streak-display {
  background: linear-gradient(135deg, #4A0E28 0%, #2A1050 100%);
}

html[data-theme="dark"] .daily-stats-grid .stat-card { background: var(--surface); }

/* ── Learn index ── */
html[data-theme="dark"] .learn-section,
html[data-theme="dark"] .learn-container { background: var(--ivory); }

html[data-theme="dark"] .language-card .language-info,
html[data-theme="dark"] .language-card .language-stats { border-color: var(--border); }

html[data-theme="dark"] .progress-bar { background: rgba(255,255,255,0.08); }

/* ── Phrasebook ── */
html[data-theme="dark"] .phrasebook-header {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .phrasebook-container,
html[data-theme="dark"] .phrasebook-section { background: var(--ivory); }

html[data-theme="dark"] .phrasebook-header .back-link { color: var(--gold-light); }

/* ── Badges — dark glass variants ── */
html[data-theme="dark"] .badge-crimson {
  background: rgba(139,26,74,0.3);
  color: #F5A0BE;
}

html[data-theme="dark"] .badge-gold {
  background: rgba(212,168,67,0.2);
  color: var(--gold-light);
}

html[data-theme="dark"] .badge-teal {
  background: rgba(26,122,109,0.25);
  color: #5DD4C8;
}

html[data-theme="dark"] .badge-purple {
  background: rgba(91,44,111,0.3);
  color: #C59AE0;
}

html[data-theme="dark"] .badge-terra {
  background: rgba(196,98,45,0.25);
  color: #F5A070;
}

html[data-theme="dark"] .status-pending {
  background: rgba(212,168,67,0.2);
  color: var(--gold-light);
}

html[data-theme="dark"] .status-approved {
  background: rgba(26,122,109,0.25);
  color: #5DD4C8;
}

html[data-theme="dark"] .status-rejected {
  background: rgba(139,26,74,0.3);
  color: #F5A0BE;
}

html[data-theme="dark"] .difficulty-beginner {
  background: rgba(26,122,109,0.25);
  color: #5DD4C8;
}

html[data-theme="dark"] .difficulty-intermediate {
  background: rgba(212,168,67,0.2);
  color: var(--gold-light);
}

html[data-theme="dark"] .difficulty-advanced {
  background: rgba(139,26,74,0.3);
  color: #F5A0BE;
}

html[data-theme="dark"] .category-badge,
html[data-theme="dark"] .contribution-type {
  background: rgba(139,26,74,0.25);
  color: #F5A0BE;
}

html[data-theme="dark"] .contribution-lang {
  background: rgba(91,44,111,0.3);
  color: #C59AE0;
}

html[data-theme="dark"] .language-tag {
  background: rgba(91,44,111,0.3);
  color: #C59AE0;
}

html[data-theme="dark"] .featured-badge {
  background: rgba(212,168,67,0.2);
  color: var(--gold-light);
}

/* ── Buttons on dark ── */
html[data-theme="dark"] .btn-outline {
  color: var(--gold-light);
  border-color: rgba(212,168,67,0.5);
}

html[data-theme="dark"] .btn-outline:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

html[data-theme="dark"] .btn-icon {
  background: var(--surface-warm);
  border-color: var(--border);
  color: var(--tx-primary);
}

html[data-theme="dark"] .btn-icon:hover {
  background: rgba(212,168,67,0.12);
  border-color: var(--border-gold);
}

html[data-theme="dark"] .view-all-link,
html[data-theme="dark"] .view-link {
  color: var(--gold-light);
  border-color: rgba(212,168,67,0.25);
}

html[data-theme="dark"] .view-all-link:hover,
html[data-theme="dark"] .view-link:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

/* ── Typography on dark ── */
html[data-theme="dark"] .section-title { color: var(--tx-primary); }
html[data-theme="dark"] .section-description { color: var(--tx-secondary); }
html[data-theme="dark"] .section-subtitle { color: var(--tx-muted); }
html[data-theme="dark"] .card-title { color: var(--tx-primary); }
html[data-theme="dark"] .card-text { color: var(--tx-secondary); }
html[data-theme="dark"] .meta-text,
html[data-theme="dark"] .caption { color: var(--tx-muted); }
html[data-theme="dark"] h1, html[data-theme="dark"] h2,
html[data-theme="dark"] h3, html[data-theme="dark"] h4 {
  color: var(--tx-primary);
}

/* ── Misc components ── */
html[data-theme="dark"] .divider,
html[data-theme="dark"] hr { border-color: var(--border); }

html[data-theme="dark"] .live-translations-section,
html[data-theme="dark"] .live-translations {
  background: var(--ivory-deep);
  border-color: var(--border);
}

html[data-theme="dark"] .translation-item,
html[data-theme="dark"] .live-item {
  background: var(--surface);
  border-color: var(--border);
}

/* ── Adinkra texture (brighter strokes in dark) ── */
html[data-theme="dark"] .adinkra-tex {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M32 4 L60 32 L32 60 L4 32 Z' fill='none' stroke='rgba(212%2C168%2C67%2C0.18)' stroke-width='1'/%3E%3Cpath d='M32 18 L46 32 L32 46 L18 32 Z' fill='none' stroke='rgba(139%2C26%2C74%2C0.14)' stroke-width='0.75'/%3E%3Ccircle cx='32' cy='32' r='2.5' fill='none' stroke='rgba(212%2C168%2C67%2C0.22)' stroke-width='0.75'/%3E%3Ccircle cx='4' cy='4' r='1.5' fill='rgba(212%2C168%2C67%2C0.12)'/%3E%3Ccircle cx='60' cy='4' r='1.5' fill='rgba(212%2C168%2C67%2C0.12)'/%3E%3Ccircle cx='4' cy='60' r='1.5' fill='rgba(212%2C168%2C67%2C0.12)'/%3E%3Ccircle cx='60' cy='60' r='1.5' fill='rgba(212%2C168%2C67%2C0.12)'/%3E%3C/svg%3E");
}

/* ── Privacy & Terms (content pages) ── */
html[data-theme="dark"] .prose-section,
html[data-theme="dark"] .legal-content,
html[data-theme="dark"] .privacy-container,
html[data-theme="dark"] .terms-container {
  background: var(--ivory);
  color: var(--tx-primary);
}

html[data-theme="dark"] .legal-content h2,
html[data-theme="dark"] .legal-content h3 { color: var(--gold-light); }

html[data-theme="dark"] .legal-content p,
html[data-theme="dark"] .legal-content li { color: var(--tx-secondary); }

/* ── Footer in dark ── */
html[data-theme="dark"] .footer {
  background: #0A060D;
  border-top-color: rgba(212,168,67,0.14);
}

html[data-theme="dark"] .footer h4,
html[data-theme="dark"] .footer h5 { color: var(--gold-light); }

html[data-theme="dark"] .footer a { color: rgba(255,240,220,0.6); }
html[data-theme="dark"] .footer a:hover { color: var(--gold-light); }

/* ==========================================================================
   AUTO DARK MODE — prefers-color-scheme
   Mirrors html[data-theme="dark"] tokens for system-preference auto-detection.
   The JS toggle overrides this when the user explicitly picks a theme.
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --ivory:          #0D0810;
    --ivory-deep:     #130C16;
    --sand:           #1C1120;
    --surface:        #17101A;
    --surface-warm:   #1E1422;
    --white:          #1E1422;
    --background:     #0D0810;

    --tx-primary:      rgba(255, 248, 240, 0.96);
    --tx-secondary:    rgba(255, 230, 200, 0.70);
    --tx-muted:        rgba(255, 210, 180, 0.45);
    --text-primary:    rgba(255, 248, 240, 0.96);
    --text-secondary:  rgba(255, 230, 200, 0.70);
    --text-muted:      rgba(255, 210, 180, 0.45);

    --border:         rgba(212, 168, 67, 0.14);
    --border-light:   rgba(255, 255, 255, 0.05);
    --border-gold:    rgba(212, 168, 67, 0.22);
    --border-warm:    rgba(255, 255, 255, 0.09);

    --crimson-pale:   rgba(139, 26, 74,  0.28);
    --gold-pale:      rgba(212, 168, 67, 0.18);
    --teal-pale:      rgba(26,  122, 109, 0.22);
    --purple-pale:    rgba(91,  44,  111, 0.25);

    --sh-xs:   0 1px 4px  rgba(0,0,0,0.4);
    --sh-sm:   0 2px 10px rgba(0,0,0,0.45);
    --sh-md:   0 6px 22px rgba(0,0,0,0.55);
    --sh-lg:   0 12px 40px rgba(0,0,0,0.65);
    --sh-gold: 0 6px 24px rgba(212,168,67,0.22);
    --sh-glow: 0 0 48px  rgba(212,168,67,0.18);

    --color-bg: var(--ivory);
    --color-surface: var(--white);
    --color-surface-raised: var(--white);
    --color-text-primary: var(--tx-primary);
    --color-text-secondary: var(--tx-secondary);
    --color-text-muted: var(--tx-muted);
    --color-text: var(--tx-primary);
    --color-border: var(--border);
    --color-border-light: var(--border-light);
  }
}

/* ── Smooth dark mode transition ── */
html, body, .header, .navbar, .card, .language-card, .lesson-card,
.phrase-card, .feature-card, .stat-card, .achievement-card,
.activity-item, .auth-card, .insight-card, .history-item,
.unit-header, .unit-container, input, textarea, select, .badge, .footer,
.dashboard-section, .quick-action-card, .translation-item,
.translate-interface, .history-card, .history-tabs, .history-tab,
.activity-card, .option-btn, .listen-item,
.category-card, .phrase-card, .contribution-item, .featured-card,
.form-card, .form-input, .type-card, .text-block,
.context-section, .contribution-card, .step-card, .challenge-card,
.todays-challenge, .share-btn, .timeline-item, .user-stats,
.profile-header, .detailed-stats, .subscription-card, .plan-card,
.activity-feed, .action-card,
.podium-card, .ranked-list, .ranked-row, .language-chip,
.earn-card, .transactions-list, .transaction-row, .redemption-card,
.invite-form-section, .invites-list, .invite-row, .invitee-row,
.legal-content, .legal-address {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
