/* ── Calc title glow override ── */
.sell-title-wrap.sell-title-wrap--calc::before{
  background:
    radial-gradient(ellipse at 50% 30%, rgba(251,146,60,1) 0%, rgba(253,186,116,.8) 20%, rgba(253,186,116,0) 44%),
    radial-gradient(ellipse at 50% 55%, rgba(244,63,94,.85) 0%, rgba(251,113,133,.5) 34%, rgba(251,113,133,0) 70%),
    radial-gradient(ellipse at 50% 80%, rgba(251,191,36,.65) 0%, rgba(250,204,21,.25) 50%, rgba(15,23,42,0) 88%) !important;
}

/* ── Income Chart (interactive line graph) ── */
.income-chart{
  max-width:720px;
  margin:0 auto 100px;
  padding:36px 28px 32px;
  border-radius:24px;
  border:1px solid rgba(30,39,51,.6);
  background:
    radial-gradient(circle at 20% 20%, rgba(167,139,250,.06), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(244,114,182,.04), transparent 55%),
    rgba(13,17,23,.55);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
  opacity:0;
  transform:translateY(24px);
  transition:opacity .6s ease, transform .6s ease;
}
.income-chart.is-revealed{
  opacity:1;
  transform:translateY(0);
}

.income-chart-footer{
  text-align:center;
  margin-top:24px;
}
.income-chart-disclaimer{
  margin:20px auto 0;
  padding-top:18px;
  max-width:560px;
  border-top:1px solid var(--border);
  font-size:13px;
  line-height:1.55;
  color:var(--text-dim);
  text-align:center;
}
.income-chart-controls{
  display:grid;
  grid-template-columns:auto auto auto auto;
  column-gap:12px;
  row-gap:10px;
  justify-content:center;
  align-items:center;
}
.income-chart-controls label{
  font-size:14px;
  color:var(--text-dim);
  font-weight:600;
  white-space:nowrap;
  text-align:right;
}
.income-chart-val{
  min-width:56px;
  font-size:16px;
  font-weight:700;
  color:var(--accent);
  text-align:right;
}
.income-chart-unit{
  font-size:13px;
  color:var(--text-dim);
  white-space:nowrap;
  text-align:left;
}

/* Десктоп: возвращаем старую grid-раскладку.
   Благодаря display: contents дочерние элементы "раскрываются" обратно в grid,
   как будто обёртки income-control-group и income-chart-val-unit отсутствуют. */
@media(min-width:901px){
  .income-control-group{
    display:contents;
  }

  .income-chart-val-unit{
    display:contents;
  }
}

/* Check inputs (inside grid) */
.income-check-inputs{
  grid-column:2 / -1;
  display:flex;
  gap:10px;
  align-items:center;
}
.income-check-input{
  width:82px;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid var(--border-accent);
  background:var(--surface-2);
  color:var(--accent);
  font-size:15px;
  font-weight:700;
  text-align:center;
  outline:none;
  transition:border-color .15s;
  -moz-appearance:textfield;
  appearance:textfield;
}
.income-check-input::-webkit-inner-spin-button,
.income-check-input::-webkit-outer-spin-button{
  -webkit-appearance:none;
  margin:0;
}
.income-check-input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(167,139,250,.18);
}

/* Range slider */
.income-chart-slider{
  -webkit-appearance:none;
  appearance:none;
  width:clamp(70px,14vw,150px);
  height:6px;
  border-radius:3px;
  background:var(--border);
  outline:none;
  cursor:pointer;
}
.income-chart-slider::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:11px;height:11px;
  border-radius:50%;
  background:linear-gradient(135deg,#a78bfa,#818cf8);
  cursor:pointer;
  box-shadow:0 2px 10px rgba(167,139,250,.45);
  transition:transform .12s, box-shadow .12s;
}
.income-chart-slider::-webkit-slider-thumb:hover{
  transform:scale(1.15);
  box-shadow:0 3px 14px rgba(167,139,250,.6);
}
.income-chart-slider::-moz-range-thumb{
  width:11px;height:11px;
  border-radius:50%;
  background:linear-gradient(135deg,#a78bfa,#818cf8);
  cursor:pointer;
  border:none;
  box-shadow:0 2px 10px rgba(167,139,250,.45);
}

.income-chart-canvas{
  position:relative;
  width:100%;
}
.income-chart-canvas svg{
  display:block;
  width:100%;
  height:auto;
}
.income-chart-canvas svg text{
  font-family:inherit;
}

@media(max-width:900px){
  .income-chart{
    padding:24px 12px 24px;
    margin:0 24px 80px;
    overflow-x:hidden; /* защита от горизонтального вылета */
  }

  /* Мобильная правка: вместо 4-колоночного grid делаем вертикальный layout.
     Так убираем горизонтальный вылет "Аудитория/Период/Чеки" (влево) и единиц (вправо). */
  .income-chart-controls{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    width:100%;
    box-sizing:border-box;
  }

  .income-control-group{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
  }

  .income-control-group > label{
    width:100%;
    text-align:left;
    white-space:normal;
    display:block;
    align-self:flex-start;
  }

  /* Подпись "Чеки:" (вне income-control-group) */
  .income-chart-controls > label{
    width:100%;
    text-align:left;
    white-space:normal;
    display:block;
  }

  .income-chart-val{
    width:auto;
    text-align:left;
    white-space:nowrap;
  }

  .income-chart-unit{
    width:auto;
    text-align:left;
    white-space:nowrap;
  }

  /* "Число + единица" в одну строку */
  .income-chart-val-unit{
    display:flex;
    align-items:baseline;
    justify-content:center;
    gap:6px;
    width:100%;
    box-sizing:border-box;
    white-space:nowrap;
    flex-wrap:nowrap;
  }

  .income-chart-slider{
    display:block;
    margin:0 auto;
    width:clamp(70px, 30vw, 110px);
  }

  .income-check-inputs{
    grid-column:auto;
    width:100%;
    justify-content:center;
    flex-wrap:wrap;
    gap:10px 12px;
  }
}
