/* =====================================================
   Достижения раздела «Серия и достижения»: спокойный список
   строк-разделителей (без «витрины» карточек). Краткий список
   на основном экране + полный по тапу на шапку.
   ===================================================== */

/* Шапка-переключатель: тап по ней тоже раскрывает/сворачивает список. */
.ach-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.ach-toggle > i[data-lucide="award"] {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
}
.ach-toggle-title { flex: 0 0 auto; }
.ach-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.ach-chev {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--dur) var(--ease);
}
.ach-toggle.open .ach-chev { transform: rotate(180deg); }

/* Единый блок со строками-разделителями — минимум обводок и заливок. */
.ach-list {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.ach-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
}
.ach-row + .ach-row { border-top: 1px solid var(--border); }
.ar-ico {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}
.ach-row.unlocked .ar-ico { color: var(--color-accent); }
.ar-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.ach-row:not(.unlocked) .ar-title { color: var(--text-secondary); }
.ar-check { flex: 0 0 auto; width: 18px; height: 18px; color: var(--color-primary); }
.ar-prog { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--text-muted); }

/* Строка-действие «Все достижения» / «Свернуть». */
.ach-more {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  color: var(--color-accent);
  font-weight: 650;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.ach-more span { flex: 1; min-width: 0; text-align: left; }
.ach-more:active { background: var(--surface-2); }
.ar-chev { flex: 0 0 auto; width: 18px; height: 18px; color: var(--color-accent); }

/* Раскрытый блок — тот же равномерный вертикальный ритм. */
.ach-all-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* display:flex перебивает атрибут hidden — возвращаем скрытие явно. */
.ach-all-wrap[hidden] { display: none; }

/* Перенесённые в подробную статистику показатели. */
.streak-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.sd-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
}
.sd-stat b { font-size: 17px; font-weight: 800; }
.sd-stat span { font-size: 11px; color: var(--text-muted); }

/* =====================================================
   Экран «Достижения» в профиле: плитки-бейджи по группам.
   Открытые — цветные, закрытые — с полосой прогресса.
   ===================================================== */

.ab-view { display: flex; flex-direction: column; gap: 10px; }

.ab-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
}
.ab-head > b { font-size: 20px; line-height: 1; }
.ab-head > span {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-muted);
}

.ab-section {
  margin: 6px 0 -2px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.ab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.ab-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
}
.ab-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
}
.ab-ico > i { width: 20px; height: 20px; }
.ab-tile.open .ab-ico {
  color: #fff;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--color-primary) 85%, #fff),
    color-mix(in srgb, var(--color-primary) 80%, #000));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 28%, transparent);
}
.ab-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}
.ab-tile:not(.open) .ab-title { color: var(--text-secondary); }
.ab-done {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
}
.ab-done > i { width: 12px; height: 12px; }
.ab-prog {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.ab-bar {
  display: block;
  height: 4px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.ab-bar > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--color-primary);
}
