/**
 * PatenTest 2026 — Features CSS (Задача #22)
 * Стили модулей: Профиль (#screenProfile), Словарь (#screenDictionary),
 * Флеш-карты (#screenFlashcards), заготовки Referral / AI-Tutor.
 * Базовые переменные и классы (hero-card/category-card/admin-table/btn) — в style.css.
 */

/* ============ Кнопка возврата на главную ============ */
.back-to-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.back-to-home-btn:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.14);
}

/* ============ ПРОФИЛЬ (#screenProfile) ============ */
.ptf-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.ptf-avatar {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.ptf-profile-id {
  flex: 1;
  min-width: 0;
}

.ptf-profile-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ptf-profile-username {
  font-size: 12px;
  color: var(--link-color);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ptf-profile-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ptf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
}

.ptf-badge.ptf-badge-talant {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.ptf-phone-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.ptf-phone-row input {
  flex: 1;
  min-width: 0;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
}

.ptf-phone-row input:focus {
  outline: none;
  border-color: var(--button-color);
}

.ptf-phone-save-btn {
  border: none;
  border-radius: var(--radius-sm);
  background: var(--button-color);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.ptf-phone-save-btn:active {
  transform: scale(0.96);
}

/* Вкладки профиля */
.ptf-profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.ptf-profile-tab {
  flex: 1;
  min-width: max-content;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  color: var(--hint-color);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ptf-profile-tab.active {
  background: var(--button-color);
  border-color: var(--button-color);
  color: #fff;
}

/* Таблица истории тестов */
.ptf-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

.ptf-history-meta {
  flex: 1;
  min-width: 0;
}

.ptf-history-cat {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-color);
  margin-bottom: 2px;
}

.ptf-history-date {
  font-size: 11px;
  color: var(--hint-color);
}

.ptf-history-score {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-color);
  white-space: nowrap;
}

.ptf-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.ptf-pill.pass {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.ptf-pill.fail {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Статистика профиля */
.ptf-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ptf-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
}

.ptf-stat-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 4px;
}

.ptf-stat-lbl {
  display: block;
  font-size: 11px;
  color: var(--hint-color);
  line-height: 1.3;
}

/* Пустые состояния */
.ptf-empty-state {
  text-align: center;
  padding: 28px 16px;
  background: var(--card-bg);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--hint-color);
  font-size: 13px;
  line-height: 1.5;
}

.ptf-empty-state .ptf-empty-icon {
  display: block;
  font-size: 34px;
  margin-bottom: 10px;
}

.ptf-demo-note {
  font-size: 11px;
  color: var(--hint-color);
  margin: 8px 0;
}

/* ============ СЛОВАРЬ (#screenDictionary) ============ */
.ptf-dict-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.ptf-search-input {
  flex: 1;
  min-width: 0;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 13px;
}

.ptf-search-input:focus {
  outline: none;
  border-color: var(--button-color);
}

.ptf-flashmode-btn {
  border: 1px solid rgba(236, 72, 153, 0.45);
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease;
}

.ptf-flashmode-btn:active {
  transform: scale(0.96);
}

.ptf-chips-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.ptf-chip {
  min-width: max-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  color: var(--hint-color);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.ptf-phrase-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.ptf-phrase-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ptf-phrase-ru {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1.3;
}

.ptf-phrase-transcription {
  font-size: 12px;
  color: var(--link-color);
  font-style: italic;
  margin-top: 3px;
}

.ptf-phrase-translation {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 6px;
}

.ptf-phrase-context {
  font-size: 11px;
  color: var(--hint-color);
  margin-top: 4px;
  line-height: 1.4;
}

.ptf-speak-btn {
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(56, 189, 248, 0.12);
  font-size: 17px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.ptf-speak-btn:active {
  transform: scale(0.9);
  background: rgba(56, 189, 248, 0.25);
}

/* ============ ФЛЕШ-КАРТЫ (#screenFlashcards) ============ */
.ptf-flash-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ptf-flash-progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.ptf-flash-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transition: width 0.3s ease;
}

.ptf-flash-progress-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-color);
  white-space: nowrap;
}

/* 3D flip-карта */
.ptf-flip-scene {
  perspective: 1200px;
  margin-bottom: 14px;
}

.ptf-flip-card {
  position: relative;
  width: 100%;
  min-height: 220px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  cursor: pointer;
}

.ptf-flip-card.flipped {
  transform: rotateY(180deg);
}

.ptf-flip-face {
  position: absolute;
  inset: 0;
  min-height: 220px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 22px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.ptf-flip-face.back {
  transform: rotateY(180deg);
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.12), var(--card-bg));
}

.ptf-flip-word {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1.25;
}

.ptf-flip-translation {
  font-size: 20px;
  font-weight: 800;
  color: #34d399;
  line-height: 1.3;
}

.ptf-flip-transcription {
  font-size: 14px;
  font-style: italic;
  color: var(--link-color);
}

.ptf-flip-hint {
  font-size: 11px;
  color: var(--hint-color);
  margin-top: 8px;
}

.ptf-flash-actions {
  display: flex;
  gap: 10px;
}

.ptf-flash-actions .btn {
  flex: 1;
  padding: 13px 10px;
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-md);
}

.ptf-btn-know {
  background: rgba(16, 185, 129, 0.2) !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  color: #34d399 !important;
}

.ptf-btn-dontknow {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #f87171 !important;
}

/* audit-14: бейдж очереди «не знаю» на карточке категории */
.ptf-flash-due-badge {
  display: inline-block;
  margin: 6px 0 0;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 999px;
}

/* этап 2B: правило урока в разборе теста и практике ошибок */
.lesson-rule-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
}

.lesson-rule-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--link-color);
  margin-bottom: 6px;
}

.lesson-rule-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-color);
}

/* этап 2C: аккордеон уроков (макет A) */
.ptf-acc-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.ptf-acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ptf-acc-status {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.ptf-acc-status.done {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.5);
}

.ptf-acc-status.todo {
  background: var(--card-bg);
  color: var(--hint-color);
  border: 1px solid var(--border-color);
}

.ptf-acc-main {
  flex: 1;
  min-width: 0;
}

.ptf-acc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-color);
}

.ptf-acc-topic {
  font-size: 11px;
  color: var(--link-color);
  font-weight: 600;
  margin-top: 1px;
}

.ptf-acc-chev {
  color: var(--hint-color);
  font-size: 14px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.ptf-acc-item.open .ptf-acc-chev {
  transform: rotate(90deg);
}

.ptf-acc-body {
  display: none;
  padding: 4px 14px 14px;
  border-top: 1px solid var(--border-color);
}

.ptf-acc-item.open .ptf-acc-body {
  display: block;
}

.ptf-acc-rule {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  margin: 10px 0;
}

.ptf-acc-rule-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--link-color);
  margin-bottom: 4px;
}

.ptf-acc-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ptf-acc-actions .btn {
  flex: 1;
  min-width: 140px;
}

.ptf-acc-done-btn {
  background: rgba(52, 211, 153, 0.15) !important;
  border: 1px solid rgba(52, 211, 153, 0.45) !important;
  color: #34d399 !important;
}

.ptf-acc-done-btn:disabled {
  opacity: 0.75;
  cursor: default;
}

/* этап 4: «Путь к цели» на главной */
.home-goal-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(167, 139, 250, 0.15));
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
}

.home-goal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 4px;
}

.home-goal-sub {
  font-size: 12px;
  color: var(--text-color);
  opacity: 0.85;
  margin-bottom: 12px;
  line-height: 1.5;
}

.home-goal-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.home-goal-bar {
  flex: 1;
  height: 8px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 999px;
  overflow: hidden;
}

.home-goal-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 999px;
  transition: width 0.3s;
}

.home-goal-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--link-color);
  white-space: nowrap;
}

.home-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--hint-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 8px;
}

.home-continue-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.home-continue-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(96, 165, 250, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.home-continue-main {
  flex: 1;
  min-width: 0;
}

.home-continue-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-color);
}

.home-continue-sub {
  font-size: 11px;
  color: var(--hint-color);
  margin-top: 1px;
}

.home-continue-arrow {
  color: var(--hint-color);
  flex-shrink: 0;
}

.home-badge-num {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Итог сессии */
.ptf-session-result {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  margin-bottom: 12px;
}

.ptf-session-result .ptf-result-emoji {
  font-size: 44px;
  display: block;
  margin-bottom: 10px;
}

.ptf-session-result h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 12px;
}

.ptf-result-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ptf-result-stat {
  min-width: 90px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
}

.ptf-result-stat .val {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-color);
}

.ptf-result-stat.good .val {
  color: #34d399;
}

.ptf-result-stat.bad .val {
  color: #f87171;
}

.ptf-result-stat .lbl {
  display: block;
  font-size: 11px;
  color: var(--hint-color);
  margin-top: 3px;
}

/* ============ ЗАГОТОВКИ (Referral / AI-Tutor) ============ */
.ptf-placeholder {
  text-align: center;
  padding: 40px 16px;
  background: var(--card-bg);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--hint-color);
  font-size: 13px;
  line-height: 1.5;
}

.ptf-placeholder .ptf-placeholder-icon {
  display: block;
  font-size: 42px;
  margin-bottom: 12px;
}

/* ============ ХАБ ИГР (#screenGamesHub, Задача #23) ============ */
.ptf-games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ptf-game-option {
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.ptf-game-option:active {
  transform: scale(0.98);
}

/* ============ РЕФЕРАЛЫ (#screenReferral, Задача #23) ============ */
.ptf-ref-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.ptf-ref-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.ptf-ref-code-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--hint-color);
}

.ptf-ref-code-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-color);
  letter-spacing: 1px;
}

.ptf-ref-link-row {
  margin-bottom: 10px;
}

.ptf-ref-link-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
}

.ptf-ref-link-input:focus {
  outline: none;
  border-color: var(--button-color);
}

.ptf-ref-actions {
  display: flex;
  gap: 10px;
}

.ptf-ref-actions .btn {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
}

.ptf-ref-rules {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-top: 12px;
}

.ptf-ref-rules-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--link-color);
  margin-bottom: 8px;
}

.ptf-ref-rules-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-color);
}

.ptf-ref-rules-list li {
  margin-bottom: 6px;
}

/* ============ AI-РЕПЕТИТОР (#screenAiTutor, Задача #23) ============ */
.ptf-ai-wrap {
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}

.ptf-ai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ptf-ai-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
}

.ptf-ai-clear-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  white-space: nowrap;
}

.ptf-ai-messages {
  flex: 1;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
  max-height: 55vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ptf-ai-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-color);
  word-wrap: break-word;
}

.ptf-ai-bubble.user {
  align-self: flex-end;
  background: var(--button-color);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ptf-ai-bubble.model {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.ptf-ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hint-color);
}

.ptf-ai-dots {
  display: inline-flex;
  gap: 4px;
}

.ptf-ai-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hint-color);
  animation: ptf-ai-blink 1s infinite;
}

.ptf-ai-dots i:nth-child(2) { animation-delay: 0.2s; }
.ptf-ai-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes ptf-ai-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.ptf-ai-inputrow {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ptf-ai-input {
  flex: 1;
  min-width: 0;
  min-height: 80px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
font-family: inherit;
line-height: 1.5;
resize: vertical;
}

.ptf-ai-input:focus {
  outline: none;
  border-color: var(--button-color);
}

.ptf-ai-send-btn {
  font-size: 13px;
  font-weight: 800;
  padding: 12px 16px;
  white-space: nowrap;
  width: 100%;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   Раздел «Обратная связь» (#790): хаб, форма, отзывы, презентация, админка
   ═══════════════════════════════════════════════════════ */

/* --- Хаб: 3 карточки --- */
.fb-hub-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.fb-hub-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.fb-hub-card:active { transform: scale(0.98); }

.fb-hub-card .card-icon { flex-shrink: 0; }

.fb-hub-card .card-content { flex: 1; min-width: 0; }

.fb-hub-card .card-content h3 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-color);
}

.fb-hub-card .card-content p {
  margin: 0;
  font-size: 12px;
  color: var(--hint-color);
  line-height: 1.4;
}

.fb-hub-card .card-arrow { flex-shrink: 0; }

/* --- Чипсы категории --- */
.fb-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fb-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}

.fb-chip.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}

/* --- Состояния формы (успех / ошибка) --- */
.fb-status-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  text-align: center;
}

.fb-status-box-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
}

.fb-status-icon { font-size: 30px; line-height: 1; margin-bottom: 6px; }

.fb-status-box h3 { margin: 0 0 6px 0; font-size: 16px; font-weight: 800; color: var(--text-color); }

.fb-status-box p { margin: 0 0 10px 0; font-size: 13px; color: var(--hint-color); line-height: 1.45; }

/* --- Сводка отзывов --- */
.fb-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  margin-bottom: 12px;
}

.fb-summary-rating {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fb-summary-stars { font-size: 22px; letter-spacing: 2px; }

.fb-summary-avg {
  font-size: 26px;
  font-weight: 900;
  color: #fbbf24;
}

.fb-summary-count {
  font-size: 12px;
  color: var(--hint-color);
  font-weight: 600;
}

/* --- Форма отзыва --- */
.fb-review-form { margin-bottom: 12px; }

.fb-review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Презентация --- */
.fb-pres-banner {
  margin-bottom: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.fb-pres-banner-img {
  display: block;
  width: 100%;
  height: auto;
}

.fb-pres-section { margin-bottom: 12px; }

.fb-pres-h3 {
  font-size: 15px;
  margin: 0 0 10px 0;
  color: var(--link-color);
  font-weight: 800;
}

.fb-pres-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-color);
}

.fb-pres-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.fb-pres-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  text-align: center;
}

.fb-pres-stat-num {
  font-size: 22px;
  font-weight: 900;
  color: #34d399;
  line-height: 1;
}

.fb-pres-stat > span:last-child {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint-color);
}

.fb-pres-step {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  align-items: flex-start;
}

.fb-pres-step:last-child { border-bottom: none; }

.fb-pres-step-img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.fb-pres-step-body { flex: 1; min-width: 0; }

.fb-pres-step-body-wide { flex: 1; }

.fb-pres-step-body h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-color);
}

.fb-pres-step-body p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--hint-color);
}

.fb-pres-section .btn { margin-top: 10px; }

/* --- Админка: модерация --- */
.fb-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.fb-admin-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fb-admin-btn-approve {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.fb-admin-btn-reject {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.fb-admin-btn-delete {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.4);
  color: #94a3b8;
}

/* --- Экран «Тарифы и Поддержка проекта» (#831) --- */
.tar-section {
  margin-bottom: 14px;
}

.tar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tar-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-color);
  margin: 0;
}

.tar-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

.tar-summary-stars {
  font-size: 13px;
}

.tar-summary-avg {
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
}

.tar-summary-count {
  font-size: 11px;
  color: var(--hint-color);
}

.tar-carousel-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.tar-carousel {
  flex: 1;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.tar-carousel::-webkit-scrollbar {
  display: none;
}

.tar-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tar-slide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tar-slide-name {
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tar-slide-stars {
  font-size: 12px;
  white-space: nowrap;
}

.tar-slide-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-color);
  flex: 1;
}

.tar-slide-date {
  font-size: 10px;
  color: var(--hint-color);
}

.tar-nav-btn {
  flex: 0 0 auto;
  width: 34px;
  min-height: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tar-nav-btn:active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
}

.tar-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.tar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.tar-dot.active {
  background: #38bdf8;
  transform: scale(1.25);
}

.tar-empty {
  width: 100%;
}

.tar-social-card,
.tar-donate-card {
  margin-bottom: 14px;
  gap: 8px;
}

.tar-block-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--link-color);
  margin: 0;
}

.tar-block-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-color);
  opacity: 0.92;
  margin: 0;
}

.tar-card-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 16px 12px;
  margin-top: 4px;
}

.tar-card-number {
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #38bdf8;
  text-align: center;
  user-select: all;
  word-break: break-all;
}

.tar-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tar-copy-btn {
  min-width: 180px;
}

.tar-donate-note {
  font-size: 11px;
  color: var(--hint-color);
  text-align: center;
  margin: 2px 0 0;
}

body[data-theme="light"] .tar-slide {
  background: rgba(255, 255, 255, 0.7);
}

body[data-theme="light"] .tar-card-box {
  background: rgba(56, 189, 248, 0.06);
}

/* ============ AI-ЮРИСТ «Документы МВД» (#screenMvdLawyer, Задача #5) ============
   Акцент — синий #60a5fa (отличие от золотого репетитора), тёмная тема
   приложения сохраняется через var(--...). */
.ptf-mvd-wrap {
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}

.ptf-mvd-hero {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.ptf-mvd-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 8px;
}

.ptf-mvd-title {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 900;
  color: var(--text-color);
}

.ptf-mvd-subtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--hint-color);
}

.ptf-mvd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ptf-mvd-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
}

.ptf-mvd-remaining {
  font-size: 11px;
  color: var(--hint-color);
  margin-bottom: 8px;
}

.ptf-mvd-remaining strong {
  color: #60a5fa;
}

.ptf-mvd-clear-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  white-space: nowrap;
}

.ptf-mvd-retry-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.ptf-mvd-messages {
  flex: 1;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
  max-height: 55vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ptf-mvd-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-color);
  word-wrap: break-word;
}

.ptf-mvd-bubble.user {
  align-self: flex-end;
  background: var(--button-color);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ptf-mvd-bubble.model {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.ptf-mvd-bubble-text a {
  color: #60a5fa;
  text-decoration: underline;
  word-break: break-all;
}

.ptf-mvd-typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hint-color);
}

.ptf-mvd-dots {
  display: inline-flex;
  gap: 4px;
}

.ptf-mvd-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hint-color);
  animation: ptf-ai-blink 1s infinite;
}

.ptf-mvd-dots i:nth-child(2) { animation-delay: 0.2s; }
.ptf-mvd-dots i:nth-child(3) { animation-delay: 0.4s; }

/* Блок «Источники» под ответом */
.ptf-mvd-sources {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: var(--radius-md);
}

.ptf-mvd-sources-title {
  font-size: 11px;
  font-weight: 800;
  color: #60a5fa;
  margin-bottom: 6px;
}

.ptf-mvd-sources ol {
  margin: 0;
  padding-left: 18px;
}

.ptf-mvd-sources li {
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 3px;
}

.ptf-mvd-sources a {
  color: #60a5fa;
  text-decoration: underline;
  word-break: break-all;
}

/* Оценка: звёзды и панель «Что не так?» */
.ptf-mvd-rate {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.ptf-mvd-rate-title {
  font-size: 11px;
  color: var(--hint-color);
  margin-bottom: 4px;
}

.ptf-mvd-stars {
  display: inline-flex;
  gap: 2px;
}

.ptf-mvd-star {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: 20px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.ptf-mvd-star.active {
  color: #fbbf24;
}

.ptf-mvd-star:not(:disabled):hover {
  transform: scale(1.15);
}

.ptf-mvd-star:disabled {
  cursor: default;
}

.ptf-mvd-rate-thanks {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
}

.ptf-mvd-ratepanel {
  margin-top: 10px;
  padding: 10px;
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-md);
}

.ptf-mvd-ratepanel-title {
  font-size: 11px;
  font-weight: 800;
  color: #f87171;
  margin-bottom: 6px;
}

.ptf-mvd-rateopts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.ptf-mvd-rateopt {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}

.ptf-mvd-rateopt:hover {
  border-color: #f87171;
  color: #f87171;
}

.ptf-mvd-ratecomment {
  width: 100%;
  min-height: 44px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color);
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 8px;
}

.ptf-mvd-ratecomment:focus {
  outline: none;
  border-color: #f87171;
}

.ptf-mvd-ratesubmit {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: rgba(248, 113, 113, 0.75);
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  cursor: pointer;
}

.ptf-mvd-ratesubmit:hover {
  background: rgba(248, 113, 113, 0.9);
}

/* Поле ввода */
.ptf-mvd-inputrow {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ptf-mvd-input {
  flex: 1;
  min-width: 0;
  min-height: 70px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}

.ptf-mvd-input:focus {
  outline: none;
  border-color: #60a5fa;
}

.ptf-mvd-send-btn {
  font-size: 13px;
  font-weight: 800;
  padding: 12px 16px;
  white-space: nowrap;
  width: 100%;
  flex-shrink: 0;
}

.ptf-mvd-disclaimer {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--hint-color);
  text-align: center;
}

/* Форум вопросов */
.ptf-mvd-faq {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.ptf-mvd-faq-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.ptf-mvd-faq-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-color);
}

.ptf-mvd-faq-search {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
}

.ptf-mvd-faq-search:focus {
  outline: none;
  border-color: #60a5fa;
}

.ptf-mvd-faq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ptf-mvd-faq-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint-color);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
}

.ptf-mvd-faq-chip.active {
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(96, 165, 250, 0.45);
}

.ptf-mvd-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ptf-mvd-faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ptf-mvd-faq-item.open {
  border-color: rgba(96, 165, 250, 0.4);
}

.ptf-mvd-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  padding: 12px 14px;
  cursor: pointer;
}

.ptf-mvd-faq-qtext {
  flex: 1;
  min-width: 0;
}

.ptf-mvd-faq-meta {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--hint-color);
  white-space: nowrap;
}

.ptf-mvd-faq-a {
  padding: 0 14px 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

.ptf-mvd-faq-answer {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-color);
  white-space: pre-line;
}

.ptf-mvd-faq-answer a {
  color: #60a5fa;
  text-decoration: underline;
  word-break: break-all;
}

.ptf-mvd-faq-source {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  text-decoration: underline;
  word-break: break-all;
}

.ptf-mvd-faq-votes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--hint-color);
}

.ptf-mvd-faq-vote {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}

.ptf-mvd-faq-vote:hover {
  border-color: #60a5fa;
  color: #60a5fa;
}

.ptf-mvd-faq-thanks {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
}

.ptf-mvd-faq-empty {
  font-size: 12px;
  color: var(--hint-color);
  text-align: center;
  padding: 16px 8px;
}

/* ==========================================================================
   Задача #3: админка служебного «Агента» (модуль js/agent_admin.js).
   Все классы — с префиксом .agent-*, переиспользуем переменные темы проекта.
   ========================================================================== */

.agent-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.agent-hero-title {
  font-size: 16px;
  font-weight: 900;
  color: #f87171;
}

.agent-hero-sub {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--hint-color);
}

.agent-pill {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--hint-color);
}

.agent-pill-ok {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.agent-pill-busy {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.agent-pill-off {
  border-color: rgba(148, 163, 184, 0.35);
  color: #94a3b8;
}

.agent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-tab {
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  color: var(--hint-color);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.agent-tab.active {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.agent-content {
  display: flex;
  flex-direction: column;
}

.agent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
}

.agent-card-muted {
  color: var(--hint-color);
  font-size: 12px;
}

.agent-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.agent-card-id {
  margin-left: auto;
  font-size: 11px;
  color: var(--hint-color);
}

.agent-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 8px;
}

.agent-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--hint-color);
  white-space: nowrap;
}

/* Бейджи типов проверок */
.agent-badge-ct-questions { border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.agent-badge-ct-translations { border-color: rgba(52, 211, 153, 0.4); background: rgba(16, 185, 129, 0.12); color: #34d399; }
.agent-badge-ct-feedback { border-color: rgba(168, 85, 247, 0.4); background: rgba(168, 85, 247, 0.12); color: #c084fc; }
.agent-badge-ct-db_integrity { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.12); color: #fbbf24; }

/* Бейджи серьёзности */
.agent-sev-critical, .agent-sev-high { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.15); color: #f87171; }
.agent-sev-medium, .agent-sev-warning { border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.agent-sev-low { border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.agent-sev-info { border-color: rgba(148, 163, 184, 0.4); background: rgba(148, 163, 184, 0.1); color: #94a3b8; }

/* Бейджи статусов (находки / кампании) */
.agent-badge-st-pending { border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.agent-badge-st-approved { border-color: rgba(52, 211, 153, 0.5); background: rgba(16, 185, 129, 0.15); color: #34d399; }
.agent-badge-st-applied { border-color: rgba(56, 189, 248, 0.5); background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.agent-badge-st-rejected { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.15); color: #f87171; }
.agent-badge-st-rolled_back { border-color: rgba(168, 85, 247, 0.5); background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.agent-badge-st-draft { border-color: rgba(148, 163, 184, 0.4); background: rgba(148, 163, 184, 0.1); color: #94a3b8; }
.agent-badge-st-scheduled { border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.agent-badge-st-sent { border-color: rgba(52, 211, 153, 0.5); background: rgba(16, 185, 129, 0.15); color: #34d399; }
.agent-badge-st-cancelled { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.12); color: #f87171; }

/* Бейджи статусов прогонов */
.agent-badge-run-running, .agent-badge-run-pending, .agent-badge-run-queued {
  border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.15); color: #fbbf24;
}
.agent-badge-run-completed, .agent-badge-run-success, .agent-badge-run-finished {
  border-color: rgba(52, 211, 153, 0.5); background: rgba(16, 185, 129, 0.15); color: #34d399;
}
.agent-badge-run-failed, .agent-badge-run-error {
  border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.15); color: #f87171;
}

.agent-badge-kind { border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.agent-badge-action { border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.12); color: #38bdf8; }

.agent-target {
  font-size: 12px;
  color: var(--hint-color);
  margin-bottom: 8px;
}

.agent-evidence {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(245, 158, 11, 0.6);
  border-radius: 0 10px 10px 0;
  padding: 8px 10px;
  margin-bottom: 8px;
  word-break: break-word;
}

/* Карточки материалов агента (черновики новых вопросов) */
.agent-material-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-color);
  margin-bottom: 10px;
  word-break: break-word;
}

.agent-material-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.agent-material-opt {
  font-size: 12px;
  line-height: 1.45;
  color: var(--hint-color);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 10px;
  word-break: break-word;
}

.agent-material-opt-correct {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.agent-material-opt-mark {
  display: inline-block;
  width: 18px;
  font-weight: 800;
  color: #94a3b8;
}

.agent-material-opt-correct .agent-material-opt-mark { color: #34d399; }

.agent-evidence-label {
  font-weight: 800;
  color: #fbbf24;
}

.agent-meta {
  font-size: 11px;
  color: var(--hint-color);
  margin-top: 6px;
  word-break: break-word;
}

.agent-error-text {
  color: #f87171;
  font-size: 11px;
}

/* Диф «было → станет» */
.agent-diff {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.agent-diff-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--hint-color);
  margin-bottom: 6px;
}

.agent-diff-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

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

.agent-diff-key {
  font-weight: 800;
  font-size: 11px;
  color: var(--hint-color);
  min-width: 90px;
}

.agent-diff-old {
  color: #f87171;
  text-decoration: line-through;
  word-break: break-word;
}

.agent-diff-arrow { color: var(--hint-color); }

.agent-diff-new {
  color: #34d399;
  font-weight: 700;
  word-break: break-word;
}

.agent-diff-null { color: var(--hint-color); }

/* Кнопки */
.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.agent-btn {
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  font-size: 12px;
  font-weight: 800;
  padding: 9px 14px;
  cursor: pointer;
}

.agent-btn:active { transform: scale(0.97); }

.agent-btn-primary {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.agent-btn-approve {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.agent-btn-reject {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.agent-btn-rollback {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.agent-btn-ghost {
  background: transparent;
  color: var(--hint-color);
}

/* Фильтры и формы */
.agent-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.agent-select {
  max-width: 220px;
  padding: 8px 10px !important;
  font-size: 12px !important;
}

.agent-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.agent-field { display: flex; flex-direction: column; gap: 5px; }

.agent-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint-color);
}

.agent-field-wide { grid-column: 1 / -1; }

.agent-form-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.agent-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--hint-color);
}

/* Таблицы (прогоны, журнал) */
.agent-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.agent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.agent-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--hint-color);
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.agent-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  vertical-align: top;
}

.agent-table tr:last-child td { border-bottom: none; }

.agent-td-nowrap { white-space: nowrap; font-size: 11px; color: var(--hint-color); }
.agent-td-stats { font-size: 11px; color: var(--hint-color); word-break: break-word; max-width: 220px; }

/* Кампании: тексты рассылки */
.agent-campaign-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 6px;
  word-break: break-word;
}

.agent-campaign-texts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.agent-campaign-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 7px 9px;
  word-break: break-word;
}

.agent-lang-chip {
  display: inline-block;
  font-size: 9px;
  font-weight: 900;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 4px;
  vertical-align: 1px;
}

/* Опросы: полосы результатов */
.agent-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.agent-bar-label {
  font-size: 12px;
  color: var(--text-color);
  margin-bottom: 3px;
}

.agent-bar-count {
  font-size: 11px;
  color: var(--hint-color);
}

.agent-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.agent-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.7), rgba(245, 158, 11, 0.8));
  transition: width 0.4s ease;
}

/* Пустые состояния */
.agent-empty {
  text-align: center;
  color: var(--hint-color);
  font-size: 13px;
  padding: 22px 12px;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
}

.agent-empty-unavailable {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}

.agent-empty-error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 480px) {
  .agent-form { grid-template-columns: 1fr; }
  .agent-form-row { grid-template-columns: 1fr 1fr; }
}
