// Subscription Box — admin product-edit styles.
//
// Design rules for this feature:
//  * one control height (32px) for every input/select/button in the modal;
//  * one spacing scale (4/8/12/16/24);
//  * sections are white cards on a light canvas with a clear title + hint;
//  * WP admin palette, 4px radii, no bespoke colours outside the tokens below.

$box-primary: #2271b1;
$box-primary-dark: #135e96;
$box-danger: #d63638;
$box-success: #00a32a;
$box-warning: #dba617;
$box-ink: #1d2327;
$box-muted: #646970;
$box-border: #c3c4c7;
$box-border-soft: #dcdcde;
$box-canvas: #f0f0f1;
$box-hover: #f6f7f7;
$box-accent-bg: #f0f6fc;

$box-control-h: 32px;
$box-radius: 4px;

@keyframes arraysubs-box-spin {
  to {
    transform: rotate(360deg);
  }
}

.arraysubs-box-spin {
  animation: arraysubs-box-spin 1s linear infinite;
}

// ---------------------------------------------------------------------------
// Shared control primitives (used inside the panel and the modal)
// ---------------------------------------------------------------------------
%box-control {
  box-sizing: border-box;
  width: 100%;
  min-height: $box-control-h;
  height: $box-control-h;
  padding: 0 8px;
  border: 1px solid $box-border;
  border-radius: $box-radius;
  background: #fff;
  color: $box-ink;
  font-size: 13px;
  line-height: normal;
  box-shadow: none;

  &:focus {
    border-color: $box-primary;
    box-shadow: 0 0 0 1px $box-primary;
    outline: none;
  }
}

.arraysubs-box-general,
.arraysubs-box-modal-editor {
  // Normalize every control the feature renders, overriding both WP core's
  // 40px .wp-core-ui sizing and WooCommerce's panel input rules.
  input[type="text"].arraysubs-box-input,
  input[type="number"].arraysubs-box-input,
  select.arraysubs-box-input,
  .arraysubs-box-field-item input[type="text"],
  .arraysubs-box-field-item input[type="number"],
  .arraysubs-box-field-item select,
  .arraysubs-box-options-editor__row input[type="text"],
  .arraysubs-box-range-card__point input[type="number"],
  .arraysubs-box-step-row__title {
    @extend %box-control;
  }

  select.arraysubs-box-input,
  .arraysubs-box-field-item select {
    padding-right: 24px;
  }

  // WooCommerce floats panel labels at 150px — reset inside our UI, but never
  // touch labels that are components in their own right (toggles/switches).
  label:not(.arraysubs-box-toggle):not(.arraysubs-box-switch) {
    float: none;
    width: auto;
    margin: 0;
  }

  // Component labels keep their own box model.
  label.arraysubs-box-toggle,
  label.arraysubs-box-switch {
    float: none;
    margin: 0;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
  }

  // The step title is a control but must not consume the header row; this
  // override lives here so it outranks the %box-control extend above.
  .arraysubs-box-step-row__title {
    width: 260px;
    max-width: 100%;
    flex: 0 1 260px;
    font-weight: 600;
  }

  .button {
    min-height: $box-control-h;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
    padding: 4px 12px;
    border-radius: $box-radius;
  }
}

// ---------------------------------------------------------------------------
// General-tab panel
// ---------------------------------------------------------------------------
.arraysubs-box-panel {
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;

  &__intro {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  &__intro-title {
    font-size: 14px;
    font-weight: 600;
    color: $box-ink;
  }

  &__intro-text {
    margin: 0;
    color: $box-muted;
    font-size: 13px;
    line-height: 1.5;
    max-width: 70ch;
  }
}

.arraysubs-box-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;

  &__summary-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  &__count {
    color: $box-muted;
    font-size: 12px;
  }

  &__empty {
    border: 1px dashed $box-border;
    border-radius: $box-radius;
    padding: 20px 16px;
    color: $box-muted;
    text-align: center;
    font-size: 13px;
    background: $box-hover;
  }

  &__preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

.arraysubs-box-configure-btn.button {
  background: $box-primary;
  border-color: $box-primary;
  color: #fff;

  &:hover,
  &:focus {
    background: $box-primary-dark;
    border-color: $box-primary-dark;
    color: #fff;
  }
}

// Fact strip (billing / signup fees / renewal sync)
.arraysubs-box-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.arraysubs-box-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid $box-border-soft;
  border-radius: $box-radius;
  background: #fff;
  min-width: 160px;

  &__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: $box-muted;
  }

  &__value {
    font-size: 13px;
    font-weight: 600;
    color: $box-ink;
  }
}

.arraysubs-box-summary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid $box-border-soft;
  border-radius: $box-radius;
  overflow: hidden;

  th,
  td {
    text-align: left;
    padding: 8px 12px;
    font-size: 12px;
    color: $box-ink;
    vertical-align: top;
    border-bottom: 1px solid $box-border-soft;
  }

  th {
    background: $box-hover;
    font-weight: 600;
    color: $box-muted;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.03em;
  }

  tr:last-child td {
    border-bottom: none;
  }
}

// ---------------------------------------------------------------------------
// Modal wizard shell
// ---------------------------------------------------------------------------
.arraysubs-box-modal-editor {
  &__inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
  }

  &__screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  &__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    // The parent .arraysubs-modal__content scroll area has its own 16px
    // bottom padding; a sticky child only sticks to that padding edge, so
    // without the negative offset the last 16px of scrolled content shows
    // through in the gap below this bar. Extend into that padding and add
    // it back as our own bottom padding so the footer still looks spaced
    // from the modal edge, now with an opaque background covering it.
    padding: 12px 0 16px;
    border-top: 1px solid $box-border-soft;
    position: sticky;
    bottom: -16px;
    background: #fff;
    z-index: 2;

    &-spacer {
      flex: 1;
    }
  }
}

.arraysubs-box-wizard-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;

  &__step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: $box-control-h;
    border: 1px solid $box-border;
    background: #fff;
    border-radius: 999px;
    padding: 4px 16px 4px 6px;
    cursor: pointer;
    font-size: 13px;
    color: $box-muted;
    transition: all 0.15s ease;

    &:hover {
      border-color: $box-primary;
      color: $box-primary;
    }

    &.is-active {
      border-color: $box-primary;
      color: $box-primary;
      background: $box-accent-bg;
      font-weight: 600;

      .arraysubs-box-wizard-nav__index {
        background: $box-primary;
        color: #fff;
      }
    }
  }

  &__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: $box-border-soft;
    color: $box-ink;
    font-size: 11px;
    font-weight: 600;
    flex: 0 0 auto;
  }

  &__divider {
    flex: 0 0 20px;
    height: 1px;
    background: $box-border;
  }
}

.arraysubs-box-validation-notice {
  border-left: 4px solid $box-danger;
  background: #fcf0f1;
  padding: 10px 14px;
  color: $box-ink;
  font-size: 13px;
  border-radius: 0 $box-radius $box-radius 0;
}

// ---------------------------------------------------------------------------
// Sections + fields
// ---------------------------------------------------------------------------
.arraysubs-box-section {
  background: #fff;
  border: 1px solid $box-border-soft;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;

  &__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  &__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: $box-ink;
  }

  &__desc {
    margin: 0;
    font-size: 12px;
    color: $box-muted;
    line-height: 1.5;
    max-width: 80ch;
  }
}

.arraysubs-box-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.arraysubs-box-field {
  display: flex;
  flex-direction: column;
  gap: 6px;

  &__label {
    font-size: 11px;
    font-weight: 600;
    color: $box-ink;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  &__help {
    font-size: 11px;
    color: $box-muted;
    line-height: 1.4;
  }
}

.arraysubs-box-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid $box-border-soft;
  border-radius: $box-radius;
  background: $box-hover;

  input[type="checkbox"] {
    margin: 2px 0 0;
    flex: 0 0 auto;
  }

  > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: $box-ink;
  }
}

// Info / warning alert card
.arraysubs-box-alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: $box-radius;
  background: $box-accent-bg;
  border: 1px solid #c5d9ed;
  color: $box-ink;
  font-size: 12px;
  line-height: 1.6;

  &--warning {
    background: #fcf9e8;
    border-color: #f0e2a8;
  }

  &__icon {
    flex: 0 0 auto;
    margin-top: 1px;
    color: $box-primary;
  }

  &--warning &__icon {
    color: $box-warning;
  }

  &__body {
    display: flex;
    flex-direction: column;
    gap: 6px;

    ul {
      margin: 0;
      padding-left: 18px;
      list-style: disc;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    li {
      margin: 0;
    }
  }
}

// ---------------------------------------------------------------------------
// Steps builder (level-1 repeater)
// ---------------------------------------------------------------------------
.arraysubs-box-steps-builder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arraysubs-box-empty {
  border: 1px dashed $box-border;
  border-radius: $box-radius;
  padding: 24px;
  text-align: center;
  color: $box-muted;
  font-size: 13px;
  background: $box-hover;
}

.arraysubs-box-step-row {
  border: 1px solid $box-border;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;

  &__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: $box-hover;
    border-bottom: 1px solid $box-border-soft;
  }

  &.is-collapsed &__header {
    border-bottom: none;
  }

  &__icon {
    color: $box-muted;
    flex: 0 0 auto;
  }

  &__number {
    color: $box-muted;
    font-size: 11px;
    font-weight: 600;
    flex: 0 0 auto;
  }

  &__collapse-area {
    flex: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 6px 0;
    min-width: 0;
  }

  &__count {
    color: $box-muted;
    font-size: 12px;
  }

  &__actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
  }

  &__chevron {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    color: $box-muted;
    border-radius: $box-radius;

    &:hover {
      background: $box-border-soft;
      color: $box-ink;
    }
  }

  &__body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fbfbfc;
  }
}

.arraysubs-box-collapse-icon {
  transition: transform 0.15s ease;

  &.is-expanded {
    transform: rotate(90deg);
  }
}

// Compact icon-only buttons — same footprint everywhere.
.arraysubs-box-icon-btn.button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: $box-muted;

  &:hover:not(:disabled) {
    color: $box-ink;
    border-color: $box-border;
  }

  &:disabled {
    opacity: 0.45;
  }

  &--danger {
    color: $box-danger;
    border-color: #e3a6a7;

    &:hover:not(:disabled) {
      color: #fff;
      background: $box-danger;
      border-color: $box-danger;
    }
  }
}

.arraysubs-box-add-step,
.arraysubs-box-add-element,
.arraysubs-box-add-option {
  &.button {
    border-style: dashed;
    border-color: $box-primary;
    color: $box-primary;
    background: transparent;
    align-self: flex-start;

    &:hover,
    &:focus {
      background: $box-accent-bg;
      color: $box-primary-dark;
      border-color: $box-primary-dark;
    }
  }
}

// ---------------------------------------------------------------------------
// Element rows (level-2 repeater)
// ---------------------------------------------------------------------------
.arraysubs-box-element-row {
  border: 1px solid $box-border-soft;
  border-radius: 6px;
  background: #fff;

  &__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
  }

  &:not(.is-collapsed) &__header {
    border-bottom: 1px solid $box-border-soft;
    background: $box-hover;
    border-radius: 6px 6px 0 0;
  }

  &__collapse {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    color: $box-muted;
    border-radius: $box-radius;
    flex: 0 0 auto;

    &:hover {
      background: $box-border-soft;
    }
  }

  &__type-badge {
    background: $box-accent-bg;
    border: 1px solid #c5d9ed;
    color: $box-primary;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  &__summary {
    flex: 1;
    font-size: 12px;
    color: $box-ink;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  &__required-badge {
    font-size: 10px;
    font-weight: 600;
    color: $box-danger;
    border: 1px solid #e3a6a7;
    background: #fcf0f1;
    border-radius: 3px;
    padding: 1px 6px;
    flex: 0 0 auto;
  }

  &__actions {
    display: inline-flex;
    gap: 4px;
    flex: 0 0 auto;
  }

  &__body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
}

.arraysubs-box-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: start;

  &--discount-controls {
    > .arraysubs-box-field-item > select {
      width: 100%;
      max-width: none;
    }

    .arraysubs-box-field-item--actions {
      align-self: start;
    }
  }
}

.arraysubs-box-field-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;

  > span:first-child {
    font-size: 11px;
    font-weight: 600;
    color: $box-ink;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  small {
    display: block;
    color: $box-muted;
    font-size: 11px;
    line-height: 1.45;
  }

  &__control-spacer {
    visibility: hidden;
  }

  &--wide {
    grid-column: 1 / -1;

    // Help text under a full-width picker would otherwise stretch to the
    // whole modal and become hard to scan.
    small {
      max-width: 80ch;
    }
  }

  &--toggle {
    max-width: 170px;
  }

  &--actions {
    align-self: end;

    .button {
      width: 100%;
    }
  }
}

// Toggle switch (element "required", segment activation)
.arraysubs-box-toggle,
.arraysubs-box-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;

  input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;

    &:checked + span {
      background: $box-success;

      &::before {
        transform: translateX(16px);
      }
    }

    &:focus-visible + span {
      box-shadow:
        0 0 0 2px $box-accent-bg,
        0 0 0 3px $box-primary;
    }
  }

  &__slider,
  &__track {
    position: absolute;
    inset: 0;
    background: $box-border;
    border-radius: 22px;
    transition: background 0.15s ease;
    pointer-events: none;

    &::before {
      content: "";
      position: absolute;
      width: 16px;
      height: 16px;
      left: 3px;
      top: 3px;
      background: #fff;
      border-radius: 50%;
      transition: transform 0.15s ease;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
  }
}

.arraysubs-box-check-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.arraysubs-box-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: $box-ink;

  input[type="checkbox"] {
    margin: 0;
  }
}

.arraysubs-box-options-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;

  &__row {
    display: flex;
    gap: 8px;
    align-items: center;

    input[type="text"] {
      flex: 1;
      min-width: 0;
    }
  }
}

// ---------------------------------------------------------------------------
// AJAX select
// ---------------------------------------------------------------------------
.arraysubs-box-ajax-select {
  position: relative;

  &__trigger {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fff;
    border: 1px solid $box-border;
    border-radius: $box-radius;
    padding: 4px 8px;
    min-height: $box-control-h;
    cursor: pointer;
    text-align: left;

    &:focus-visible {
      border-color: $box-primary;
      box-shadow: 0 0 0 1px $box-primary;
      outline: none;
    }
  }

  &__values {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    min-width: 0;
  }

  &__placeholder {
    color: $box-muted;
    font-size: 13px;
  }

  &__tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: $box-accent-bg;
    border: 1px solid #c5d9ed;
    color: $box-primary;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 12px;
    max-width: 100%;
  }

  &__tag-remove {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: $box-primary;
    opacity: 0.7;

    &:hover {
      opacity: 1;
      color: $box-danger;
    }
  }

  &__chevron {
    color: $box-muted;
    flex: 0 0 auto;
  }

  &__dropdown {
    position: absolute;
    z-index: 100;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid $box-border;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
    overflow: hidden;
  }

  &__search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid $box-border-soft;
    color: $box-muted;

    input {
      flex: 1;
      border: none;
      box-shadow: none;
      min-height: 24px;
      height: 24px;
      padding: 0;
      font-size: 13px;
      outline: none;
      background: transparent;

      &:focus {
        box-shadow: none;
        border: none;
      }
    }
  }

  &__options {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  &__note {
    padding: 12px 10px;
    color: $box-muted;
    font-size: 12px;
    text-align: center;

    // A failed request is not an empty result set — say so.
    &--error {
      color: $box-danger;
      background: #fcf0f1;
    }
  }

  &__option {
    background: transparent;
    border: none;
    text-align: left;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: $box-ink;

    &:hover {
      background: $box-hover;
    }

    &.is-selected {
      background: $box-accent-bg;
      color: $box-primary;
      font-weight: 600;
    }
  }
}

// ---------------------------------------------------------------------------
// Discounts & freebies
// ---------------------------------------------------------------------------
.arraysubs-box-discounts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.arraysubs-box-range-slider {
  padding: 26px 9px 0;

  &__bar {
    position: relative;
    height: 14px;
    border-radius: 7px;
    border: 1px solid $box-border-soft;
  }

  &__input {
    // Overlaid native ranges: the track ignores the pointer, thumbs take it.
    position: absolute;
    inset: -4px 0 auto;
    width: 100%;
    height: 22px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;

    &::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      pointer-events: auto;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #fff;
      border: 3px solid $box-ink;
      cursor: ew-resize;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    }

    &::-moz-range-thumb {
      pointer-events: auto;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #fff;
      border: 3px solid $box-ink;
      cursor: ew-resize;
    }

    &::-webkit-slider-runnable-track,
    &::-moz-range-track {
      background: transparent;
    }

    &:focus {
      outline: none;
    }
  }

  &__bubble {
    position: absolute;
    top: -24px;
    transform: translateX(-50%);
    background: $box-ink;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    padding: 2px 7px;
    white-space: nowrap;
  }

  &__scale {
    display: flex;
    justify-content: space-between;
    color: $box-muted;
    font-size: 11px;
    margin-top: 8px;
  }
}

.arraysubs-box-ranges {
  display: flex;
  flex-direction: column;
  gap: 12px;

  &[hidden] {
    display: none;
  }
}

.arraysubs-box-range-card {
  border: 1px solid $box-border-soft;
  border-radius: 6px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;

  &__header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;

    strong {
      font-size: 13px;
    }
  }

  &__swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: 0 0 auto;
  }

  &__point {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;

    label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      color: $box-muted;
    }

    input[type="number"] {
      width: 100px;
    }
  }
}

.arraysubs-box-range-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;

  &[hidden] {
    display: none;
  }

  .arraysubs-box-summary-table {
    th:first-child,
    td:first-child {
      padding-left: 16px;
    }

    td {
      vertical-align: middle;
    }
  }

  &__title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: $box-muted;
  }

  &__range-label {
    display: flex;
    align-items: center;
    gap: 6px;
  }
}

// ---------------------------------------------------------------------------
// Sync renewals step
// ---------------------------------------------------------------------------
.arraysubs-box-sync {
  &__slider {
    padding: 26px 9px 0;
  }

  &__bar {
    position: relative;
    height: 14px;
    border-radius: 7px;
    border: 1px solid $box-border-soft;
  }

  &__range {
    position: absolute;
    inset: -4px 0 auto;
    width: 100%;
    height: 22px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;

    &::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      pointer-events: auto;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #fff;
      border: 3px solid $box-ink;
      cursor: ew-resize;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    }

    &::-moz-range-thumb {
      pointer-events: auto;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #fff;
      border: 3px solid $box-ink;
      cursor: ew-resize;
    }

    &:focus {
      outline: none;
    }
  }

  &__bubble {
    position: absolute;
    top: -24px;
    transform: translateX(-50%);
    background: $box-ink;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    padding: 2px 7px;
    white-space: nowrap;
  }

  &__scale {
    display: flex;
    justify-content: space-between;
    color: $box-muted;
    font-size: 11px;
    margin-top: 8px;
  }

  &__legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  &__legend-row {
    display: flex;
    align-items: center;
    gap: 12px;

    &.is-inactive {
      opacity: 0.55;
    }
  }

  &__range-label {
    font-size: 12px;
    font-weight: 600;
    color: $box-ink;
    min-width: 80px;
  }

  &__seg-label {
    font-size: 12px;
    color: $box-muted;
  }
}

@media (max-width: 782px) {
  .arraysubs-box-step-row {
    &__header {
      flex-wrap: wrap;
    }

    &__title {
      width: 100%;
    }
  }

  .arraysubs-box-range-card__point {
    margin-left: 0;
    width: 100%;
  }
}
