/* Калькулятор фьючерсов (/calc/crypto-futures; lib/futures-calc-render.js,
   public/futures-calc.js; README, «Калькуляторы» → «Калькулятор фьючерсов»).
   Общие правила калькуляторов (.calc-*) — в app.css, здесь — только своё.
   Цвета — переменные темы: правила общие для всех тем оформления */
.fcalc-form { display: block; }
.fcalc-form fieldset { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.fcalc-form legend { padding: 0; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.fcalc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; align-items: end; }
.fcalc-grid > label, .fcalc-seg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fcalc-l { overflow: hidden; text-overflow: ellipsis; }
.fcalc-form .calc-in input.fcalc-u-in { padding-right: 58px; }

/* Переключатель из двух кнопок: лонг/шорт, изолированная/кросс */
.fcalc-seg > div { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--card); }
.fcalc-seg label { position: relative; flex: 1 1 0; min-width: 0; }
.fcalc-seg label + label { border-left: 1px solid var(--border); }
.fcalc-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fcalc-seg label > span { display: block; padding: 8px 6px; line-height: 18px; text-align: center; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcalc-seg input:checked + span { background: rgba(var(--au-acc), .16); color: var(--text); font-weight: 600; }
.fcalc-seg label.up input:checked + span { color: var(--green); }
.fcalc-seg label.down input:checked + span { color: var(--red); }
.fcalc-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.fcalc-wide { grid-column: span 2; }

/* Ползунок плеча — только со скриптом: класс js на <html> ставится в <head> */
.fcalc-levbar { display: none; position: relative; margin: 10px 0 0; padding: 0 0 18px; }
html.js .fcalc-levbar { display: block; }
.fcalc-range { display: block; width: 100%; margin: 0; accent-color: var(--accent); }
.fcalc-ticks { position: absolute; left: 8px; right: 8px; bottom: 0; height: 16px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fcalc-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

/* Результат: восемь чисел в четыре колонки, на телефоне — в две */
.fcalc-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fcalc-stats .calc-stat b { overflow-wrap: anywhere; }
.fcalc-warn { color: var(--red); }
.fcalc-liq td small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.fcalc-liq tr.on td { background: rgba(var(--au-acc), .1); font-weight: 600; }
.fcalc-how p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.55; }
.fcalc-how p:last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .fcalc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .fcalc-grid { grid-template-columns: 1fr 1fr; }
  .fcalc-stats .calc-stat b { font-size: 17px; }
  /* 16 px — iPhone не увеличивает страницу при касании поля */
  .fcalc-form input, .fcalc-form select { font-size: 16px; }
  .fcalc-seg label > span { font-size: 15px; }
  /* Общее правило таблиц прячет на телефоне последнюю колонку — здесь это шорт */
  .fcalc .fcalc-liq th:last-child, .fcalc .fcalc-liq td:last-child { display: table-cell; }
}
