/*
 * /trading/ — спот и фьючерсы (seo-1107, зона page-trading). Приставка trd-.
 * Только токены r26 (assets/r26.css): тёмная тема — без атрибута, светлая — html[data-theme="light"]
 * (токены переключаются сами). Без новых шрифтов и градиентов. Телефон — 719 / 359 px, RTL — логические
 * свойства, числа и суммы — в <bdi>.
 */

.trd { padding-bottom: 8px; }
.trd-top { padding-top: 12px; }
.trd-sec { padding-top: 64px; display: flex; flex-direction: column; gap: 28px; }
.trd :is(h3, h4) { margin: 0; }
.trd-h2s { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.12; letter-spacing: -0.025em; }
.trd-h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.25; }
.trd-k-warn { color: var(--r-red); }
.trd-foot { margin: -12px 0 0; font-size: 13px; line-height: 1.55; color: var(--r-muted); max-width: 860px; }

/* ── Первый экран ── */
.trd-hero .r-hero-art img { width: 280px; height: 280px; }
.trd-btns .r-btn svg { flex: none; }
[dir="rtl"] .trd-btns .r-btn svg, [dir="rtl"] .trd-calc-btn svg, [dir="rtl"] .trd-final svg { transform: scaleX(-1); }

/* ── Предупреждение сразу после первого экрана ── */
.trd-risk-sec { padding-top: 16px; }
.trd-risk {
  padding: 32px 40px; display: flex; flex-direction: column; gap: 22px;
  border-color: var(--r-red-line); box-shadow: inset 0 0 0 1px var(--r-red-line);
}
.trd-risk-head { display: flex; gap: 16px; align-items: center; }
.trd-risk-head > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trd-risk-ic {
  width: 52px; height: 52px; flex: none; border-radius: 16px; background: var(--r-red-line); color: var(--r-red);
  display: flex; align-items: center; justify-content: center;
}
.trd-risk-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; }
.trd-risk-list li { position: relative; padding-inline-start: 18px; font-size: 15px; line-height: 1.55; color: var(--r-text-2); }
.trd-risk-list li::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 9px; width: 7px; height: 7px; border-radius: 999px; background: var(--r-red);
}
.trd-risk-list b { color: var(--r-text); font-weight: 800; }

/* ── Спот или фьючерсы / сценарии: две колонки ── */
.trd-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.trd-cmp { padding: 30px 32px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.trd-cmp--fut { border-color: var(--r-line-3); }
.trd-cmp-top { display: flex; gap: 14px; align-items: center; }
.trd-cmp-top h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.trd-cmp-sub { font-size: 14px; color: var(--r-muted); }
.trd-ico {
  width: 52px; height: 52px; flex: none; border-radius: 16px; background: var(--r-brand-tint); color: var(--r-link);
  display: flex; align-items: center; justify-content: center;
}
.trd-dl { margin: 0; display: flex; flex-direction: column; }
.trd-dl > div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; padding: 13px 0; border-top: 1px solid var(--r-line-2); }
.trd-dl dt { font-size: 13px; font-weight: 700; color: var(--r-muted); }
.trd-dl dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--r-text); line-height: 1.45; }

/* ── Шаги ── */
.trd-how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.trd-how-b { padding: 32px 36px; display: flex; flex-direction: column; gap: 20px; }
.trd-h3-sub { font-size: 14px; font-weight: 700; color: var(--r-muted); margin-inline-start: 6px; }
.trd-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.trd-step { display: flex; gap: 16px; align-items: flex-start; }
.trd-step-n {
  width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--r-fill-3); border: 1px solid var(--r-line-2);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: var(--r-accent);
}
.trd-step h4 { font-size: 16px; font-weight: 800; line-height: 1.3; }
.trd-step p { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: var(--r-muted); }

/* ── Таблицы ── */
.trd-tbl-wrap {
  border: 1px solid var(--r-line-2); border-radius: 24px; background: var(--r-surface); overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.trd-tbl-wrap:focus-visible { outline: 2px solid var(--r-brand-2); outline-offset: 2px; }
.trd-tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.trd-tbl :is(th, td) { padding: 15px 24px; text-align: start; vertical-align: top; line-height: 1.5; }
.trd-tbl tr + tr :is(th, td) { border-top: 1px solid var(--r-line-2); }
.trd-tbl tbody th { width: 34%; font-weight: 700; color: var(--r-muted); font-size: 14px; }
.trd-tbl td { color: var(--r-text); font-weight: 600; }
.trd-tbl thead th { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--r-faint); border-bottom: 1px solid var(--r-line-2); }

/* ── Калькулятор ── */
.trd-calc { padding: 32px 36px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; }
.trd-form { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.trd-f { display: flex; flex-direction: column; gap: 10px; }
.trd-fs { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.trd-f-l { padding: 0; font-size: 13px; font-weight: 800; color: var(--r-text-2); display: flex; justify-content: space-between; gap: 12px; }
.trd-in {
  height: 56px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--r-line-3); background: var(--r-fill-2);
  color: var(--r-text); font: inherit; font-size: 20px; font-weight: 800; width: 100%; box-sizing: border-box;
}
.trd-in:focus-visible { outline: 2px solid var(--r-brand-2); outline-offset: 1px; border-color: transparent; }
.trd-seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 5px; border-radius: 16px; background: var(--r-fill-2); border: 1px solid var(--r-line-2); }
.trd-seg--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trd-seg label { position: relative; cursor: pointer; }
.trd-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.trd-seg span {
  display: flex; align-items: center; justify-content: center; height: 42px; border-radius: 12px;
  font-size: 15px; font-weight: 800; color: var(--r-text-2); transition: background .16s ease, color .16s ease;
}
.trd-seg label:hover span { background: var(--r-hover); }
.trd-seg input:checked + span { background: var(--r-brand); color: #FFFFFF; }
.trd-seg input:focus-visible + span { outline: 2px solid var(--r-brand-2); outline-offset: 2px; }
.trd-move-o { font-size: 15px; font-weight: 800; color: var(--r-text); }
.trd-range { width: 100%; height: 28px; margin: 0; accent-color: var(--r-brand); cursor: pointer; color-scheme: dark; }
html[data-theme="light"] .trd-range { color-scheme: light; }
.trd-range:focus-visible { outline: 2px solid var(--r-brand-2); outline-offset: 4px; border-radius: 8px; }

.trd-out { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 24px 26px; border-radius: 24px; background: var(--r-fill-2); border: 1px solid var(--r-line-2); }
.trd-res { margin: 0; display: flex; flex-direction: column; }
.trd-res > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 0; }
.trd-res > div + div { border-top: 1px solid var(--r-line-2); }
.trd-res dt { font-size: 14px; color: var(--r-muted); min-width: 0; }
.trd-res dd { margin: 0; font-size: 17px; font-weight: 800; color: var(--r-text); white-space: nowrap; }
.trd-res-big dd { font-size: 26px; letter-spacing: -0.02em; }
.trd-neg { color: var(--r-red); }
.trd-pos { color: var(--r-green); }
.trd-state { margin: 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 700; line-height: 1.45; background: var(--r-green-tint); color: var(--r-green); }
.trd-state--dead { background: var(--r-red-line); color: var(--r-red); }
.trd-calc-btn { align-self: flex-start; }

.trd-liq { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.trd-tbl--liq tbody th { width: 120px; color: var(--r-text); font-size: 16px; font-weight: 800; }
.trd-tbl--liq td { display: flex; align-items: center; gap: 14px; }
.trd-bar { display: block; flex: 0 1 auto; width: calc(var(--w) * 0.6); min-width: 6px; height: 10px; border-radius: 999px; background: var(--r-accent); opacity: 0.85; }

/* ── Термины ── */
.trd-gl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.trd-gl-i { padding: 24px 26px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trd-gl-i dt { font-size: 17px; font-weight: 800; color: var(--r-text); }
.trd-gl-i dd { margin: 0; font-size: 14px; line-height: 1.55; color: var(--r-muted); }

/* ── Кому подходит ── */
.trd-fit { padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.trd-fit-l { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.trd-fit-i { display: flex; gap: 12px; align-items: flex-start; }
.trd-fit-i > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.trd-fit-i b { font-size: 15px; font-weight: 800; color: var(--r-text); line-height: 1.4; }
.trd-fit-i span { font-size: 14px; color: var(--r-muted); line-height: 1.5; }
.trd-fit-ic {
  width: 26px; height: 26px; flex: none; border-radius: 999px; background: var(--r-green-tint); color: var(--r-green);
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.trd-fit-ic--no { background: var(--r-red-line); color: var(--r-red); }

/* ── Риски ── */
.trd-risks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.trd-risk-i {
  padding: 24px 26px; border-radius: 24px; background: var(--r-surface); border: 1px solid var(--r-red-line);
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.trd-risk-i h3 { position: relative; padding-inline-start: 16px; font-size: 17px; font-weight: 800; }
.trd-risk-i h3::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0.45em; width: 7px; height: 7px; border-radius: 999px; background: var(--r-red);
}
.trd-risk-i p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--r-muted); }
.trd-note svg { color: var(--r-red); }

/* ── Ссылки ── */
.trd-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.trd-link {
  position: relative; padding: 22px 24px 48px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--r-text);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.trd-link:hover { border-color: var(--r-line-3); background: var(--r-surface-3); transform: translateY(-2px); }
.trd-link:focus-visible { outline: 2px solid var(--r-brand-2); outline-offset: 2px; }
.trd-link b { font-size: 16px; font-weight: 800; }
.trd-link span { font-size: 14px; color: var(--r-muted); line-height: 1.5; }
.trd-arr { position: absolute; inset-inline-start: 24px; bottom: 20px; color: var(--r-link); }
[dir="rtl"] .trd-arr { transform: scaleX(-1); }
.trd-blog { display: flex; flex-direction: column; gap: 12px; }
.trd-blog ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
@media (max-width: 719px) { .trd-blog ul { grid-template-columns: 1fr; } }
.trd-blog a { font-size: 15px; font-weight: 700; color: var(--r-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.trd-blog a:hover { color: var(--r-link-hover); }

/* ── Вопросы ── */
.trd-faq { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: start; }
.trd-qa { display: flex; flex-direction: column; border-bottom: 1px solid var(--r-line-2); min-width: 0; }
.trd-qa-i { border-top: 1px solid var(--r-line-2); padding: 18px 0; }
.trd-qa-i summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 17px; font-weight: 800; line-height: 1.35;
}
.trd-qa-i summary::-webkit-details-marker { display: none; }
.trd-qa-i summary:focus-visible { outline: 2px solid var(--r-brand-2); outline-offset: 4px; border-radius: 8px; }
.trd-qa-ic {
  width: 34px; height: 34px; flex: none; border-radius: 999px; background: var(--r-fill-3); color: var(--r-text-2);
  display: flex; align-items: center; justify-content: center;
}
.trd-qa-i[open] .trd-qa-ic { background: var(--r-brand); color: #FFFFFF; }
.trd-qa-i[open] .trd-v { display: none; }
.trd-qa-i p { margin: 10px 0 0; font-size: 15px; color: var(--r-muted); line-height: 1.6; max-width: 760px; }

/* ── Финальный призыв ── */
.trd-final { padding: 40px 48px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.trd-final-txt { position: relative; display: flex; flex-direction: column; gap: 12px; max-width: 680px; }
.trd-final .r-btn { position: relative; flex: none; }

/* ── Планшет и телефон ── */
@media (max-width: 1099px) {
  .trd-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trd-gl, .trd-risks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .trd-how, .trd-duo, .trd-calc { grid-template-columns: 1fr; }
  .trd-faq { grid-template-columns: 1fr; gap: 24px; }
  .trd-final { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 899px) {
  .trd-hero { padding: 32px 28px; }
  .trd-hero .r-hero-art img { width: 200px; height: 200px; }
}
@media (max-width: 719px) {
  .trd-sec { padding-top: 44px; gap: 22px; }
  .trd-hero { padding: 26px 20px; gap: 18px; }
  .trd-hero .r-hero-art { display: none; }
  .trd-hero .r-lead { font-size: 16px; }
  .trd-btns .r-btn { flex: 1 1 auto; }
  .trd-hero .r-chip { white-space: normal; height: auto; min-height: 34px; padding: 6px 12px; }
  .trd-risk { padding: 24px 20px; gap: 18px; }
  .trd-h2s { font-size: 24px; }
  .trd-risk-ic { width: 44px; height: 44px; border-radius: 14px; }
  .trd-risk-list { grid-template-columns: 1fr; }
  .trd-cmp, .trd-fit { padding: 24px 20px; }
  .trd-cmp-top h3 { font-size: 22px; }
  .trd-dl > div { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
  .trd-how-b { padding: 24px 20px; }
  .trd-tbl :is(th, td) { padding: 13px 16px; }
  .trd-tbl:not(.trd-tbl--liq) tbody tr { display: flex; flex-direction: column; }
  .trd-tbl:not(.trd-tbl--liq) tbody th { width: auto; padding-bottom: 2px; font-size: 13px; }
  .trd-tbl:not(.trd-tbl--liq) tbody td { padding-top: 0; border-top: 0 !important; }
  .trd-tbl--liq tbody th { width: 64px; }
  .trd-calc { padding: 22px 18px; gap: 24px; }
  .trd-out { padding: 18px; }
  .trd-res-big dd { font-size: 22px; }
  .trd-res dt { flex: 1 1 auto; font-size: 13px; }
  .trd-res dd { font-size: 15px; text-align: end; }
  .trd-tbl--liq td span:last-child { white-space: nowrap; }
  .trd-bar { width: calc(var(--w) * 0.32); }
  .trd-calc-btn { align-self: stretch; }
  .trd-gl, .trd-risks, .trd-links { grid-template-columns: 1fr; gap: 10px; }
  .trd-gl-i, .trd-risk-i { padding: 20px; }
  .trd-qa-i summary { font-size: 16px; }
  .trd-final { padding: 28px 20px; }
  .trd-final .r-btn { align-self: stretch; }
}
@media (max-width: 359px) {
  .trd-hero { padding: 22px 16px; }
  .trd-risk, .trd-cmp, .trd-fit, .trd-how-b { padding: 20px 16px; }
  .trd-calc { padding: 18px 12px; }
  .trd-seg span { font-size: 13px; height: 40px; }
  .trd-final { padding: 24px 16px; }
  .trd-btns .r-btn { padding: 0 14px; font-size: 14px; white-space: normal; text-align: center; line-height: 1.2; }
}

/* Справа налево: ползунок движения цены — слева направо (минус слева, плюс справа), как на графике. */
[dir="rtl"] .trd-range { direction: ltr; }

/* qa seo-1107: на узком телефоне (320–375) длинная подпись кнопки (de/pt/fr) переносится, а не вылезает за кнопку. */
@media (max-width: 379px) {
  main .r-btn { white-space: normal; height: auto; min-height: 52px; padding-top: 10px; padding-bottom: 10px; line-height: 1.25; text-align: center; }
}
