/* These styles are generated from project.scss. */

/* ─── Brand gradients (single source of truth, see .claude/skills/design-system.md) ─── */
:root {
  --ch-gradient-primary: linear-gradient(135deg, #667eea, #764ba2);
  --ch-gradient-secondary: linear-gradient(135deg, #4facfe, #00f2fe);
  --ch-gradient-success: linear-gradient(135deg, #84fab0, #8fd3f4);
  --ch-gradient-info: linear-gradient(135deg, #a8edea, #fed6e3);
  --ch-gradient-warning: linear-gradient(135deg, #f6d365, #fda085);
  --ch-gradient-danger: linear-gradient(135deg, #f093fb, #f5576c);
  --ch-gradient-btn: linear-gradient(135deg, #8a5ccb, #5a8dfc);
}

/* ─── Global base (Calihand v3) ─── */
* { box-sizing: border-box; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 3px; }
button { font-family: inherit; }
.sticky-top { top: 70px !important; }

/* Visible keyboard focus (accessibility requirement, never suppress) */
:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.alert-debug {
  color: black;
  background-color: white;
  border-color: #d6e9c6;
}

.alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

/* Общие стили для светлой темы */
body {
        background-color: #f8f9fa;
        color: #333333;
        font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
      }

      /* Глассморфизм для карточек */
      .card-glass {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        border-radius: 15px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
      }

      /* Gradient buttons */
      .btn-gradient {
        background: var(--ch-gradient-btn);
        border: none;
        color: white;
        transition: all 0.3s ease;
      }
      .btn-gradient:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
      }

      /* Card headers — alias for the primary brand gradient */
      .card-header-gradient {
        background: var(--ch-gradient-primary);
        color: white;
        border-radius: 15px 15px 0 0;
      }

      /* Анимации */
      @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
      }
      .animate-fadeIn {
        animation: fadeIn 0.5s ease-in-out;
      }

      /* Футер */
      footer {
        margin-top: auto;
      }

/* Анимация для сердечка */
@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.fa-heart.text-danger {
    animation: heartBeat 0.5s ease-in-out; /* Анимация при лайке */
}

.btn-link {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

.btn-link:hover {
    opacity: 0.8;
}

/* Стили для цифры лайков */
#like-count {
    font-size: 1rem;
    color: #6c757d; /* Серый цвет */
    user-select: none; /* Запрет выделения текста */
}

/* Стили для кнопки лайка */
#like-ink {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

#like-ink:hover {
    opacity: 0.8;
}

/* Стили для футера v3 */
footer {
  margin-top: auto;
  background: #f8f9fa;
  padding: 20px 0;
  border-top: 1px solid #e9ecef;
}

footer h6 {
  font-size: 11px;
  letter-spacing: 1px;
}

.btn-social {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  transition: transform 0.2s ease;
}

.btn-social:hover {
  transform: scale(1.1);
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
  /* Accordion animation */
  .collapse {
    transition: all 0.3s ease;
  }

  /* Chevron icon */
  .fa-chevron-down {
    transition: transform 0.3s ease;
  }

  /* Rotate chevron when expanded */
  [aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
  }

  /* 44px minimum touch targets in the collapsed navbar menu */
  .navbar-collapse .nav-link,
  .navbar-collapse .dropdown-item {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
  }
  .navbar-collapse .btn {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

/* Стиль для основного изображения Ink */
.ink-detail-image {
    max-height: 300px;
    width: auto;
}

/* Стиль для миниатюр Scrawl */
.scrawl-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
}

/* Общие стили для миниатюр */
.thumbnail-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

/* Стили для аватара профиля */
.profile-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

/* Стили для миниатюр в ленте активности */
.activity-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

/* Дополнительные классы */
.rounded-10 {
    border-radius: 10px;
}

.btn-social {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
  }

  .btn-social:hover {
    transform: scale(1.1);
  }

/* Navbar brand */
.navbar-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px !important;
  color: #667eea !important;
  letter-spacing: -0.3px;
}

/* Навигационные стили для разделения ролей */
.navbar .dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar .dropdown-item {
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
}

.navbar .dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.navbar .dropdown-item i {
    width: 20px;
    text-align: center;
}

/* All nav items share the same color; the transparent border reserves
   space for the active underline so item heights never change */
#learningDropdown,
#teachingDropdown,
#accountDropdown,
.navbar .nav-link {
    color: #6c757d !important;
    border-bottom: 2px solid transparent;
}

/* Активные выпадающие меню */
.dropdown-menu.show {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Разделитель в дропдауне */
.dropdown-divider {
    margin: 0.5rem 0;
}

/* Nav icons inherit the link's font size so line heights stay uniform */
.navbar .nav-link i {
    font-size: 1em;
}

/* Подсветка активного раздела */
.navbar .nav-item.active > .nav-link,
.navbar .nav-item:hover > .nav-link {
    color: #0d6efd !important;
    transition: color 0.2s ease;
}

/* Активная вкладка выделяется синим цветом */
.navbar .nav-item.active .nav-link {
    color: #0d6efd !important;
    font-weight: 500;
    border-bottom: 2px solid #0d6efd;
}

/* Убираем разноцветие из выпадающих меню */
.navbar .nav-item.active.dropdown .nav-link {
    color: #0d6efd !important;
    border-bottom: 2px solid #0d6efd;
}

/* Hover эффект для неактивных вкладок */
.navbar .nav-item:not(.active):hover .nav-link {
    color: #0d6efd !important;
    transition: color 0.2s ease;
}

/* Убираем подчеркивание при hover для активных вкладок */
.navbar .nav-item.active:hover .nav-link {
    border-bottom: 2px solid #0d6efd;
}

/* ─── Upload area (shared: ink_detail, trial_exercise) ─── */
.upload-area {
  border: 3px dashed #667eea;
  border-radius: 15px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(102, 126, 234, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
  margin-bottom: 20px;
  display: block;
  width: 100%;
}
.upload-area:hover {
  border-color: #764ba2;
  background: rgba(102, 126, 234, 0.1);
}
.upload-area.dragover {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.1);
}
.upload-icon {
  font-size: 3rem;
  color: #667eea;
  margin-bottom: 20px;
}
.upload-area input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 0.1px;
  height: 0.1px;
  overflow: hidden;
  z-index: -1;
}

/* ─── Score circles (shared: scrawl_detail, trial_result) ─── */
.score-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 800;
  color: white;
  margin: 0 auto 10px;
  flex-shrink: 0;
}
.score-circle-lg {
  width: 150px;
  height: 150px;
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 20px;
}
/* Score verdict colors: green = excellent, brand = good, orange = keep
   practicing. Deliberately no red — this page must encourage beginners. */
.score-circle.score-excellent { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }
.score-circle.score-good      { background: var(--ch-gradient-primary); }
.score-circle.score-needs-work,
.score-circle.score-low       { background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%); }

/* Score badges (child_detail activity timeline) */
.score-badge { display: inline-block; padding: 4px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }
.score-badge.score-excellent  { background: #d4edda; color: #155724; }
.score-badge.score-good       { background: #fff3cd; color: #856404; }
.score-badge.score-needs-work { background: #f8d7da; color: #721c24; }

/* ─── Class report score bands ─── */
/* The same three states as the badges above, but cut at the course's own
   passing score rather than at fixed thirds, and worn by a table cell rather
   than a pill: twenty-five pills in a column is a rash, not a signal. The
   print stylesheet restates all three with a left rule, because a school
   printer is usually black and white. */
.band-pass   { color: #155724; font-weight: 600; }
.band-close  { color: #856404; font-weight: 600; }
.band-below  { color: #721c24; font-weight: 700; }
.band-none   { color: #6c757d; }

/* ─── VS badge (shared: scrawl_detail, trial_result) ─── */
.vs-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* ─── Comparison images (trial_result) ─── */
.comparison-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 30px 0;
}
.comparison-images img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
@media (min-width: 576px) {
  .comparison-images {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
  }
  .comparison-images .text-center {
    flex: 1;
    max-width: 280px;
  }
  .comparison-images img { max-height: 240px; }
  .vs-badge-lg { width: 60px; height: 60px; font-size: 1rem; }
}

/* Comparison image (scrawl_detail) */
.comparison-img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ─── Trial result page ─── */
.result-hero {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 20px 32px;
  border-radius: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.result-hero-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.result-hero h1   { font-size: 1.4rem; font-weight: 700; margin: 0 0 2px 0; }
.result-hero p    { margin: 0; opacity: 0.88; font-size: 0.9rem; }
.result-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
}
.feedback-item {
  background: #f8f9fa;
  border-left: 4px solid #667eea;
  padding: 20px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 15px;
}
.btn-cta {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 15px 30px;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4); color: white; }
.loading-spinner { text-align: center; padding: 60px 0; }
.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.feature-highlight {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  margin-bottom: 20px;
}
.feature-highlight i { font-size: 2rem; color: #667eea; margin-bottom: 15px; }
.locked-section  { position: relative; border-radius: 12px; overflow: hidden; margin-bottom: 15px; }
.locked-content  { filter: blur(4px); user-select: none; pointer-events: none; background: #f8f9fa; border-left: 4px solid #667eea; padding: 20px; border-radius: 0 10px 10px 0; }
.locked-overlay  { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.4); }
.locked-badge    { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 8px 20px; border-radius: 20px; font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); }
.weak-area-card  { background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%); border: 1px solid #ffc107; border-radius: 12px; padding: 16px 20px; margin-bottom: 15px; }
.cta-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 24px;
  padding: 50px 40px;
  color: white;
  margin-top: 40px;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.plan-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 28px 24px;
  transition: all 0.3s ease;
  height: 100%;
}
.plan-card.featured       { background: rgba(102, 126, 234, 0.25); border-color: #667eea; transform: scale(1.03); box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3); }
.plan-card:hover          { transform: scale(1.04); border-color: #667eea; }
.plan-card.featured:hover { transform: scale(1.06); }
.plan-price      { font-size: 2rem; font-weight: 800; color: white; }
.plan-price span { font-size: 1rem; font-weight: 400; opacity: 0.7; }
.btn-signup-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 14px 32px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  width: 100%;
  display: block;
  text-align: center;
  text-decoration: none;
}
.btn-signup-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5); color: white; }
.btn-signup-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  width: 100%;
  display: block;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
}
.btn-signup-secondary:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.check-item   { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: 0.9rem; opacity: 0.9; }
.check-item i { color: #20c997; margin-top: 2px; flex-shrink: 0; }
.testimonial-card   { background: rgba(255, 255, 255, 0.07); border-radius: 12px; padding: 20px; border-left: 3px solid #20c997; margin-top: 24px; }
.score-badge-inline { display: inline-block; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 2px 10px; border-radius: 12px; font-weight: 700; font-size: 0.95rem; }

/* ─── Trial exercise page ─── */
.trial-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 60px 0;
  margin-bottom: 40px;
}
.trial-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  margin-top: -30px;
  position: relative;
  z-index: 2;
}
.sample-preview {
  border: 3px dashed #e9ecef;
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  background: #f8f9fa;
  margin-bottom: 30px;
}
.sample-preview img { max-width: 100%; max-height: 200px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.btn-trial {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 15px 40px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}
.btn-trial:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4); color: white; }
.feature-icon { font-size: 2.5rem; color: #667eea; margin-bottom: 20px; }
.step-number {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: 0 auto 15px;
}

/* ─── Child dashboard (game UI) ─── */
.child-dashboard-page {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 50%, #fce4ec 100%);
  min-height: 100vh;
}
.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  border-radius: 20px;
}
.day-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}
.day-circle.completed { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4); }
.day-circle.pending   { background: #f8f9fa; border: 2px dashed #dee2e6; color: #aaa; }
.achievement-badge {
  transition: all 0.3s ease;
  cursor: pointer;
  border-radius: 15px;
  padding: 15px;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.achievement-badge.earned  { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); border: 2px solid #ffd700; transform: scale(1.05); }
.achievement-badge.locked  { background: #f8f9fa; border: 2px solid #dee2e6; opacity: 0.6; filter: grayscale(100%); }
.lesson-card           { transition: all 0.3s ease; cursor: pointer; border-radius: 20px; }
.lesson-card:hover     { transform: translateY(-5px); }
.star-rating           { color: #ffd700; }
.star-empty            { color: #e9ecef; }
.btn-game {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 25px;
  color: white;
  font-weight: bold;
  transition: all 0.3s ease;
}
.btn-game:hover         { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4); color: white; }
.btn-success-custom     { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); border: none; border-radius: 25px; color: white; font-weight: bold; }
.btn-warning-custom     { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); border: none; border-radius: 25px; color: white; font-weight: bold; }
.progress-custom        { height: 12px; border-radius: 10px; background-color: #e9ecef; }
.progress-bar-custom    { background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); border-radius: 10px; }
.emoji-icon             { font-size: 2rem; margin-bottom: 0.5rem; }
.stats-number           { font-size: 1.5rem; font-weight: bold; color: #667eea; }
.child-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}
.stars-counter { background: rgba(255, 193, 7, 0.2); border-radius: 25px; padding: 8px 15px; color: #ffc107; font-weight: bold; }

/* ─── Child detail (progress ring, activity timeline) ─── */
.progress-ring         { width: 120px; height: 120px; position: relative; }
.progress-ring-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#28a745 var(--progress, 0%), #e9ecef 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.progress-ring-circle::before { content: ''; position: absolute; width: 80%; height: 80%; background: white; border-radius: 50%; }
.progress-ring-text    { position: relative; z-index: 1; font-weight: bold; font-size: 1.2rem; color: #333; }
.activity-timeline     { position: relative; padding-left: 30px; }
.activity-timeline::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: #dee2e6; }
.activity-item         { position: relative; margin-bottom: 20px; }
.activity-item::before { content: ''; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #28a745; border: 3px solid white; box-shadow: 0 0 0 2px #28a745; }
.metric-card           { transition: transform 0.2s ease; }
.metric-card:hover     { transform: translateY(-2px); }

/* ─── Scrawl detail page ─── */
.tip-card      { background: linear-gradient(135deg, #fff8e1, #fff3cd); border: 1px solid #ffc107; border-radius: 12px; padding: 14px 18px; }
.history-pill  { display: inline-flex; align-items: center; background: #f1f3f5; border-radius: 20px; padding: 4px 12px; font-size: 0.85rem; font-weight: 600; color: #495057; text-decoration: none; }
.history-pill:hover   { background: #dee2e6; color: #212529; }
.history-pill.current { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.history-arrow  { color: #adb5bd; font-size: 0.7rem; }
.course-banner  { background: linear-gradient(135deg, #e3f2fd, #e8eaf6); border: 1px solid #90caf9; border-radius: 12px; padding: 12px 20px; margin-bottom: 20px; }

/* ─── Analysis report (scrawl detail + trial result) ─── */
.progress-thin { height: 7px; }
.issue-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-left: 4px solid #adb5bd;  /* severity recolours this edge */
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.issue-critical { border-left-color: #dc3545; }
.issue-high     { border-left-color: #fd7e14; }
.issue-medium   { border-left-color: #ffc107; }
.issue-evidence { color: #6c757d; font-style: italic; }
.issue-fix      { color: #198754; }
.strength-card  { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); border: 1px solid #a5d6a7; border-radius: 12px; padding: 14px 18px; }
.worksheet-cta {
  background: linear-gradient(135deg, #ede7f6, #e8eaf6);
  border: 1px solid #b39ddb;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ─── Course list page ─── */
.course-image       { height: 200px; object-fit: cover; width: 100%; }
.course-item        { transition: transform 0.2s ease-in-out; }
.course-item:hover  { transform: translateY(-5px); }
.blur-shadow-image  { position: relative; overflow: hidden; border-radius: 0.75rem; }

/* ─── Ink detail page ─── */
.course-info p      { line-height: 1.4; }
.course-info strong { color: #495057; font-size: 0.9rem; }
.course-info a      { font-weight: 500; }
.course-info a:hover { text-decoration: underline !important; }
@media (max-width: 768px) {
  .course-info { text-align: center; margin-bottom: 1rem; }
}

/* ─── Homepage hero ─── */
.hero-section {
  background: var(--ch-gradient-primary);
  color: white;
  padding: 80px 0 60px;
}
.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}
/* The tappable option cards in the sign-up wizard. The class was on the
   markup all along with nothing behind it; the pointer came from an inline
   style sitting next to it. */
.level-card {
  cursor: pointer;
}
.level-card:hover {
  border-color: #667eea;
}

/* The model line in the hero. Only a width cap and a mount: without this rule
   the ink is still a picture of handwriting, just running the full width of
   the container, so an older copy of this file costs nothing that matters. */
.hero-sample {
  max-width: 520px;
  padding: 10px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.hero-sample img {
  display: block;
  width: 100%;
  max-height: 130px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .hero-section { padding: 50px 0 40px; }
  .hero-title { font-size: 1.8rem; }
  .hero-subtitle { font-size: 1rem; }
}

/* ─── Icon shape (reusable) ─── */
.icon-shape {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-shape i {
  font-size: 1.2rem;
}

/* ─── Стили для фильтров курсов ─── */
#languageFilter option {
    padding: 8px;
    font-size: 14px;
}

#languageFilter option:first-child {
    font-weight: 600;
    color: #0d6efd;
}

/* Gradient card backgrounds */
.bg-gradient-primary {
    background: var(--ch-gradient-primary) !important;
}

.bg-gradient-success {
    background: var(--ch-gradient-success) !important;
}

.bg-gradient-info {
    background: var(--ch-gradient-info) !important;
}

.bg-gradient-warning {
    background: var(--ch-gradient-warning) !important;
}

.bg-gradient-danger {
    background: var(--ch-gradient-danger) !important;
}

.bg-gradient-secondary {
    background: var(--ch-gradient-secondary) !important;
}

/* Keep text on any gradient background white and readable */
[class*="bg-gradient-"],
.card-header-gradient {
    color: white !important;
}

[class*="bg-gradient-"] .text-white,
.card-header-gradient .text-white {
    color: white !important;
}

[class*="bg-gradient-"] .text-muted,
.card-header-gradient .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

@media (max-width: 576px) {
  .btn-social {
    width: 38px;
    height: 38px;
  }
  .btn-social i {
    font-size: 0.9em;
  }
  .btn-social-mobile {
    width: 44px;
    height: 44px;
    margin: 0 4px 8px 4px;
  }
  #followCollapse.show {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Worksheet previews
   ------------------------------------------------------------------------ */
/* The frame keeps A4 proportions from the first paint, so sixteen lazy-loaded
   sheets cannot shove the page around as they arrive. */
.sheet-preview {
  display: block;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sheet-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.sheet-preview:hover img {
  transform: scale(1.03);
}

/* Course, lesson and exercise pages
   ------------------------------------------------------------------------
   Three pages that share a header, a card and a spacing rule. Each one used
   to improvise its own: breadcrumbs that repeated the H1 sitting under them,
   card headers in three different greys (Bootstrap's default on a bare
   .card-header, #f8f9fa from a page-local <style>, transparent on the rest),
   and gaps that came from per-card mb-* utilities, so the last card in a
   column had none at all. Everything here is scoped to .course-page: the
   twenty other templates that use .card-glass keep the look they have. */

/* The gap belongs to the container, not to each card. One value, no card
   left without it. */
.course-page .ch-blocks {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 992px) {
  .course-page .ch-blocks {
    gap: 1.5rem;
  }
}

/* One header treatment for every block: no fill, one hairline, brand icon. */
.course-page .card-glass > .card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.875rem 1rem;
}
.course-page .card-glass > .card-header > h5,
.course-page .card-glass > .card-header > h6 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #333333;
}
.course-page .card-glass > .card-header > h5 > i,
.course-page .card-glass > .card-header > h6 > i {
  color: #667eea;
}

/* Page header. A single 44px back row replaces the breadcrumb-plus-button
   pair: the flex row had no wrap, so on a phone it squeezed the button into
   a narrow column, and the trailing crumb repeated the H1 directly below it. */
.page-head-back {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.875rem;
  font-weight: 500;
  color: #667eea;
  text-decoration: none;
}
.page-head-back:hover,
.page-head-back:focus {
  color: #5568d3;
  background: rgba(102, 126, 234, 0.04);
}
.page-head-back > i {
  flex-shrink: 0;
}
.page-head-back > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-head-body {
  padding: 0.875rem 1rem 1rem;
}
.page-head-title {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  color: #333333;
}
.page-head-title > i {
  flex-shrink: 0;
  margin-top: 0.2em;
  font-size: 1.25rem;
}
.page-head-meta {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: #6c757d;
}
@media (min-width: 768px) {
  .page-head-title {
    font-size: 1.75rem;
  }
}

/* Course hero. The handwriting sample IS the product, so a phone never crops
   it: object-fit: cover in a 342x300 box showed about a third of a wide
   banner, and the gradient caption covered the descenders of what was left.
   From md up the image is wide enough for the original overlay treatment. */
.course-hero {
  border-radius: 15px 15px 0 0;
  overflow: hidden;
}
.course-hero-img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.course-hero-caption {
  padding: 1rem 1rem 0;
}
.course-hero-title {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  color: #333333;
}
.course-hero-author {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: #6c757d;
}
@media (min-width: 768px) {
  .course-hero {
    margin: -1.5rem 1rem 0;
    overflow: visible;
  }
  .course-hero-img {
    height: 300px;
    object-fit: cover;
    border-bottom: 0;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  }
  .course-hero-caption {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  }
  .course-hero-title {
    font-size: 1.75rem;
    color: #ffffff;
  }
  .course-hero-author {
    font-size: 0.875rem;
    color: #ffffff;
    opacity: 0.85;
  }
}

/* Course stats: four tiles in one row on a phone too. As a 2x2 grid they ate
   roughly 200px of vertical space near the top of the page to show four
   numbers. The labels are sized here because the .text-sm they carried is a
   Material Dashboard leftover that this project never defined, so they were
   rendering at the full 16px body size. */
.course-stats {
  display: grid;
  /* One implicit column per tile, not a fixed four: the student tile appears
     only once its count argues for the course, so the row is usually two or
     three wide.
     A stale copy of this file still reads repeat(4, ...) and simply leaves the
     last column empty, which is why this is safe to ship on its own. */
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.5rem;
}
.course-stats .icon-shape {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.course-stats .icon-shape i {
  font-size: 1rem;
}
.course-stats-value {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}
.course-stats-label {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  line-height: 1.25;
}
@media (min-width: 576px) {
  .course-stats {
    gap: 1rem;
  }
  .course-stats .icon-shape {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .course-stats .icon-shape i {
    font-size: 1.2rem;
  }
  .course-stats-value {
    font-size: 1.125rem;
  }
  .course-stats-label {
    font-size: 0.8125rem;
  }
}

/* Lesson row in the course accordion: the exercise count moves under the
   title instead of fighting it for the same line. */
.course-page .accordion-button {
  padding: 0.875rem 0.75rem;
}
.lesson-row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  width: 100%;
}
.lesson-row-icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.lesson-row-text {
  flex-grow: 1;
  min-width: 0;
}
.lesson-row-text h6 {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.35;
}
.lesson-row-count {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

/* Exercise row: the action takes its own line and a 44px target instead of
   wrapping to wherever the description happens to end, which put two
   neighbouring buttons at two different heights. */
.exercise-row {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.exercise-row-text {
  min-width: 0;
}
.exercise-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  min-height: 44px;
}
@media (min-width: 576px) {
  .exercise-row {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
  .exercise-row-text {
    flex-grow: 1;
  }
  .exercise-row-action {
    width: auto;
    flex-shrink: 0;
  }
}

/* Primary action fills the column on a phone, keeps its natural width above. */
.btn-stretch-mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  min-height: 48px;
}
@media (min-width: 576px) {
  .btn-stretch-mobile {
    width: auto;
  }
}

/* Lesson picker in the sidebar: the rows were 24px tall, under half a
   fingertip, and the whole row is now the target rather than the text. */
/* The model for an exercise, shown on the lesson page. The inks are wide
   banners, so this cap only matters for an unusually tall one — an older copy
   of this file leaves them uncapped and they still fit the card. */
.exercise-sample {
  max-height: 110px;
  object-fit: contain;
}

.lesson-nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  padding: 0.5rem;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #667eea;
  text-decoration: none;
}
.lesson-nav-item:hover {
  background: rgba(102, 126, 234, 0.06);
  color: #5568d3;
}
.lesson-nav-item > i {
  flex-shrink: 0;
}
.lesson-nav-item.is-current {
  background: rgba(102, 126, 234, 0.08);
  color: #333333;
  font-weight: 700;
}
.lesson-nav-item.is-locked {
  color: #6c757d;
}

/* Contrast on the pale gradient ramps
   ------------------------------------------------------------------------
   [class*="bg-gradient-"] { color: white } is right for the purple ramp and
   wrong for every other one: white measures about 1.8:1 on #8fd3f4 and 1.2:1
   on #fed6e3, where WCAG asks 4.5:1 for text this size. Text-bearing badges
   become flat tints of the same hue with dark type; the gradients stay where
   they are decoration rather than a ground for words. */
.badge.bg-gradient-success {
  background: #d1e7dd !important;
  color: #0f5132 !important;
}
.badge.bg-gradient-info {
  background: #cff4fc !important;
  color: #055160 !important;
}
.badge.bg-gradient-warning {
  background: #fff3cd !important;
  color: #664d03 !important;
}
.badge.bg-gradient-secondary {
  background: #e2e3e5 !important;
  color: #41464b !important;
}

/* Same reason for the icon tiles: only the purple ramp is dark enough for a
   white glyph, so the others take a dark tone of their own hue. */
.icon-shape.bg-gradient-success i {
  color: #12664a !important;
}
.icon-shape.bg-gradient-info i {
  color: #1f6f6a !important;
}
.icon-shape.bg-gradient-warning i {
  color: #7a3d0a !important;
}
