/* The three tabs at the top of the billing dashboard, and the line just above
   them. Picking a tab only changes its colour and background, never its size,
   so the tabs stay in the same spot on every click. */

/* The line under the page title says something different on each tab. It
   keeps room for two lines on a phone and one on a computer, so a longer
   line does not push the tabs down. */
.billing-page-summary {
  min-height: 2lh;

  @media (min-width: 1024px) {
    min-height: 1lh;
  }
}

/* Phone: three equal slots. The picked tab gets a white rounded background;
   the others keep the same size with a see-through border. A computer shows
   its own tabs instead. */
.billing-page-tabs--phone {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  margin-bottom: 1.5rem;

  @media (min-width: 1024px) {
    display: none;
  }
}

.billing-page-tabs__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 0;
  padding: 0.625rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: color-mix(in oklab, var(--color-base-content) 50%, transparent);

  &[aria-selected="true"] {
    background-color: var(--color-base-100);
    border-color: var(--color-base-300);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    color: var(--color-base-content);

    .billing-page-tabs__icon { color: var(--color-primary); }
  }
}

.billing-page-tabs__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* On a very narrow phone a label that does not fit ends in "…" inside its
   own tab, instead of running into the tab next to it. */
.billing-page-tabs__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Computer: every tab is as wide as the widest one and all use the same
   weight of text, so nothing moves when another tab is picked. If the
   window is too narrow for all three, the bar scrolls sideways. */
.billing-page-tabs--computer {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;

  .tab { font-weight: 500; }
}

/* The computer tabs sit flush left, so "eXPRS Billing" lines up with the
   title above and the steps below: the bar's padding and the first tab's own
   padding are pulled back by the same amount. */
.billing-tab-nav { margin-left: -1.25rem; }
