/* Custom range panel for the billing statement filter (components/settings/billing-custom-range.html). */
.gf-billing-custom-range {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 41;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 428px;
  max-width: calc(100vw - 32px);
  padding: 14px;
  border: 1px solid #eef1f5;
  /* Matches the range menu this panel opens from, so the two read as one family. */
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
  font-family: var(--gf-font);
}

.gf-billing-custom-range .gf-billing-custom-range__fields {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Both dates share one line; only the phone layout below stacks them. */
  flex-wrap: nowrap;
}

.gf-billing-custom-range .gf-billing-custom-range__field {
  flex: 1 1 0;
  min-width: 186px;
}

/* The shared date field borrows its input look from the host form; give it one here.
   Pill-shaped, like the range chip it opens from and the actions below it. */
.gf-billing-custom-range .gf-date-field__trigger {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #ffffff;
  color: #101828;
  font-size: var(--gf-text-body);
}

.gf-billing-custom-range .gf-date-field__trigger:hover {
  border-color: #98a2b3;
}

/* The chosen date is body copy, not a caption: pin it so no host form rule shrinks it. */
.gf-billing-custom-range .gf-date-field__value {
  font-family: var(--gf-font);
  font-size: var(--gf-text-body);
  line-height: var(--gf-leading-body);
  font-weight: var(--gf-weight-normal);
}

.gf-billing-custom-range .gf-date-field.is-open .gf-date-field__trigger,
.gf-billing-custom-range .gf-date-field__trigger:focus-visible {
  border-color: #2966f4;
  outline: 2px solid rgba(41, 102, 244, 0.16);
  outline-offset: 0;
}

.gf-billing-custom-range .gf-billing-custom-range__dash {
  color: #667085;
  font-size: var(--gf-text-body);
}

.gf-billing-custom-range .gf-billing-custom-range__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.gf-billing-custom-range .gf-billing-custom-range__cancel,
.gf-billing-custom-range .gf-billing-custom-range__apply {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: var(--gf-font);
  font-size: var(--gf-text-body);
  line-height: var(--gf-leading-body);
  cursor: pointer;
}

.gf-billing-custom-range .gf-billing-custom-range__cancel {
  border: 1px solid #d0d5dd;
  background: #ffffff;
  color: #344054;
  font-weight: var(--gf-weight-medium);
}

.gf-billing-custom-range .gf-billing-custom-range__apply {
  border: 0;
  background: #2966f4;
  color: #ffffff;
  font-weight: var(--gf-weight-semibold);
}

.gf-billing-custom-range .gf-billing-custom-range__apply:hover {
  background: #2054cc;
}

/* Only a phone is too narrow for two pills and the dash (428px panel + gutters).
   Everything wider keeps them on one line. */
@media (max-width: 560px) {
  .gf-billing-custom-range {
    min-width: 0;
    width: 100%;
  }

  /* Two full-width dates do not fit side by side on a phone, so they stack. */
  .gf-billing-custom-range .gf-billing-custom-range__fields {
    flex-direction: column;
    align-items: stretch;
  }

  .gf-billing-custom-range .gf-billing-custom-range__field {
    min-width: 0;
  }

  .gf-billing-custom-range .gf-billing-custom-range__dash {
    display: none;
  }
}
