/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Палитра утверждена 26.08.2026, эталон — mini_app/design/market_reference.html.
   Старые имена переменных сохранены намеренно: их используют 1800 строк стилей,
   переименование потребовало бы трогать всё и ломать то, что работает.
   Меняются только значения. */
:root {
  --bg:        #0B0D10;   /* было #0d1117 — глубже, меньше синевы */
  --bg-card:   #12151A;
  --bg-card2:  #171B22;
  --gold:      #F0B429;   /* акцент: только бренд и активная вкладка */
  --gold-dim:  rgba(240, 180, 41, 0.14);
  --gold-border: rgba(240, 180, 41, 0.28);
  --teal:      #5AA9E6;
  --green:     #2FBF71;   /* только рост и прибыль, больше нигде */
  --red:       #E5484D;   /* только падение и убыток */
  --text:      #E8EBF0;
  --text-muted:#7A8394;
  --text-dim:  #4A5261;
  --line:      #1E232B;   /* разделитель вместо рамок-коробок */
  --radius:    9px;       /* было 16px — карточки перестают выглядеть игрушкой */
  --fill-1:    rgba(255,255,255,0.045);  /* лёгкая подложка: чипы, поля */
  --fill-2:    rgba(255,255,255,0.08);   /* активное состояние */
  --fill-3:    rgba(255,255,255,0.13);   /* сильная подложка, бегунки */
  --edge:      rgba(255,255,255,0.08);   /* тонкая граница и разделитель */
  --edge-2:    rgba(255,255,255,0.15);
  --shadow:    rgba(0,0,0,0.35);
  --shadow-strong: rgba(0,0,0,0.5);
  /* Подложки и границы для зелёного/красного/синего строятся от цвета темы, а
     не жёстко: иначе в светлой теме они выцветают в невидимое. */
  --green-dim:    rgba(47,191,113,0.16);
  --green-edge:   rgba(47,191,113,0.40);
  --green-strong: rgba(47,191,113,0.60);
  --red-dim:      rgba(229,72,77,0.16);
  --red-edge:     rgba(229,72,77,0.40);
  --red-strong:   rgba(229,72,77,0.60);
  --teal-dim:     rgba(90,169,230,0.14);
  --teal-edge:    rgba(90,169,230,0.35);
  --nav-h:     60px;
  --header-h:  50px;
}

/* Светлая тема. Не инверсия: зелёный и красный подобраны заново — светлые
   варианты на белом кислотные и теряют контраст. Фон не чисто белый, он бликует
   на телефоне. Акцент уведён в тёмно-янтарный, жёлтый на белом не читается. */
:root[data-theme="light"] {
  --bg:        #F6F7F9;
  --bg-card:   #FFFFFF;
  --bg-card2:  #F0F2F5;
  --gold:      #B07908;
  --gold-dim:  rgba(176, 121, 8, 0.10);
  --gold-border: rgba(176, 121, 8, 0.25);
  --teal:      #2A72B5;
  --green:     #0F8F4E;
  --red:       #C92A2F;
  --text:      #12161C;
  --text-muted:#5C6473;
  --text-dim:  #98A0AE;
  --line:      #E4E7EC;
  /* В светлой теме подложки строятся от ЧЁРНОГО, иначе белое на белом исчезает
     и границы пропадают — ровно то, из-за чего фильтры выглядели размытыми. */
  --fill-1:    rgba(18,22,28,0.035);
  --fill-2:    rgba(18,22,28,0.07);
  --fill-3:    rgba(18,22,28,0.13);
  --edge:      rgba(18,22,28,0.10);
  --edge-2:    rgba(18,22,28,0.18);
  --shadow:    rgba(18,22,28,0.08);
  --shadow-strong: rgba(18,22,28,0.14);
  --green-dim:    rgba(15,143,78,0.12);
  --green-edge:   rgba(15,143,78,0.35);
  --green-strong: rgba(15,143,78,0.55);
  --red-dim:      rgba(201,42,47,0.10);
  --red-edge:     rgba(201,42,47,0.32);
  --red-strong:   rgba(201,42,47,0.50);
  --teal-dim:     rgba(42,114,181,0.10);
  --teal-edge:    rgba(42,114,181,0.32);
}

/* Числа — табличными цифрами с выравниванием по разряду. Самый дешёвый и самый
   заметный шаг от «шаблона» к «инструменту»: колонку цифр становится можно
   читать сверху вниз и сравнивать глазом. */
.num, .value, .price, .pct, .metric-value, [class*="-value"], [class*="-price"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  /* grows with iOS status bar / Telegram safe area */
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg);
  border-bottom: 1px solid var(--edge);
  box-shadow: 0 1px 12px var(--shadow), 0 1px 0 var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  z-index: 100;
}

.header-left {
  /* placeholder — keeps flex balance, reserved for future left controls */
  min-width: 40px;
  flex-shrink: 0;
}

.header-right {
  min-width: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Logo: абсолютно по центру экрана, независимо от ширины left/right */
.header-center {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + var(--header-h) / 2);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  pointer-events: none; /* клики проходят насквозь */
}

.logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 7px;
  flex-shrink: 0;
  align-self: center;
  /* glass container */
  background: var(--fill-1);
  box-shadow: 0 0 0 1px var(--fill-2);
  padding: 3px;
  /* tone down brightness & saturation */
  filter: saturate(0.72) brightness(0.88);
  transition: filter 0.15s, transform 0.15s;
}

.logo-img:active {
  filter: saturate(0.55) brightness(0.75);
  transform: scale(0.92);
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  align-self: center;
}

.status-pill {
  /* Lives in header-right — completely separate from the center logo+text block */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green-edge);
  border-radius: 20px;
  padding: 2px 8px;
  min-width: 28px;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.status-pill.offline {
  color: var(--red);
  background: var(--red-dim);
  border-color: var(--red-edge);
}

/* ===== SCROLL AREA ===== */
.scroll-area.is-loading {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.15s;
}

.scroll-area {
  /* Высоту больше НЕ вычисляем в коде. Три попытки чинить серую полосу внизу
     сводились к арифметике над числами, которые телеграм сообщает с задержкой и
     не всегда: получалось то короче видимой области (снизу зияла пустота), то
     длиннее (низ уезжал под меню). Здесь область просто растянута между шапкой
     и меню — обе закреплены, — и высоту считает браузер по реальному экрану.
     Ошибаться в этом расчёте нечему. */
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior-y: contain;   /* без отскока за край — он и рисовал полосу */
  padding: 12px 12px 0;
  -webkit-overflow-scrolling: touch;
}

/* Хвост под последним блоком: чтобы низ экрана не липнул к меню. */
.nav-spacer { height: 20px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 16px;
}

/* ===== MAIN PRICE CARD ===== */
.main-card {
  margin-bottom: 10px;
  border-color: var(--gold-dim);
  background:
    linear-gradient(160deg,
      var(--gold-dim) 0%,
      var(--gold-dim) 40%,
      var(--bg-card) 100%);
  box-shadow:
    inset 0 1px 0 var(--gold-dim),
    inset 0 -1px 0 var(--shadow),
    0 4px 20px var(--shadow);
}

/* BTC — primary */
.price-block:first-child .price-value {
  font-size: 23px;
  color: var(--text);
}

/* ETH — secondary */
.price-block:last-child .price-value {
  font-size: 20px;
  color: rgba(230, 237, 243, 0.72);
}

.price-block:last-child .price-label {
  color: var(--text-dim);
}

.main-card-top {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 14px;
}

.price-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.price-block:first-child { padding-right: 12px; }
.price-block:last-child  { padding-left: 12px; }

.price-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.price-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.price-change {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.price-change.up   { color: var(--green); }
.price-change.down { color: var(--red); }

.divider-v {
  width: 1px;
  height: 48px;
  background: var(--fill-2);
  flex-shrink: 0;
}

.main-card-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--edge);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

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

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.stat-value.bias     { color: var(--gold); }
.stat-value.positive { color: var(--green); }
.stat-value.negative { color: var(--red); }

/* ===== METRICS GRID ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
}

.metric-icon {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 2px;
}

.metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.metric-sub.up      { color: var(--green); }
.metric-sub.down    { color: var(--red); }
.metric-sub.fg-up   { color: var(--green-strong); }
.metric-sub.fg-down { color: var(--red-strong); }

.metric-value.up   { color: var(--green); }
.metric-value.down { color: var(--red); }

/* ===== CME OPEN GAPS SECTION ===== */
.cme-gaps-card {
  margin-bottom: 10px;
  padding: 14px 16px 10px;
}

.cme-gaps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cme-gaps-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cme-gaps-count {
  font-size: 11px;
  color: var(--text-dim);
}

.cme-gap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-top: 1px solid var(--edge);
  font-size: 13px;
}

.cme-gap-row:first-child { border-top: none; }

.cme-gap-week  { color: var(--text-muted); font-size: 12px; min-width: 56px; }
.cme-gap-range { color: var(--text); font-variant-numeric: tabular-nums; }
.cme-gap-size  { font-size: 12px; font-variant-numeric: tabular-nums; }
.cme-gap-size.up   { color: var(--green-strong); }
.cme-gap-size.down { color: var(--red-strong); }

.cme-older {
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: -0.1px;
}

/* ===== CME DETAIL MODAL ===== */
.cme-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--shadow-strong);
  z-index: 200;
  align-items: flex-end;
  -webkit-tap-highlight-color: transparent;
}
.cme-modal-overlay.open { display: flex; }

.cme-modal-sheet {
  background: var(--card-bg, #1a1d24);
  border-radius: 20px 20px 0 0;
  padding: 8px 20px 40px;
  width: 100%;
  max-height: 72vh;
  overflow-y: auto;
  box-shadow: 0 -4px 32px var(--shadow);
}

.cme-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 16px;
}

.cme-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-top: 1px solid var(--edge);
  font-size: 14px;
}
.cme-modal-row:first-child { border-top: none; }

.cme-modal-row-label {
  color: var(--text-muted);
  font-size: 13px;
}
.cme-modal-row-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
}

.cme-modal-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 18px 0 8px;
}

.cme-modal-older-section {
  margin-top: 14px;
  background: var(--gold-dim);
  border-left: 2px solid var(--gold-border);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px 6px;
}

.cme-modal-older-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
  letter-spacing: -0.1px;
}

/* ===== ALERT CARD ===== */
.alert-card {
  margin-bottom: 10px;
  background: var(--bg-card2);
}

.alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.alert-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alert-badge.whale  { background: var(--teal-dim); color: var(--teal); border-color: var(--teal-edge); }
.alert-badge.liq    { background: var(--red-dim); color: var(--red); border-color: var(--red-edge); }
.alert-badge.volume { background: var(--gold-dim); color: var(--gold); border-color: var(--gold-border); }
.alert-badge.oi     { background: var(--green-dim); color: var(--green); border-color: var(--green-edge); }

.alert-time {
  font-size: 11px;
  color: var(--text-dim);
}

.alert-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.alert-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card);
  border-top: 1px solid var(--edge);
  display: flex;
  align-items: flex-start;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 4px;
  height: var(--nav-h);
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.nav-item.active {
  color: var(--gold);
}

.nav-item:not(.active):active {
  color: var(--text-muted);
}

/* ===== TAB PANELS ===== */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== PLACEHOLDER SCREENS ===== */
.placeholder-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 12px;
  color: var(--text-dim);
}

.placeholder-screen .ph-icon {
  font-size: 40px;
  opacity: 0.5;
}

.placeholder-screen .ph-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
}

.placeholder-screen .ph-sub {
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== SCREENER ===== */

.screener-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 10px;
  gap: 8px;
}

.screener-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.screener-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.screener-updated {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1;
}

/* Sort control */
.screener-sort {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.sort-btn {
  background: none;
  border: 1px solid var(--edge);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 11px;
  font-family: inherit;
  padding: 4px 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.sort-btn.active {
  background: var(--teal-dim);
  border-color: var(--teal-edge);
  color: var(--teal);
  font-weight: 600;
}

/* Фильтры листаются вбок. Обрезанный краем экрана чип выглядит как ошибка
   вёрстки, поэтому правый край растворяем — так видно, что там продолжение. */
.screener-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 3px 18px 10px 0;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
}

.screener-filters::-webkit-scrollbar { display: none; }

.filter-tab {
  flex-shrink: 0;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 13px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.filter-tab.active {
  background: var(--gold-dim);
  border-color: var(--gold-border);
  color: var(--gold);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--gold-dim);
}

/* Signal list */
.signal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Signal card — tappable */
.signal-card {
  padding: 13px 14px;
  background: var(--bg-card);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, transform 0.1s;
  will-change: transform;
}

.signal-card:active {
  background: var(--bg-card2);
  transform: scale(0.985);
}

/* Card top row: icon + symbol + badges (right) */
.signal-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}

.signal-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.signal-symbol {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* Badges pushed to the right */
/* Метки переносятся, если их много: «МЕГА» + направление + важность в одну
   строку на 390 не помещаются и вылезали за край. */
.signal-badges {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 6px;
  flex-shrink: 0;
}

/* Signal type — secondary row */
.signal-type {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  padding-left: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Направление — единственная метка, которой цвет положен по правилу палитры:
   она говорит о движении вверх/вниз. Без плашки, только текст: плашка спорит
   за внимание с ценой. */
.sig-dir {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.sig-dir.buy  { color: var(--green); }
.sig-dir.sell { color: var(--red); }

/* Важность цветом НЕ красим: размер события — не хорошо и не плохо, а красный
   на слове «крупный» читается как тревога. Различаем весом и яркостью. */
.signal-sev {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.sev-high   { color: var(--text);       font-weight: 700; }
.sev-medium { color: var(--text-muted); font-weight: 600; }
.sev-low    { color: var(--text-dim);   font-weight: 500; }

/* ── Modal status pills ──────────────────────────────────────────────────────── */
.modal-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 14px;
}
.modal-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  line-height: 1.4;
}
.sp-mega      { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); font-weight: 700; }
.sp-strong    { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
.sp-posted    { background: var(--teal-dim); color: var(--teal); border: 1px solid var(--teal-edge); }
.sp-not-posted{ background: rgba(125,133,144, 0.08); color: var(--text-dim); border: 1px solid rgba(125,133,144,0.15); }
.sp-pinned    { background: var(--gold-dim); color: var(--gold);    border: 1px solid var(--gold-border); }

/* Level badge — MEGA */
.badge-level {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.badge-level.mega {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

/* Posted badge */
.badge-posted {
  font-size: 12px;
  line-height: 1;
  opacity: 0.75;
  flex-shrink: 0;
}

.signal-body {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.45;
  word-break: break-word;
}

.signal-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

/* Empty state */
/* ===== GATE SCREEN ===== */






.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  gap: 8px;
}

.empty-icon  { font-size: 36px; opacity: 0.4; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-muted); }
.empty-sub   { font-size: 13px; color: var(--text-dim); text-align: center; }

/* ===== SIGNAL DETAIL MODAL ===== */

.signal-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--shadow-strong);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.signal-modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.signal-modal {
  width: 100%;
  background: var(--bg-card2);
  border-top: 1px solid var(--edge-2);
  border-radius: var(--radius) var(--radius) 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%);
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.signal-modal-overlay.is-open .signal-modal {
  transform: translateY(0);
}

/* Drag handle */
.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--fill-3);
  margin: 12px auto 0;
}

/* Top row: symbol + close */
.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
  gap: 8px;
}

.modal-symbol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.modal-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.modal-symbol {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.modal-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.modal-close {
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 13px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}

.modal-close:active {
  background: var(--fill-3);
}

/* Signal type subtitle */
.modal-type {
  font-size: 13px;
  color: var(--text-dim);
  padding: 0 16px 14px;
}

/* Divider */
.modal-divider {
  height: 1px;
  background: var(--fill-1);
  margin: 0 16px;
}

/* Detail rows */
.modal-details {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.modal-row-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 68px;
  flex-shrink: 0;
  padding-top: 1px;
}

.modal-row-value {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  word-break: break-word;
  flex: 1;
}

.modal-row-body .modal-row-value {
  color: var(--text);
  font-size: 13px;
}

/* Action buttons */
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px 16px;
}
/* Кнопок стало четыре, и в одну строку на телефоне они разъезжались в два
   этажа каждая. Главное действие — «следить за монетой» — занимает свою строку
   целиком, три «открыть где-то» делят вторую. */
#modal-btn-watch {
  flex: 0 0 100%;
  color: var(--gold);
  border-color: var(--gold-border);
  font-weight: 600;
}

.modal-action-btn {
  flex: 1;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  padding: 10px 8px;
  text-align: center;
  opacity: 0.38;
  cursor: not-allowed;
  transition: background 0.12s, opacity 0.12s, border-color 0.12s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.modal-action-btn:not([disabled]) {
  opacity: 1;
  cursor: pointer;
  background: var(--fill-1);
  border-color: var(--edge-2);
  color: var(--text-muted);
}

.modal-action-btn:not([disabled]):active {
  background: var(--fill-3);
}

/* ===== CALC SCREEN ===== */

.calc-screen {
  padding-top: 4px;
}

.calc-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 12px;
}

.calc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.calc-subtitle {
  font-size: 11px;
  color: var(--text-dim);
}

/* Long / Short segmented control */
.calc-segment {
  display: flex;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 10px;
}

.seg-btn {
  flex: 1;
  background: none;
  border: none;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 7px 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}

.seg-btn.active[data-dir="long"]  {
  background: var(--green-dim);
  color: var(--green);
}

.seg-btn.active[data-dir="short"] {
  background: var(--red-dim);
  color: var(--red);
}

/* Inputs card */
.calc-inputs {
  margin-bottom: 10px;
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 10px;
}

.calc-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.calc-optional {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.calc-input-wrap {
  display: flex;
  align-items: center;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 0 10px;
  transition: border-color 0.15s;
}

.calc-input-wrap:focus-within {
  border-color: var(--gold-border);
}

.calc-prefix,
.calc-suffix {
  font-size: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
  line-height: 1;
}

.calc-prefix { padding-right: 4px; }
.calc-suffix { padding-left: 4px; }

.calc-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px; /* ≥16px prevents iOS auto-zoom on focus */
  font-family: inherit;
  font-weight: 500;
  padding: 9px 0;
  min-width: 0;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.calc-input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

/* Remove number input arrows */
.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.calc-input[type=number] { -moz-appearance: textfield; }

/* Error state */
.calc-input-wrap.error {
  border-color: var(--red-edge);
}

.calc-divider {
  height: 1px;
  background: var(--fill-1);
  margin: 2px 0 10px;
}

/* 2-column row */
.calc-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Results card */
.calc-results {
  padding: 14px;
  margin-bottom: 10px;
}

.calc-result-empty {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 6px 0;
}

.calc-result-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--edge);
}

.calc-result-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.calc-result-row:first-child {
  padding-top: 0;
}

.calc-result-label {
  font-size: 13px;
  color: var(--text-muted);
}

.calc-result-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.calc-result-value.red   { color: var(--red); }
.calc-result-value.green { color: var(--green); }
.calc-result-value.gold  { color: var(--gold); }

/* ── Calc: group card ── */
.calc-group {
  padding: 14px 14px 4px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.calc-group-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 12px;
}

/* ── Calc: risk presets ── */
.calc-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.preset-btn {
  flex: 1;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 7px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.preset-btn.active {
  background: var(--gold-dim);
  border-color: var(--gold-border);
  color: var(--gold);
}

/* ── Calc: expand buttons (+ Entry 2 / + Target 2) ── */
.calc-expand-btn {
  display: inline-block;
  background: none;
  border: none;
  color: var(--teal);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0 0 12px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}

/* ── Calc: advanced (leverage) toggle ── */
.calc-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--edge);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 0 6px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.calc-adv-arrow {
  font-size: 10px;
  color: var(--text-dim);
}

.calc-adv-field {
  padding-top: 8px;
}

/* ── Calc: reset button ── */
.calc-reset-btn {
  display: block;
  width: 100%;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}

.calc-reset-btn:active {
  background: var(--fill-2);
}

/* ===== RSI SCREEN ===== */

.rsi-screen {
  padding-top: 4px;
}

/* Подпись и время обновления держим в ОДНУ строку. Когда оба текста длинные
   («по всему рынку, только крайности» и «251 монета · 1 мин назад»), они
   переносились по два ряда каждый, налезали на кнопки ниже и обрезались
   сверху. Длинная подпись теперь просто укорачивается многоточием. */
.rsi-screen-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 10px;
}
.rsi-screen-header .rsi-screen-sub {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rsi-screen-header .screener-updated { flex: none; white-space: nowrap; }


.rsi-screen-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* Timeframe & zone rows — reuse filter-tab style */
.rsi-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

/* overflow-x: auto делает и вертикальную прокрутку «auto», а значит содержимое
   без запаса по высоте подрезается сверху. Запас и есть лекарство. */
.rsi-tf-row,
.rsi-zone-row {
  display: flex;
  gap: 6px;
  padding: 3px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rsi-tf-row::-webkit-scrollbar,
.rsi-zone-row::-webkit-scrollbar { display: none; }

.rsi-tab {
  flex-shrink: 0;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  padding: 5px 13px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.rsi-tab.active {
  font-weight: 700;
}

/* Timeframe active: teal */
.rsi-tf-row .rsi-tab.active {
  background: var(--teal-dim);
  border-color: var(--teal-edge);
  color: var(--teal);
}

/* Zone active: dynamic per zone */
.rsi-zone-row .rsi-tab.active               { background: var(--fill-2); border-color: var(--edge-2); color: var(--text-muted); }
.rsi-zone-row .rsi-tab.active[data-zone="oversold"]   { background: var(--red-dim); border-color: var(--red-edge); color: var(--red); }
.rsi-zone-row .rsi-tab.active[data-zone="neutral"]    { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); }
.rsi-zone-row .rsi-tab.active[data-zone="overbought"] { background: var(--green-dim); border-color: var(--green-edge); color: var(--green); }

/* RSI list */
.rsi-list {
  display: flex;
  flex-direction: column;
}

/* Одна строка на монету: тикер · шкала · число · состояние.
   Было три этажа и полоса во всю ширину — на экран помещалось шесть монет из
   двух с половиной сотен просканированных. */
.rsi-item {
  display: grid;
  grid-template-columns: minmax(64px, auto) 1fr auto minmax(74px, auto);
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.rsi-item:last-child { border-bottom: 0; }

.rsi-symbol { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }

/* Шкала: серая дорожка с подкрашенными краями — это опорные 30 и 70, а не
   украшение. Внутри дорожки точка показывает, где сейчас значение. */
.rsi-bar {
  position: relative;
  height: 4px;
  min-width: 56px;
  border-radius: 2px;
  /* Края подкрашены слабо: это опорные 30 и 70, подсказка, а не сообщение.
     Смысл несёт положение точки, а полосы лишь дают ей систему координат. */
  background:
    linear-gradient(to right,
      var(--red-dim) 0%, var(--red-dim) 30%,
      var(--fill-1) 30%, var(--fill-1) 70%,
      var(--green-dim) 70%, var(--green-dim) 100%);
  opacity: 0.75;
}
.rsi-dot {
  position: absolute;
  top: 50%;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
}
.rsi-dot.oversold   { background: var(--red); }
.rsi-dot.overbought { background: var(--green); }

.rsi-value { font-size: 14px; font-weight: 600; text-align: right; min-width: 40px; }
.rsi-value.oversold   { color: var(--red); }
.rsi-value.overbought { color: var(--green); }

.rsi-word {
  font-size: 10.5px;
  color: var(--text-dim);
  text-align: right;
  line-height: 1.15;
}
.rsi-item.rsi-high .rsi-word { color: var(--text-muted); font-weight: 600; }

/* ===== SETTINGS SCREEN ===== */

.settings-screen {
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section {
  padding: 14px;
}

.settings-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 12px;
}

/* Profile top row */
.settings-profile-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--edge);
}

.settings-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

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

.settings-display-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.settings-username {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 1px;
}

.settings-user-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
}

.settings-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.settings-badge.gold  { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
.settings-badge.teal  { background: var(--teal-dim); color: var(--teal); border: 1px solid var(--teal-edge); }
.settings-badge.muted { background: rgba(125,133,144,0.10); color: var(--text-dim); border: 1px solid rgba(125,133,144,0.15); }

/* Settings rows */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--edge);
  gap: 8px;
}

.settings-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-row:first-child { padding-top: 0; }

.settings-label {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.settings-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  min-width: 0;
  word-break: break-all;
}

.settings-value.live  { color: var(--green); }
.settings-value.error { color: var(--red); }
.settings-value.dim   { color: var(--text-dim); font-weight: 400; }

/* Action buttons */
.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-action-btn {
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-family: inherit;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  width: 100%;
}

.settings-action-btn:not([disabled]):active {
  background: var(--fill-3);
}

.settings-action-btn[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ===== SKELETON LOADER ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card2) 25%, var(--fill-1) 50%, var(--bg-card2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  height: 1em;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== MACRO CARD ===== */
.macro-card {
  padding: 16px 18px;
}
.macro-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.macro-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.macro-label {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}
.macro-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.macro-change {
  font-size: 13px;
  font-weight: 500;
  min-width: 56px;
  text-align: right;
}
.macro-change.up   { color: var(--green); }
.macro-change.down { color: var(--red); }
.macro-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   КИТЫ и КАРТА ЛИКВИДАЦИЙ
   По эталону design/market_reference.html: плотно, числа табличные,
   разделяем линиями, цвет означает, а не украшает.
   ═══════════════════════════════════════════════════════════════════════════ */

.w-up   { color: var(--green); }
.w-down { color: var(--red); }
.w-flat { color: var(--text-dim); }
.w-dim  { color: var(--text-dim); }
.w-share{ color: var(--gold); font-weight: 600; }

.w-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 13px 16px 11px; border-bottom: 1px solid var(--line);
}
.w-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; flex: 1; }
.w-note  { font-size: 11px; color: var(--text-dim); }
.w-load, .w-empty {
  padding: 22px 16px; color: var(--text-dim); font-size: 13px;
  text-align: center; line-height: 1.6;
}

.w-sec { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.w-sec-head {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px;
}
.w-sec-head h3 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim);
}

/* строка кита */
.w-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
  padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.w-sec > .w-row:last-of-type,
.w-sec > .w-swipe:last-of-type .w-row { border-bottom: 0; }
.w-nm  { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.w-pos { font-size: 12.5px; color: var(--text-muted); }
.w-pos b { color: var(--text); font-weight: 600; }
.w-more{ font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.w-r   { text-align: right; white-space: nowrap; }
.w-pnl { font-size: 15px; font-weight: 600; }
.w-acct{ font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.w-chev{ width: 16px; height: 16px; color: var(--text-dim); align-self: center; }

.w-tag {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.03em; padding: 2px 5px;
  border-radius: 3px; border: 1px solid var(--line); color: var(--text-dim);
  text-transform: uppercase;
}
.w-tag-algo { color: var(--red); border-color: var(--red); opacity: .85; }

.w-follow, .w-add, .w-remove {
  background: none; border: 1px solid var(--line); color: var(--gold);
  font: 600 12px/1 inherit; padding: 9px 13px; border-radius: 6px;
  cursor: pointer; white-space: nowrap;
}
.w-add    { width: 100%; margin-top: 10px; padding: 11px; }
.w-remove { width: 100%; color: var(--red); }

/* карточка кита */
.w-head-back { padding-left: 10px; }
.w-back, .w-edit {
  background: none; border: 0; padding: 4px; display: flex;
  color: var(--text-muted); cursor: pointer;
}
.w-back svg, .w-edit svg { width: 18px; height: 18px; }
.w-addr {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 7px; padding: 9px 11px;
}
/* Адрес в 42 символа на 390 пикселях не помещается и переносился так, что на
   вторую строку уезжал один-единственный символ. Держим в одну строку: не
   влезло — обрезаем серединой многоточия, полный всё равно копируется нажатием. */
.w-addr code {
  font: 500 11.5px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-muted); cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.w-ext { color: var(--text-dim); display: flex; flex: none; }
.w-ext svg { width: 15px; height: 15px; }

.w-sum {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; margin-top: 10px;
}
.w-sum > div { background: var(--bg-card); padding: 10px 11px; }
.w-sum .t { font-size: 10px; color: var(--text-dim); letter-spacing: .04em; margin-bottom: 3px; }
.w-sum .v { font-size: 15px; font-weight: 600; }
.w-fact { font-size: 12.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; }
.w-fact b { color: var(--text); }

.w-p {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.w-p:last-of-type { border-bottom: 0; }
.w-p-c { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.w-p-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }
.w-p-val { font-size: 14px; font-weight: 600; }
.w-p-pnl { font-size: 12px; margin-top: 2px; }
/* В списке китов ЛОНГ/ШОРТ набраны просто жирным, в карточке были цветными
   плашками — одно и то же читалось по-разному. Приводим к списку. */
/* Сторона — плашкой с подложкой, а не голым словом. Красить сам текст в
   зелёный и красный нельзя: справа в той же строке этими же цветами показан
   РЕЗУЛЬТАТ, и красный SHORT рядом с красными −$6.1M читается как «шорт =
   убыток». Подложка отличается от цифры по форме, спутать не выйдет.
   Модификаторы .l/.s стояли в разметке с самого начала, а правил для них никто
   так и не написал — лонг и шорт выглядели одинаково. */
.w-side { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--text-muted);
          padding: 1px 5px; border-radius: 4px; }
.w-side.l { background: var(--green-dim); color: var(--green); }
.w-side.s { background: var(--red-dim);   color: var(--red); }

/* Пояснение под заголовком раздела: экран открывается таблицей чисел, и без
   одной фразы человек, попавший сюда впервые, не понимает ни что такое кит, ни
   что означает полоска. */
.w-hint { font-size: 11.5px; line-height: 1.45; color: var(--text-dim);
          padding: 2px 0 10px; }

/* переключатели алертов */
.w-al { display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 10px 0; border-bottom: 1px solid var(--line); }
.w-al:last-of-type { border-bottom: 0; }
/* Значение и стрелка держатся вместе, справа. Стрелка — единственный признак,
   по которому видно, что строку можно нажать; без неё «Тема» и «Версия»
   выглядели одинаково. */
.w-al-r { display: flex; align-items: center; gap: 8px; }
.w-al-tap { cursor: pointer; }
.w-al-tap:active { opacity: .6; }

/* Нажимается — значит откликается. Одна метка на все списки: карточка сигнала
   на «Рынке», строка RSI, позиция в карточке кита. Раньше они выглядели
   нажимаемыми ровно настолько же, насколько ими не были. */
.is-tap { cursor: pointer; }
.is-tap:active { opacity: .6; }

/* Сплошной текст на экране «О приложении»: читают его один раз, поэтому важнее
   не плотность, а то, чтобы строки не слипались. */
.ab-txt { font-size: 13px; line-height: 1.55; color: var(--text-dim); }

/* Что стало с ценой после сигнала — в той же строке, где биржа и время.
   Отдельной плашки не заводим: это уточнение к событию, а не само событие. */
.sig-after { flex: 1; text-align: center; }
.sig-after .w-up   { color: var(--green); }
.sig-after .w-down { color: var(--red); }
.w-al-k { font-size: 13.5px; }
.w-al-s { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
/* Переключатель цветом говорит состояние: зелёный — оповещения придут,
   красный — молчит. Серый читался как «не знаю», а это разные вещи. */
.w-sw { width: 38px; height: 22px; border-radius: 11px; background: var(--red);
        position: relative; flex: none; cursor: pointer; transition: background .15s; }
.w-sw.on { background: var(--green); }
.w-sw i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
          border-radius: 50%; background: var(--bg); transition: left .15s; }
.w-sw.on i { left: 19px; }

/* карта */
.m-coin {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 9px; font: 600 13px/1 inherit;
}
.m-two {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 11px;
}
.m-two > div { background: var(--bg-card); padding: 11px 12px; }
.m-two .t { font-size: 10px; color: var(--text-dim); letter-spacing: .04em; margin-bottom: 3px; }
.m-two .v { font-size: 17px; font-weight: 600; }
.m-two .s { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.m-lv { display: grid; grid-template-columns: 66px 1fr 54px; gap: 8px;
        align-items: center; padding: 2.5px 0; }
.m-px { font-size: 11.5px; color: var(--text-muted); text-align: right; }
.m-am { font-size: 11px; color: var(--text-dim); text-align: right; }
.m-bw { height: 13px; background: var(--bg-card2); border-radius: 2px; overflow: hidden; }
.m-bar { height: 100%; border-radius: 2px; }
.m-bar.up { background: var(--green); }
.m-bar.dn { background: var(--red); }
.m-now { display: flex; align-items: center; gap: 7px; margin: 7px 0;
         font-size: 11.5px; color: var(--gold); font-weight: 600; }
.m-now::before, .m-now::after { content: ""; height: 1px; background: var(--gold); opacity: .4; flex: 1; }
.m-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--text-dim); flex-wrap: wrap; }
.m-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.m-legend i.up { background: var(--green); }
.m-legend i.dn { background: var(--red); }
.m-honest { font-size: 11.5px; color: var(--text-dim); line-height: 1.6; }
.m-honest b { color: var(--text); }

/* ═══ «Пока вы спали» и «Где сегодня движение» ═══════════════════════════════ */
.ov-sec { margin-bottom: 10px; padding: 13px 14px; background: var(--bg-card);
          border: 1px solid var(--line); border-radius: var(--radius); }
.ov-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.ov-head h3 { font-size: 11px; font-weight: 600; letter-spacing: .08em;
              text-transform: uppercase; color: var(--text-dim); }
.ov-note { font-size: 11px; color: var(--text-dim); }
.ov-load { padding: 10px 0; font-size: 12px; color: var(--text-dim); text-align: center; }

.ov-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px;
          align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ov-row:last-child { border-bottom: 0; }
/* Название показателя ужимается, если колонка изменения не помещается: на 390
   «+0.8% · 12ч» упиралось в край экрана и обрезалось. */
.ov-row .k { color: var(--text-muted); font-size: 13px;
             min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-row .v { font-size: 14px; font-weight: 600; text-align: right; min-width: 76px; }
.ov-row .d { font-size: 12px; color: var(--text-dim); text-align: right; min-width: 70px; }

.ov-tap { display: flex; align-items: center; justify-content: space-between; gap: 10px;
          margin-top: 9px; padding: 10px 11px; border: 1px solid var(--line);
          border-radius: 7px; cursor: pointer; font-size: 13px; }
.ov-tap .l { display: flex; align-items: center; gap: 8px; }
.ov-tap svg { width: 15px; height: 15px; color: var(--gold); flex: none; }
.ov-tap .chev { color: var(--text-dim); }

.ov-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mv-t { font-size: 10.5px; color: var(--text-dim); margin-bottom: 6px; letter-spacing: .04em; }
.ov-mv { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; }
.ov-mv .s { font-size: 13px; font-weight: 500; }
.ov-mv .p { font-size: 13px; font-weight: 600; }
.ov-mv .vol { font-size: 10px; color: var(--text-dim); display: block; font-weight: 400; }

/* ═══ Экран «Рынок» по эталону: без градиентов и коробок, плотно ═════════════ */
.mk-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
             background: var(--line); border: 1px solid var(--line);
             border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.mk-price { background: var(--bg-card); padding: 12px 14px; }
.mk-price .t { font-size: 11px; color: var(--text-muted); letter-spacing: .04em; margin-bottom: 4px; }
.mk-price .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.mk-price .c { font-size: 12px; margin-top: 2px; color: var(--text-dim); }

.mk-macro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
            background: var(--line); border: 1px solid var(--line);
            border-radius: 8px; overflow: hidden; }
.mk-macro > div { background: var(--bg-card); padding: 10px 11px; }
.mk-macro .t { font-size: 10px; color: var(--text-dim); letter-spacing: .05em; margin-bottom: 3px; }
.mk-macro .v { font-size: 15px; font-weight: 600; }
.mk-macro .c { font-size: 11px; margin-top: 1px; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════════════════════
   ДОВОДКА ОСТАВШИХСЯ ЭКРАНОВ ДО ЭТАЛОНА (26.08.2026)
   Правим стили, а не логику: экраны рабочие, переписывать их с нуля значит
   рисковать поломкой ради внешнего вида. Задача — убрать «коробочность»:
   карточки с толстыми скруглениями и большими отступами, из-за которых на
   экран влезает вчетверо меньше, чем должно.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Сигналы ─────────────────────────────────────────────────────────────── */
.signal-list { gap: 0; }
.signal-card {
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.signal-card:first-child { border-top: 1px solid var(--line); }
.signal-card:active { background: var(--bg-card2); transform: none; }
.signal-symbol { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.signal-icon { display: none; }   /* эмодзи вместо иконки — убираем */
.signal-type { font-size: 12px; color: var(--text-muted); }
.signal-meta { font-size: 11.5px; color: var(--text-dim);
               font-variant-numeric: tabular-nums; }
.badge-level, .badge-posted {
  font-size: 9.5px; font-weight: 600; letter-spacing: .03em; padding: 2px 5px;
  border-radius: 3px; text-transform: uppercase;
}
.screener-header { padding: 12px 2px 10px; border-bottom: 1px solid var(--line); }
.screener-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.screener-updated { font-size: 11px; color: var(--text-dim);
                    font-variant-numeric: tabular-nums; }

/* ── RSI ─────────────────────────────────────────────────────────────────── */
/* Классы взяты из самой разметки, а не по догадке: сначала я написал правила
.rsi-screen-sub { font-size: 11px; color: var(--text-dim); }
/* Заголовок переехал в общую шапку с кнопкой «назад», здесь осталась подпись и
   время обновления — в одну строку, поэтому наезжать друг на друга нечему. */
.rsi-screen-header { padding: 11px 16px 10px; border-bottom: 1px solid var(--line); align-items: baseline; }

/* ── Настройки ───────────────────────────────────────────────────────────── */
.settings-section {
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 13px 14px;
  margin-bottom: 0;
}
.settings-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px;
}
.settings-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-child { border-bottom: 0; }
.settings-label { font-size: 13px; color: var(--text-muted); }
.settings-value { font-size: 13.5px; font-weight: 600;
                  font-variant-numeric: tabular-nums; }

/* метка типа события вместо эмодзи */
.sig-kind {
  font-size: 9.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--line);
  padding: 2px 5px; border-radius: 3px; flex-shrink: 0;
}

/* ── алерты по тикерам ───────────────────────────────────────────────────── */
.al-top { display: flex; align-items: flex-start; justify-content: space-between;
          gap: 12px; margin-bottom: 10px; }
.al-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.al-chip { display: inline-flex; align-items: center; gap: 6px;
           font-size: 12px; font-weight: 600; padding: 5px 8px;
           border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.al-chip i { color: var(--text-dim); font-style: normal; font-size: 13px; }
.al-empty { font-size: 12px; color: var(--text-dim); }
.al-x { background: none; border: 0; color: var(--text-dim); font-size: 20px;
        cursor: pointer; padding: 0 6px; line-height: 1; }

/* Шапка: только название, без картинки. Логотип-картинка в узкой полосе рядом
   с текстом читался как наклейка и тянул внимание на себя. Цвет — акцентный,
   он же меняется вместе с темой. */
.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.02em;
}

/* лента действий кита */
.w-ev { display: grid; grid-template-columns: auto 1fr auto; gap: 10px;
        align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line);
        font-size: 12.5px; }
.w-ev:last-child { border-bottom: 0; }
.w-ev .tm { color: var(--text-dim); font-size: 11px; white-space: nowrap; }
.w-ev .am { font-weight: 600; white-space: nowrap; }

/* ═══ Дисциплина цвета (26.08.2026) ═════════════════════════════════════════
   Правило: цветом обозначаем ТОЛЬКО прибыль-убыток и рост-падение. Важность
   сигнала (мега, high, med) цветом красить нельзя — иначе на экране пять
   разных цветов и ни один ничего не значит. Важность показываем формой и
   насыщенностью, а не радугой. ═══════════════════════════════════════════ */
.badge-level, .badge-level.mega,
.badge-posted,
.modal-pill.sp-mega, .modal-pill.sp-posted, .modal-pill.sp-pinned,
.modal-pill.sp-strong, .modal-pill.sp-not-posted,
/* мега — единственная, что выделяется, и то формой, а не цветом */
.badge-level.mega, .modal-pill.sp-mega {
  color: var(--text) !important;
  border-color: var(--text-muted) !important;
}
/* синяя таблетка сортировки была вообще не из палитры */
.screener-sort .active,
.rsi-tf-row .rsi-tab.active,
.rsi-zone-row .rsi-tab.active {
  background: var(--gold-dim) !important;
  color: var(--gold) !important;
  border-color: var(--gold-border) !important;
}
/* Правило «карточки RSI — строки, а не коробки» больше не нужно: строка теперь
   и есть строка, а его !important перебивал новую сетку и отступы. */
.rsi-list { padding: 0 14px; }

/* ═══════════════════════════════════════════════════════════════════════════
   ДИАЛОГИ И ПЛАШКА ОШИБКИ
   Замена окон браузера: в телеграме на айфоне они не открываются вовсе.
   Окно прижато к верху, а не по центру — иначе клавиатура его закрывает.
   ═══════════════════════════════════════════════════════════════════════════ */
.cp-ov {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14vh 18px 18px;
  opacity: 0;
  transition: opacity 0.15s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.cp-ov.in { opacity: 1; }

.cp-dlg {
  width: 100%;
  max-width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 18px 48px var(--shadow-strong);
  transform: translateY(-8px);
  transition: transform 0.15s ease;
}
.cp-ov.in .cp-dlg { transform: translateY(0); }

.cp-t   { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.cp-s   { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }
.cp-f   { display: block; margin-top: 14px; }
.cp-lbl { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px;
          color: var(--text-dim); margin-bottom: 6px; }

.cp-in {
  width: 100%;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;            /* меньше 16px — айфон зумит страницу при фокусе */
  font-variant-numeric: tabular-nums;
  padding: 11px 12px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.cp-in:focus { border-color: var(--gold-border); background: var(--fill-2); }
.cp-in::placeholder { color: var(--text-dim); }

.cp-seg { display: flex; gap: 6px; }
.cp-seg-b {
  flex: 1;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cp-seg-b.on { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); font-weight: 600; }

.cp-btns { display: flex; gap: 8px; margin-top: 18px; }
.cp-b {
  flex: 1;
  background: var(--fill-1);
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  padding: 11px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cp-b.cp-ok     { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold); font-weight: 600; }
.cp-b.cp-danger { background: var(--red-dim);  border-color: var(--red-edge);    color: var(--red); }

.cp-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  z-index: 500;
  max-width: calc(100% - 32px);
  background: var(--bg-card2);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 28px var(--shadow-strong);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.cp-toast.in  { opacity: 1; transform: translate(-50%, 0); }
.cp-toast.err { border-color: var(--red-edge); }
.cp-toast.ok  { border-color: var(--green-edge); }

/* ═══════════════════════════════════════════════════════════════════════════
   НАСТРОЙКИ — в том же строе, что «Киты» и «Алерты».
   Раньше экран жил по своим правилам (свои карточки, свои отступы, английские
   заголовки) и выпадал из приложения.
   ═══════════════════════════════════════════════════════════════════════════ */
.w-al-v {
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
  padding-left: 12px;
}
.w-al-v.w-up   { color: var(--green); }
.w-al-v.w-down { color: var(--red); }

.set-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 14px;
}
.set-ava {
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.set-who   { min-width: 0; flex: 1; }
.set-nm    { font-size: 15px; font-weight: 600; color: var(--text);
             overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-un    { font-size: 12.5px; color: var(--text-muted); margin-top: 1px;
             overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-badges { display: flex; gap: 5px; flex-shrink: 0; }

/* Выбор из нескольких вариантов переносится по строкам: четыре кнопки в один
   ряд на телефоне превращаются в нечитаемые огрызки. */
.cp-seg { flex-wrap: wrap; }
.cp-seg-b { min-width: 88px; }

.more-foot {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 14px 0 26px;
  letter-spacing: 0.3px;
}

/* Цвет в строке показателя несёт колонка изменения, а не значение. Правило
   `.ov-row .d` перебивало `.w-up` по весу, и плюс-минус выходил серым. */
.ov-row .d.w-up   { color: var(--green); }
.ov-row .d.w-down { color: var(--red); }
.ov-row .v.w-up   { color: var(--green); }
.ov-row .v.w-down { color: var(--red); }

/* Метка типа события — не светофор. Тип не бывает хорошим или плохим, а
   красная «ЛИКВИДАЦИИ» на экране рынка тянет на себя всё внимание. */
.alert-badge, .alert-badge.whale, .alert-badge.liq,
.alert-badge.oi, .alert-badge.vol, .alert-badge.volume, .alert-badge.funding {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: var(--text-dim) !important;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   СВАЙП ПО СТРОКЕ КИТА
   Кнопки лежат ПОД строкой и открываются, когда строку сдвигают влево. Строке
   нужен непрозрачный фон — иначе кнопки просвечивают сквозь неё.
   ═══════════════════════════════════════════════════════════════════════════ */
.w-swipe {
  position: relative;
  overflow: hidden;
}
.w-swipe .w-row {
  position: relative;
  background: var(--bg);
  transition: transform 0.18s ease;
  will-change: transform;
}
/* Кнопки не просто лежат под строкой — они спрятаны, пока строку не потянули.
   Иначе они подглядывают из-под края там, где строка на пиксель ниже. */
.w-acts {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  opacity: 0;
  pointer-events: none;
}
.w-swipe.sw .w-acts { opacity: 1; pointer-events: auto; }
.w-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 72px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Размер подобран под САМУЮ НИЗКУЮ строку списка (кит без второй позиции —
   около 56px). Прежние 52px с подписью не влезали, и подпись срезало. */
.w-act-i {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.w-act-i svg { width: 19px; height: 19px; }
.w-act-t {
  font-family: inherit;
  font-size: 9.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
/* «Вкл. звук» зелёная, «Выкл. звук» янтарная. Красный намеренно оставлен
   только удалению: две красные кнопки рядом путают, а промах тут необратим. */
.w-act-mute    { background: #F0A020; }
.w-act-mute.on { background: var(--green); }
.w-act-del  { background: #E5484D; }

/* Колокольчик состояния: зелёный — оповещения придут, красный перечёркнутый —
   кит молчит. Цвет здесь несёт смысл «включено/выключено», а не украшает. */
.w-bell { display: inline-flex; vertical-align: -2px; margin-left: 2px; }
.w-bell svg { width: 13px; height: 13px; }
.w-bell.on  { color: var(--green); }
.w-bell.off { color: var(--red); }

/* Переключатели: включён — зелёный, выключен — красный. */
.w-sw.on { background: var(--green) !important; }
.w-sw    { background: var(--red-dim) !important; box-shadow: inset 0 0 0 1px var(--red-edge); }
.w-sw.on { box-shadow: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   ПОДТВЕРЖДЕНИЕ — ЛИСТОМ СНИЗУ
   Свайп по строке делается большим пальцем внизу экрана. Окно подтверждения
   стояло вверху, и жест «одним пальцем» ломался на последнем шаге: до кнопки
   приходилось тянуться второй рукой. Подтверждение приходит туда же, где палец.
   ═══════════════════════════════════════════════════════════════════════════ */
.cp-ov.cp-sheet {
  align-items: flex-end;
  padding: 18px 12px calc(12px + env(safe-area-inset-bottom, 0px));
}
.cp-ov.cp-sheet .cp-dlg {
  max-width: 460px;
  border-radius: 18px;
  padding: 18px 18px 14px;
  transform: translateY(14px);
}
.cp-ov.cp-sheet.in .cp-dlg { transform: translateY(0); }
/* Кнопки крупнее: попасть надо с одного раза и не глядя */
.cp-ov.cp-sheet .cp-b { padding: 14px 0; font-size: 15px; }

/* Плашка с кнопкой отмены. Пока она на экране, нажатия по ней должны
   доходить — обычная плашка их пропускает насквозь. */
.cp-toast.act {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 6px;
}
.cp-toast-t { flex: 1; min-width: 0; }
.cp-toast-b {
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

/* Полоска под числом: доля рынка и плечо. Тонкая и приглушённая — она
   подсказывает масштаб боковым зрением, а не спорит за внимание с цифрой.
   Заметной становится только там, где величина действительно крупная. */
.w-bar {
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  /* Дорожка видима целиком: иначе заполненная часть читается как подчёркивание
     строки над ней, а не как шкала. */
  background: var(--fill-2);
  overflow: hidden;
  width: 150px;
  max-width: 100%;
}
.w-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--text-dim);
}
.w-bar.s i { background: var(--gold); }

/* Предупреждение в алертах: список настроен, а тип выключен. */
.al-warn {
  font-size: 11.5px;
  color: var(--red);
  padding: 2px 0 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ПРИГЛАШЕНИЕ В СООБЩЕСТВО
   Не стена на входе, а карточка внизу экрана рынка — её видит только тот, кто
   ещё не в группе, и только после того, как пролистал данные. Закрывается
   насовсем: повторно уговаривать человека, который отказался, незачем.
   ═══════════════════════════════════════════════════════════════════════════ */
.inv {
  margin-top: 10px;
  padding: 14px 14px 12px;
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  background: var(--gold-dim);
}
.inv-t { font-size: 14px; font-weight: 600; color: var(--text); }
.inv-s { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.35; }
.inv-btns { display: flex; gap: 8px; margin-top: 12px; }
.inv-go, .inv-no {
  flex: 1;
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 0;
  border-radius: 9px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.inv-go { background: var(--gold); border: 0; color: #fff; font-weight: 600; }
.inv-no { background: transparent; border: 1px solid var(--edge); color: var(--text-muted); }

/* Колокольчик состояния в списке китов: зелёный — оповещения придут, красный
   перечёркнутый — кит молчит. Раньше метка стояла только у молчащих и была
   серой, поэтому «включено» ничем не отличалось от «не знаю». */
.w-bell { display: inline-flex; vertical-align: -2px; margin-left: 2px; }
.w-bell svg { width: 13px; height: 13px; }
.w-bell.on  { color: var(--green); }
.w-bell.off { color: var(--red); }

/* Условие срабатывания под каждым типом алерта: «резкий рост» без числа не
   говорит ничего, а человек должен понимать, чего он ждёт. */
.al-when {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-dim);
  padding: 2px 0 8px;
}

/* Ожидание вместо мгновенного «ничего нет»: расчёт RSI по всему рынку идёт
   несколько секунд, и пустой экран в это время читается как поломка. */
.rsi-wait {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
.rsi-wait::after {
  content: "";
  display: block;
  width: 120px; height: 3px;
  margin: 14px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--fill-1) 0%, var(--gold-border) 50%, var(--fill-1) 100%);
  background-size: 200% 100%;
  animation: rsi-wait-run 1.1s linear infinite;
}
@keyframes rsi-wait-run {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Хвост, не поместившийся в шкалу. Прятать его нельзя: итоги сверху считаются
   по всем позициям, и без этой строки числа расходятся с картинкой. */
.m-out {
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 8px 0 2px;
  line-height: 1.4;
}

/* Оборот и заработок кита. Размер счёта сам по себе мало что значит: у самых
   крупных счетов недельный оборот бывает нулевым — деньги просто лежат.
   Эти три числа отвечают, торгует ли человек и получается ли у него. */
.w-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 12px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.w-stats > div { background: var(--bg); padding: 9px 10px; }
.w-stats .t { font-size: 9px; letter-spacing: .06em; color: var(--text-dim); }
.w-stats .v { font-size: 14px; font-weight: 600; margin-top: 3px; }
