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

:root {
  --bg: #0d0d0e;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.03);
  --surface-solid: #1a1b1d;
  --border: #2a2a2a;
  --border-soft: rgba(255, 255, 255, 0.08);
  --emerald: #16c98d;
  --emerald-dim: rgba(22, 201, 141, 0.14);
  --emerald-glow: rgba(22, 201, 141, 0.35);
  --red: #e6453f;
  --red-dim: rgba(230, 69, 63, 0.14);
  --red-glow: rgba(230, 69, 63, 0.4);
  --gold: #d4af6a;
  --gold-dim: rgba(212, 175, 106, 0.12);
  --text: #f2f2f0;
  --text-secondary: #96979d;
  --text-muted: #5f6066;
  --radius: 16px;
  --radius-lg: 22px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* декоративные размытые пятна за интерфейсом — без них backdrop-filter blur
   на карточках был бы не виден: размывать в общем-то нечего на плоском фоне */
.bg-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}
.bg-glow-1 { top: -120px; left: -100px; background: rgba(22, 201, 141, 0.16); }
.bg-glow-2 { bottom: -140px; right: -110px; background: rgba(212, 175, 106, 0.12); }

.hidden { display: none !important; }
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }

#app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }

.screen { display: flex; flex-direction: column; gap: 16px; }

#screen-loading {
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 12px;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#screen-error { text-align: center; padding-top: 15vh; gap: 8px; padding-left: 16px; padding-right: 16px; }
.error-title { font-size: 17px; font-weight: 600; color: var(--red); }
#error-detail {
  white-space: pre-wrap; text-align: left; font-size: 12px; font-family: "Courier New", monospace;
  background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px;
}

/* ---------- шапка и ранг ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 8px; }
.brand { font-family: "Courier New", monospace; font-size: 13px; letter-spacing: 2px; color: var(--text-secondary); }

.level-badge {
  font-weight: 700; font-size: 14px; letter-spacing: 1px;
  color: var(--gold);
  background: var(--gold-dim);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 106, 0.45);
  border-radius: 999px;
  padding: 6px 16px;
  box-shadow: 0 0 18px rgba(212, 175, 106, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------- прогресс ---------- */

.progress-block { display: flex; flex-direction: column; gap: 8px; }
.progress-track {
  height: 10px; border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), #4ce0a8);
  box-shadow: 0 0 14px var(--emerald-glow), 0 0 4px var(--emerald-glow);
  transition: width 0.5s ease;
}

/* ---------- карточки статистики: стекломорфизм ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat-card {
  background: rgba(24, 25, 27, 0.9);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.stat-label { font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 700; font-family: "Courier New", monospace; color: var(--text); }
.stat-value.accent { color: var(--emerald); text-shadow: 0 0 16px var(--emerald-glow); }

/* ---------- антитильт-баннер на дашборде ---------- */

.lockout-banner {
  background: linear-gradient(180deg, rgba(230, 69, 63, 0.12), rgba(230, 69, 63, 0.05));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(230, 69, 63, 0.4);
  border-radius: var(--radius);
  padding: 16px; text-align: center;
  box-shadow: 0 0 24px rgba(230, 69, 63, 0.12);
}
.lockout-title { font-weight: 700; color: var(--red); font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; }
.lockout-timer { font-family: "Courier New", monospace; font-size: 28px; font-weight: 700; color: var(--text); }

/* ---------- кнопки ---------- */

.action-row { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.btn {
  border: none; border-radius: var(--radius); padding: 16px; font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-compact { padding: 11px 16px; font-size: 14px; }

.btn-primary {
  background: linear-gradient(135deg, var(--emerald), #0fa374);
  color: #06251b;
  box-shadow: 0 6px 20px rgba(22, 201, 141, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:active { box-shadow: 0 3px 10px rgba(22, 201, 141, 0.24); }

.btn-danger {
  background: linear-gradient(135deg, var(--red), #b8322d);
  color: #fff2f1;
  box-shadow: 0 6px 20px rgba(230, 69, 63, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-danger:active { box-shadow: 0 3px 10px rgba(230, 69, 63, 0.24); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
}
.btn-ghost:active { background: var(--surface); }

/* ---------- модалки ---------- */

.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-card {
  background: rgba(20, 21, 23, 0.97);
  overflow-x: hidden;
  border: 1px solid var(--border-soft);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 24px 18px 30px;
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
  max-height: var(--modal-max-h, 88vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* нижний отступ под клавиатуру — переопределяется из JS через --kb-inset,
     когда на iOS всплывает виртуальная клавиатура и перекрывает поля ввода */
  padding-bottom: calc(30px + var(--kb-inset, 0px));
  transition: padding-bottom 0.2s ease;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-text { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* антитильт — отдельная, тревожная тема поверх обычной модалки */
.modal-card.modal-danger {
  background: linear-gradient(180deg, rgba(58, 18, 17, 0.92), rgba(24, 12, 12, 0.92));
  border: 1px solid rgba(230, 69, 63, 0.45);
  box-shadow: 0 -8px 50px rgba(230, 69, 63, 0.22), 0 0 0 1px rgba(230, 69, 63, 0.08) inset;
}
.modal-title-danger { color: #ff8b86; }

/* ---------- поля формы ---------- */

.field-label { font-size: 12px; letter-spacing: 0.3px; color: var(--text-secondary); margin-top: 10px; }
.field {
  background: var(--surface-2);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: var(--text-muted); }
textarea.field { resize: vertical; min-height: 90px; }
.field:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-dim);
}

/* ---------- сегментированные переключатели ---------- */

.segmented { display: flex; gap: 8px; }
.segmented-2x2 { flex-wrap: wrap; }

.seg-btn {
  flex: 1 1 0; min-width: 0;
  background: var(--surface-2);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

/* Long/Short: смысловые зелёный/красный при выборе */
.seg-direction { position: relative; padding-left: 22px; }
.seg-direction::before {
  content: "";
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.seg-direction[data-direction="buy"]::before { background: var(--text-muted); }
.seg-direction[data-direction="sell"]::before { background: var(--text-muted); }

.seg-direction[data-direction="buy"].selected {
  border-color: var(--emerald);
  color: var(--emerald);
  background: var(--emerald-dim);
  box-shadow: 0 0 16px var(--emerald-glow);
}
.seg-direction[data-direction="buy"].selected::before {
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}
.seg-direction[data-direction="sell"].selected {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
  box-shadow: 0 0 16px var(--red-glow);
}
.seg-direction[data-direction="sell"].selected::before {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

/* настроение — нейтральный золотой акцент, чтобы не путать с direction */
.seg-btn[data-mood].selected {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 14px rgba(212, 175, 106, 0.25);
}

.error-text { color: var(--red); font-size: 13px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(26, 27, 29, 0.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

/* ================================================================
   Расширение дашборда: сетка действий, лидерборд, лента, шеринг
   ================================================================ */

/* ---------- крупные первичные кнопки ---------- */

.action-primary { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.btn-lg { padding: 17px; font-size: 15.5px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-icon { font-size: 17px; line-height: 1; }

/* пульсация на кнопке антитильта — заметно, но не раздражающе */
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(230, 69, 63, 0.28), 0 0 0 0 rgba(230, 69, 63, 0.45); }
  50% { box-shadow: 0 6px 20px rgba(230, 69, 63, 0.28), 0 0 0 8px rgba(230, 69, 63, 0); }
}
.btn-pulse { animation: btn-pulse 2.4s ease-in-out infinite; }

/* ---------- сетка второстепенных действий 2x2 ---------- */

.action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.action-tile {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-height: 84px;
}
.action-tile:active { transform: scale(0.97); border-color: rgba(255, 255, 255, 0.18); }
.action-tile-icon { font-size: 22px; line-height: 1; }
.action-tile-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); line-height: 1.3; }

/* ---------- общие элементы модалок: заголовок с крестиком, скролл-список ---------- */

.modal-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.modal-tall { max-height: 82vh; }

.scroll-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 6px 0;
  padding-right: 2px;
}

/* ---------- лидерборд ---------- */

.leaderboard-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 14px;
}
.leaderboard-rank {
  font-family: "Courier New", monospace; font-weight: 700; font-size: 14px;
  color: var(--text-muted);
  width: 22px; flex-shrink: 0;
}
.leaderboard-row:nth-child(1) .leaderboard-rank { color: var(--gold); }
.leaderboard-row:nth-child(2) .leaderboard-rank { color: #c7c9cf; }
.leaderboard-row:nth-child(3) .leaderboard-rank { color: #b8875a; }
.leaderboard-name { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-pct { font-family: "Courier New", monospace; font-weight: 700; color: var(--emerald); font-size: 14px; }

/* ---------- лента тильта и побед ---------- */

.feed-tabs { margin-bottom: 4px; }
.feed-tab { flex: 1; }
.feed-tab.selected { border-color: var(--text-secondary); color: var(--text); background: var(--surface); }
.feed-tab[data-feed-kind="win"].selected { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-dim); }
.feed-tab[data-feed-kind="tilt"].selected { border-color: var(--red); color: var(--red); background: var(--red-dim); }

.feed-item {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--text-muted);
  border-radius: 10px;
  padding: 10px 14px;
}
.feed-item.feed-win { border-left-color: var(--emerald); }
.feed-item.feed-tilt { border-left-color: var(--red); }
.feed-item-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.feed-item.feed-win .feed-item-meta { color: var(--emerald); }
.feed-item.feed-tilt .feed-item-meta { color: var(--red); }
.feed-item-text { font-size: 14px; line-height: 1.4; }

/* переиспользуем seg-btn под выбор типа поста/вкладки ленты, но с зелёным/красным
   по атрибуту data-feed-post-kind — независимо от data-direction формы сделки */
.seg-btn[data-feed-post-kind="win"].selected { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-dim); box-shadow: 0 0 16px var(--emerald-glow); }
.seg-btn[data-feed-post-kind="tilt"].selected { border-color: var(--red); color: var(--red); background: var(--red-dim); box-shadow: 0 0 16px var(--red-glow); }

/* ---------- карточка недели (шеринг) ---------- */

.share-card-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 180px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}
.share-card-img { width: 100%; display: block; border-radius: 14px; }

/* ---------- мобильная адаптация: без горизонтальных скроллов, монолитно ---------- */

@media (max-width: 380px) {
  .action-grid { gap: 8px; }
  .action-tile { padding: 12px 8px; min-height: 76px; }
  .action-tile-label { font-size: 11px; }
}

@media (min-width: 560px) {
  #app { max-width: 520px; }
}

/* ================================================================
   Мои правила + Общая статистика
   ================================================================ */

.rule-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.rule-row:active { border-color: rgba(255, 255, 255, 0.2); }
.rule-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.rule-edit-hint { font-size: 11px; color: var(--text-muted); flex-shrink: 0; padding-top: 1px; }

.stats-section { margin-bottom: 4px; }
.stats-section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); margin-bottom: 8px; margin-top: 14px;
}
.stats-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}
.stats-row:last-child { border-bottom: none; }
.stats-row-label { color: var(--text-secondary); }
.stats-row-value { font-family: "Courier New", monospace; font-weight: 700; }
.stats-row-value.accent { color: var(--emerald); }

.insight-item {
  background: var(--gold-dim);
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.week-bar-row { display: flex; align-items: center; gap: 8px; font-size: 11px; margin-bottom: 4px; font-family: "Courier New", monospace; }
.week-bar-date { color: var(--text-muted); width: 44px; flex-shrink: 0; }
.week-bar-track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.week-bar-fill { height: 100%; background: linear-gradient(90deg, var(--emerald), #4ce0a8); border-radius: 999px; }
.week-bar-pct { width: 36px; text-align: right; color: var(--text-secondary); flex-shrink: 0; }

/* ================================================================
   Таб-бар и вкладки
   ================================================================ */

#app { padding-bottom: 90px; } /* место под фиксированный таб-бар */

.tab-page { display: flex; flex-direction: column; gap: 16px; }

.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  display: flex;
  background: rgba(18, 19, 21, 0.96);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-soft);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
}
.tab-bar-btn {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 12px;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.tab-bar-btn.selected { color: var(--emerald); background: var(--emerald-dim); }
.tab-bar-icon { width: 22px; height: 22px; color: var(--text-muted); transition: color 0.15s ease; }
.tab-bar-btn.selected .tab-bar-icon { color: var(--emerald); }
.tab-bar-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }

.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 10px; }

.scroll-list-tall { max-height: none; }

/* ---------- профиль: доп. сетка (цитата/новости/поддержка) ---------- */

.profile-more-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  margin-top: 16px;
}
.profile-more-grid .action-tile { min-height: 68px; padding: 10px 6px; }
.profile-more-grid .action-tile-icon { font-size: 18px; }
.profile-more-grid .action-tile-label { font-size: 10.5px; }

/* ---------- мои позиции ---------- */

.position-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.position-row:active { border-color: rgba(255, 255, 255, 0.2); }
.position-mark { font-size: 15px; flex-shrink: 0; }
.position-main { flex: 1; min-width: 0; }
.position-symbol { font-weight: 700; font-size: 14px; }
.position-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.position-risk { font-family: "Courier New", monospace; font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }

.positions-pager { display: flex; gap: 8px; margin-top: 10px; }
.positions-pager .btn { flex: 1; }

/* деталка позиции внутри модалки */
.position-detail-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.position-detail-row:last-child { border-bottom: none; }
.position-detail-label { color: var(--text-secondary); }
.position-detail-comment { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.position-detail-violation { color: var(--red); font-size: 13px; margin-top: 4px; }

/* ================================================================
   Живой фон: деликатные дрейфующие элементы
   ================================================================ */

.float-layer {
  position: fixed; inset: 0; overflow: hidden;
  z-index: 0; pointer-events: none;
}
.float-el {
  position: absolute;
  font-size: 42px;
  font-family: "Courier New", monospace;
  font-weight: 700;
  color: var(--emerald);
  opacity: 0.05;
  will-change: transform;
}
.f1 { top: 8%;  left: 10%; animation: drift1 34s ease-in-out infinite; }
.f2 { top: 22%; left: 78%; color: var(--gold); animation: drift2 40s ease-in-out infinite; font-size: 30px; }
.f3 { top: 55%; left: 6%;  animation: drift3 46s ease-in-out infinite; font-size: 26px; }
.f4 { top: 68%; left: 85%; color: var(--red); animation: drift1 38s ease-in-out infinite reverse; font-size: 28px; }
.f5 { top: 40%; left: 45%; animation: drift2 50s ease-in-out infinite; font-size: 34px; }
.f6 { top: 82%; left: 30%; color: var(--gold); animation: drift3 42s ease-in-out infinite reverse; font-size: 24px; }

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(18px, -26px) rotate(8deg); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-22px, 20px) rotate(-6deg); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(14px, 24px) rotate(5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .float-el { animation: none; }
}

/* ================================================================
   Фикс горизонтального скролла: длинный текст не должен раздувать контейнер
   ================================================================ */

.leaderboard-name, .position-symbol, .stats-row-label, .stats-row-value,
.rule-text, .feed-item-text, .insight-item, .position-detail-comment,
.action-tile-label, .tab-bar-label {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.leaderboard-row, .position-row, .stats-row { min-width: 0; }
.leaderboard-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }

/* ================================================================
   Кнопки пагинации: явное disabled-состояние (иначе не отличить от бага)
   ================================================================ */

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none !important;
  pointer-events: none;
}
.positions-pager { margin-bottom: 8px; } /* доп. отступ от нижнего таб-бара */

/* ================================================================
   Загрузка скриншота в форму сделки
   ================================================================ */

.upload-zone {
  position: relative;
  border: 1.5px dashed var(--border-soft);
  border-radius: 14px;
  min-height: 110px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
}
.upload-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2;
}
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); pointer-events: none; }
.upload-icon { font-size: 24px; }
.upload-text { font-size: 12px; }
.upload-preview { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.upload-remove {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.6); color: #fff; border: none;
  font-size: 13px; cursor: pointer;
}

/* ================================================================
   Фильтры в Журнале
   ================================================================ */

.journal-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }

/* тот самый баг: базовый .seg-btn просит min-width:45%, для 3 кнопок это 135% —
   отсюда обрезание. Здесь кнопок три и им нужно делить ширину строго на 3, без wrap. */
#filter-period { flex-wrap: nowrap; }
#filter-period .seg-btn {
  min-width: 0;
  flex: 1 1 0;
  padding: 10px 2px;
  font-size: 11.5px;
  white-space: nowrap;
}
.field-select { appearance: none; background-image: none; }

/* ================================================================
   Редизайн ачивок: строго, минимально, без пёстрых эмодзи
   ================================================================ */

.achievement-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border-soft);
}
.achievement-row:last-child { border-bottom: none; }
.achievement-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-muted);
}
.achievement-row.earned .achievement-dot {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald-glow);
}
.achievement-title {
  flex: 1; min-width: 0; font-size: 13.5px;
  color: var(--text-secondary);
}
.achievement-row.earned .achievement-title { color: var(--text); }
.achievement-status {
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--text-muted); flex-shrink: 0;
}
.achievement-row.earned .achievement-status { color: var(--gold); }

.position-detail-photo-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); margin-bottom: 10px;
}
.position-detail-photo { width: 100%; display: block; border-radius: 12px; }

/* ================================================================
   Доп. позиции и стили для расширенного живого фона (было мало и тускло)
   ================================================================ */

.f7  { top: 4%;  left: 45%; color: var(--emerald); animation: drift2 44s ease-in-out infinite; font-size: 22px; opacity: 0.06; }
.f8  { top: 30%; left: 20%; color: var(--gold);    animation: drift3 36s ease-in-out infinite; font-size: 32px; opacity: 0.06; }
.f9  { top: 15%; left: 62%; color: var(--emerald); animation: drift1 48s ease-in-out infinite reverse; font-size: 20px; opacity: 0.055; }
.f10 { top: 60%; left: 60%; color: var(--emerald); animation: drift2 32s ease-in-out infinite reverse; font-size: 24px; opacity: 0.06; }
.f11 { top: 88%; left: 60%; color: var(--red);     animation: drift1 40s ease-in-out infinite; font-size: 22px; opacity: 0.05; }
.f12 { top: 75%; left: 12%; color: var(--gold);    animation: drift3 30s ease-in-out infinite; font-size: 28px; opacity: 0.055; }

/* ================================================================
   Главная: компактная строка быстрых ссылок (вместо крупных плиток)
   ================================================================ */

.quick-links { display: flex; gap: 10px; margin-top: 2px; }
.quick-link {
  flex: 1; min-width: 0;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 11px 8px;
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
}
.quick-link:active { border-color: rgba(255, 255, 255, 0.2); }
.quick-link-icon { font-size: 14px; }

/* ================================================================
   Профиль: внутренние подвкладки (Ачивки / Правила / Ещё)
   ================================================================ */

.profile-subnav { margin-top: 2px; }
.profile-section { display: flex; flex-direction: column; gap: 10px; }

.action-tile-wide {
  width: 100%; flex-direction: row; justify-content: center; gap: 10px;
  min-height: 54px;
}

/* ================================================================
   Редизайн главной: единая control-panel вместо разрозненных плашек,
   компактные quick-action вместо гигантских кнопок
   ================================================================ */

.control-panel {
  background: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px 18px 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.control-panel-top { display: flex; align-items: center; justify-content: space-between; }

.level-pill {
  display: inline-block; margin-top: 4px;
  font-weight: 700; font-size: 16px; letter-spacing: 1px;
  color: var(--gold);
}

.control-panel-stats { display: flex; align-items: center; margin-top: 4px; }
.control-stat { flex: 1; min-width: 0; text-align: center; }
.control-stat-value { font-size: 21px; font-weight: 700; font-family: "Courier New", monospace; color: var(--text); }
.control-stat-value.accent { color: var(--emerald); text-shadow: 0 0 14px var(--emerald-glow); }
.control-stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); margin-top: 3px; }
.control-stat-divider { width: 1px; height: 30px; background: var(--border-soft); }

.quick-actions { display: flex; gap: 10px; margin-top: 2px; }
.quick-action {
  flex: 1; min-width: 0;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.quick-action:active { transform: scale(0.97); }
.quick-action-icon { width: 20px; height: 20px; }
.quick-action-primary { border-color: rgba(22, 201, 141, 0.3); color: var(--text); }
.quick-action-primary .quick-action-icon { color: var(--emerald); }
.quick-action-danger { border-color: rgba(230, 69, 63, 0.28); color: var(--text); }
.quick-action-danger .quick-action-icon { color: var(--red); }

.quick-link-icon-svg { width: 15px; height: 15px; flex-shrink: 0; }
.quick-link { gap: 7px; }

.action-tile-icon-svg { width: 21px; height: 21px; color: var(--text-secondary); }
.btn-icon-svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }

/* ================================================================
   Минималистичные статус-индикаторы вместо ✅/⚠️/🟢/🔴 в списках
   ================================================================ */

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.ok { background: var(--emerald); box-shadow: 0 0 6px var(--emerald-glow); }
.status-dot.warn { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }

.position-photo-icon { width: 13px; height: 13px; vertical-align: -2px; color: var(--gold); display: inline-block; }

/* ================================================================
   Виджет "Сегодня" — заполняет место, освобождённое от гигантских кнопок
   ================================================================ */

.today-widget {
  background: linear-gradient(160deg, rgba(255,255,255,0.065), rgba(255,255,255,0.02));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.today-widget-header { display: flex; align-items: center; justify-content: space-between; }
.today-widget-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); font-weight: 700; }
.today-widget-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--emerald-dim); color: var(--emerald);
  border: 1px solid rgba(22,201,141,0.3);
}
.today-widget-badge.warn { background: var(--red-dim); color: var(--red); border-color: rgba(230,69,63,0.3); }
.today-widget-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.today-widget-value { font-family: "Courier New", monospace; font-weight: 700; font-size: 16px; }
.today-widget-divider { height: 1px; background: var(--border-soft); }
.today-widget-last { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.today-widget-last b { color: var(--text); }

/* ================================================================
   Антитильт — теперь строка в Профиле, не гигантская кнопка на главной
   ================================================================ */

.profile-antitilt-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: var(--red-dim);
  border: 1px solid rgba(230,69,63,0.35);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--red);
  font-size: 12.5px; font-weight: 600; text-align: left;
  cursor: pointer;
}
.profile-antitilt-row:active { border-color: rgba(230,69,63,0.55); }
.profile-antitilt-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ================================================================
   Форма стратегии: часы через input[type=time]
   ================================================================ */

.hours-row { display: flex; align-items: center; gap: 8px; }
.hours-row .field { flex: 1 1 0; min-width: 0; }

.strategy-row {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.strategy-row.active { border-color: rgba(22,201,141,0.4); }
.strategy-row-top { display: flex; align-items: center; justify-content: space-between; }
.strategy-row-name { font-weight: 700; font-size: 14px; }
.strategy-row-badge { font-size: 10px; font-weight: 700; color: var(--emerald); letter-spacing: 0.3px; }
.strategy-row-meta { font-size: 12px; color: var(--text-muted); font-family: "Courier New", monospace; }

/* ================================================================
   Триал-баннер (глобальный, поверх всех вкладок)
   ================================================================ */

/* ================================================================
   Подменю профиля — теперь 5 пунктов, тот же баг что чинили с фильтрами
   ================================================================ */

#profile-subnav .seg-btn { min-width: 0; flex: 1 1 0; padding: 9px 3px; font-size: 11px; }

/* ================================================================
   Чекбоксы инструментов в форме стратегии
   ================================================================ */

.instrument-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.instrument-check {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 8px 6px;
  font-size: 11.5px; color: var(--text-secondary);
  cursor: pointer;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.instrument-check input { accent-color: var(--emerald); width: 14px; height: 14px; flex-shrink: 0; }
.instrument-check:has(input:checked) { border-color: rgba(22,201,141,0.4); color: var(--text); }

/* ================================================================
   Мультизагрузка скриншотов — превью-полоска
   ================================================================ */

.upload-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.upload-thumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-soft); }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb-remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff; border: none;
  font-size: 10px; cursor: pointer; line-height: 1;
}

/* ================================================================
   Галерея скриншотов (карусель с зумом по клику)
   ================================================================ */

.modal-gallery-card { padding-bottom: 20px; overflow: hidden; overscroll-behavior: contain; }
.gallery-viewport {
  display: flex; align-items: center; justify-content: center;
  min-height: 240px; max-height: 60vh;
  border-radius: 12px; overflow: hidden;
  background: var(--surface-2);
  touch-action: none;
}
.gallery-viewport.zoomed-active { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.gallery-viewport img { width: 100%; max-height: 60vh; object-fit: contain; touch-action: none; }
.gallery-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 10px; }

.position-gallery-strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; }
.position-gallery-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border-soft); cursor: pointer; }

/* ================================================================
   Админка внутри Профиля
   ================================================================ */

.admin-overview-stats { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px; margin-bottom: 4px; }

.admin-user-row {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 11px 14px; cursor: pointer;
}
.admin-user-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-user-name { font-weight: 700; font-size: 13.5px; }
.admin-user-meta { font-size: 11px; color: var(--text-muted); font-family: "Courier New", monospace; }
.admin-status-badge { font-size: 9.5px; font-weight: 700; letter-spacing: 0.3px; padding: 3px 8px; border-radius: 999px; flex-shrink: 0; }
.admin-status-badge.trial { background: var(--gold-dim); color: var(--gold); }
.admin-status-badge.subscribed { background: var(--emerald-dim); color: var(--emerald); }
.admin-status-badge.expired { background: var(--red-dim); color: var(--red); }

.admin-detail-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.admin-detail-row:last-child { border-bottom: none; }

/* ================================================================
   Экран блокировки
   ================================================================ */

#screen-blocked { text-align: center; padding-top: 22vh; align-items: center; }

.blocked-reason-card {
  margin-top: 16px;
  background: var(--red-dim);
  border: 1px solid rgba(230,69,63,0.35);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
}
#blocked-reason { color: var(--text); font-size: 14px; margin-top: 6px; }

/* ================================================================
   iOS: блокировка фонового скролла, пока открыта модалка
   ================================================================ */

body.modal-open-lock {
  position: fixed;
  left: 0; right: 0;
  width: 100%;
  overflow: hidden;
}

/* ================================================================
   Разворот чек-листа/правил на весь экран
   ================================================================ */

.field-expand-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.field-expand-btn {
  background: none; border: none; color: var(--emerald);
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  padding: 10px 2px; width: 100%; text-align: left;
}
.modal-fullscreen .modal-card {
  max-width: 100%; width: 100%; height: 100%; max-height: 100%;
  border-radius: 0; margin: 0;
  display: flex; flex-direction: column;
}
.modal-fullscreen .field-fullscreen-textarea { flex: 1; resize: none; font-size: 15px; line-height: 1.6; }

/* ================================================================
   Фирменный водяной знак-логотип на фоне
   ================================================================ */

.brand-bg {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(180deg, rgba(13,13,14,0.94) 0%, rgba(13,13,14,0.88) 40%, rgba(13,13,14,0.96) 100%),
    url("bg-brand.jpg");
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* ================================================================
   Редизайн главной панели статистики — премиальнее, с явным риском
   ================================================================ */

.control-panel { position: relative; overflow: hidden; }
.control-panel::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 85% -10%, rgba(22,201,141,0.14), transparent 55%);
  pointer-events: none;
}
.control-stat-risk-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--border-soft);
  font-size: 12px;
}
.control-stat-risk-value { font-family: "Courier New", monospace; font-weight: 700; color: var(--text); }
.control-stat-risk-value.empty { color: var(--text-muted); font-weight: 400; }

/* ================================================================
   Админка: точная дата подписки/триала в списке
   ================================================================ */

.admin-user-expiry { font-size: 10.5px; color: var(--text-muted); font-family: "Courier New", monospace; margin-top: 2px; }
.admin-detail-actions-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 8px; }

/* ================================================================
   Быстрый выбор инструмента / стратегии в форме сделки
   ================================================================ */

.quick-pick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.quick-pick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.quick-pick-tile {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 9px 4px;
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; text-align: center;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quick-pick-row .quick-pick-tile { flex: 0 0 auto; padding: 8px 12px; }
.quick-pick-tile.selected { border-color: rgba(22,201,141,0.45); color: var(--emerald); background: var(--emerald-dim); }

.seg-outcome[data-outcome="tp"].selected { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-dim); }
.seg-outcome[data-outcome="sl"].selected { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.seg-outcome[data-outcome="be"].selected { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }

.position-outcome-badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px;
}
.position-outcome-badge.tp { background: var(--emerald-dim); color: var(--emerald); }
.position-outcome-badge.sl { background: var(--red-dim); color: var(--red); }
.position-outcome-badge.be { background: var(--gold-dim); color: var(--gold); }

/* ================================================================
   Скриншоты по категориям: Контекст / Вход / Результат
   ================================================================ */

.photo-slots-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-slot {
  position: relative;
  min-width: 0;
  border: 1.5px dashed var(--border-soft);
  border-radius: 12px;
  min-height: 88px;
  background: var(--surface-2);
  overflow: hidden;
}
.photo-slot:has(.photo-slot-preview:not(.hidden)) { border-style: solid; border-color: rgba(22,201,141,0.4); }

/* Инпут спрятан "визуально", но не display:none — так <label for=...> гарантированно
   его открывает в любом браузере/webview, в отличие от старой схемы с
   position:absolute поверх блока (та была хрупкой и местами не ловила тап). */
.visually-hidden-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.photo-slot-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; width: 100%; height: 100%; min-height: 88px;
  color: var(--text-muted); padding: 4px; cursor: pointer;
}
.upload-icon-svg { width: 16px; height: 16px; }
.photo-slot-label { font-size: 9.5px; text-align: center; line-height: 1.25; }
.photo-slot-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot-remove {
  position: absolute; top: 4px; right: 4px; z-index: 3;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff; border: none;
  font-size: 10px; cursor: pointer;
}

.position-gallery-item { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.position-gallery-caption { font-size: 9.5px; color: var(--text-muted); }

/* ================================================================
   Пейволл: сравнение FREE / PRO
   ================================================================ */

.plan-compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 14px 0; }
.plan-col {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 14px; padding: 14px 12px;
}
.plan-col-pro { border-color: rgba(212,175,106,0.4); background: var(--gold-dim); }
.plan-col-title { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.plan-col-pro .plan-col-title { color: var(--gold); }
.plan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-list li {
  font-size: 12px; color: var(--text-secondary); padding-left: 14px; position: relative;
}
.plan-list li::before { content: "•"; position: absolute; left: 0; color: var(--text-muted); }
.plan-col-pro .plan-list li { color: var(--text); }
.plan-col-pro .plan-list li::before { content: "✓"; color: var(--gold); }

.field-required { color: var(--red); font-weight: 700; }

/* ================================================================
   Контекст сделки: горизонтальная полоса миниатюр вместо одного слота
   ================================================================ */

.context-photos-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  min-height: 90px;
}
.context-photos-row .photo-slot { flex: 0 0 auto; width: 84px; min-width: 84px; height: 84px; }
.photo-slot-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 4px; cursor: pointer;
  color: var(--emerald);
  border-color: rgba(22,201,141,0.45);
}

/* Перетаскивание файла с компьютера прямо в зону скриншотов (Контекст/Вход/
   Результат) — подсветка, пока файл занесён над областью. */
.context-photos-row.drag-over {
  outline: 2px dashed var(--emerald);
  outline-offset: 2px;
  border-radius: 12px;
}

/* Подсказку про Ctrl+V показываем только на устройствах с мышью/трекпадом —
   на телефоне вставка из буфера не нужна, там и так есть кнопка "Добавить". */
@media (pointer: coarse) {
  #paste-hint { display: none; }
}

/* ---------- Обучение: интерактивный тур с подсветкой реальных элементов ---------- */
.onboarding-tour {
  position: fixed;
  inset: 0;
  z-index: 500;
}
.onboarding-tour-highlight {
  position: fixed;
  border: 2px solid var(--red);
  border-radius: 14px;
  pointer-events: none;
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
  animation: onboarding-pulse 1.4s ease-in-out infinite;
}
@keyframes onboarding-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(4, 6, 10, 0.74), 0 0 0 0 var(--red-glow); }
  50% { box-shadow: 0 0 0 9999px rgba(4, 6, 10, 0.74), 0 0 0 7px var(--red-glow); }
}
.onboarding-tour-tip {
  position: fixed;
  z-index: 501;
  width: 250px;
  max-width: calc(100vw - 32px);
  background: rgba(20, 21, 23, 0.98);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  transition: top 0.25s ease, left 0.25s ease;
}
.onboarding-tip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.onboarding-tip-step {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.onboarding-tip-skip {
  background: none;
  border: none;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.onboarding-tip-skip:active { opacity: 0.6; }
.onboarding-tip-text {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 10px;
}
.onboarding-tip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.onboarding-tip-actions .btn { padding: 8px 14px; }

.photo-slots-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.context-thumb-remove {
  position: absolute; top: 4px; right: 4px; z-index: 3;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff; border: none;
  font-size: 10px; cursor: pointer;
}

/* ================================================================
   Автотильт — предупреждение об отклонении от системы
   ================================================================ */

.tilt-warning-reasons { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.tilt-warning-reasons .reason-item {
  font-size: 13px; color: var(--text-secondary); padding-left: 16px; position: relative;
}
.tilt-warning-reasons .reason-item::before { content: "•"; position: absolute; left: 0; color: var(--red); }

.tilt-warning-stats { display: flex; gap: 10px; margin: 12px 0; }
.tilt-warning-stat {
  flex: 1; background: var(--red-dim); border: 1px solid rgba(230,69,63,0.3);
  border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px;
}
.tilt-warning-r { font-size: 20px; font-weight: 700; font-family: "Courier New", monospace; color: var(--red); }

/* ================================================================
   Причина активации антитильта — осознанный выбор перед блокировкой
   ================================================================ */

.tilt-reason-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.tilt-reason-btn {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 12px 14px;
  color: var(--text-secondary); font-size: 13.5px; text-align: left;
  cursor: pointer;
}
.tilt-reason-btn.selected { border-color: rgba(230,69,63,0.5); color: var(--text); background: var(--red-dim); }

.lockout-reason { margin-top: 6px; font-size: 12px; color: var(--text-secondary); }

.leaderboard-formula { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 4px; }
.leaderboard-formula-row {
  display: flex; justify-content: space-between; font-size: 12px;
  color: var(--text-secondary); padding: 4px 0; border-bottom: 1px solid var(--border-soft);
}
.leaderboard-formula-row b { color: var(--emerald); }

/* ================================================================
   О проекте / Руководство
   ================================================================ */

.about-section { margin: 14px 0; }
.about-section-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.about-section-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

/* ================================================================
   Чек-лист стратегии внутри формы сделки
   ================================================================ */

.trade-checklist {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 12px 14px; margin-top: 4px;
}
.trade-checklist-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 0; font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
}
.trade-checklist-item input { margin-top: 2px; accent-color: var(--emerald); width: 16px; height: 16px; flex-shrink: 0; }
.trade-checklist-item.checked { color: var(--text); }

.checklist-summary { margin: 10px 0; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; }
.checklist-summary-title { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.checklist-summary-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 0; color: var(--text-secondary); }
.checklist-summary-item.done { color: var(--text); }

/* ================================================================
   Пейволл: 3 колонки FREE/PRO/ULTRA
   ================================================================ */

.plan-compare-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.plan-compare-3 .plan-col { padding: 10px 8px; }
.plan-compare-3 .plan-list li { font-size: 10.5px; }
.plan-col-ultra { border-color: rgba(22,201,141,0.4); background: var(--emerald-dim); }
.plan-col-ultra .plan-col-title { color: var(--emerald); }
.plan-col-ultra .plan-list li::before { content: "✓"; color: var(--emerald); }
.plan-soon {
  display: inline-block; font-size: 8.5px; font-weight: 700; letter-spacing: 0.3px;
  color: var(--gold); background: var(--gold-dim); border-radius: 999px;
  padding: 1px 5px; margin-left: 4px; vertical-align: middle;
}

.admin-support-actions { display: flex; gap: 8px; margin-top: 8px; }
.admin-support-actions .btn { flex: 1; }

/* ================================================================
   Компактный бейдж тарифа — вместо баннера во всю ширину
   ================================================================ */

.tier-badge {
  flex-shrink: 0;
  background: rgba(212,175,106,0.14);
  border: 1px solid rgba(212,175,106,0.35);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 10.5px; font-weight: 700;
  color: var(--gold);
  cursor: pointer;
  white-space: nowrap;
}
.tier-badge.tier-badge-pro {
  background: rgba(22,201,141,0.14); border-color: rgba(22,201,141,0.35); color: var(--emerald);
  cursor: default;
}
.tier-badge.tier-badge-warn {
  background: rgba(230,69,63,0.16); border-color: rgba(230,69,63,0.4); color: var(--red);
}

/* ================================================================
   Быстрая выдача/отзыв доступа по Telegram ID в админке
   ================================================================ */

.admin-quick-grant {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 14px; padding: 12px 14px; margin-top: 10px;
}
.admin-quick-grant-actions { display: flex; gap: 8px; margin-top: 8px; }
.admin-quick-grant-actions .btn { flex: 1; }

.admin-detail-id-row { align-items: center; }
.admin-id-copy {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; color: var(--text); font-family: "Courier New", monospace;
  padding: 3px 8px; background: var(--surface-2); border-radius: 8px;
}
.admin-id-copy svg { color: var(--text-muted); }

/* ================================================================
   Отдельный экран AI-аналитики
   ================================================================ */

.ai-dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ai-dashboard-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.ai-dashboard-body { margin-bottom: 14px; }

/* ================================================================
   Экран AI: чипы стратегий, история разборов
   ================================================================ */

.ai-strategy-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.ai-strategy-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; color: var(--text-secondary);
  cursor: pointer;
}
.ai-strategy-chip input { accent-color: var(--emerald); width: 14px; height: 14px; }
.ai-strategy-chip:has(input:checked) { border-color: rgba(22,201,141,0.4); color: var(--text); }
.ai-photos-toggle { border-radius: 12px; width: 100%; margin-top: 4px; }

.ai-history-item {
  border-bottom: 1px solid var(--border-soft); padding: 10px 0;
}
.ai-history-item-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.ai-history-toggle { color: var(--text-muted); font-size: 12px; }
.ai-history-text { margin-top: 6px; }

.ai-history-delete { width: 100%; margin-top: 8px; }
