/* The tab row is one line at every width. A page whose labels do not fit at full size sets
   --adc-tab-font and --adc-tab-pad to values that shrink with the window (see ship-tabs.css);
   below 760 pixels every row is an icon over a one-word label, the tabs sharing the row equally. */
.adc_tabs .tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: clamp(3px, 0.5vw, 6px);
}

.adc_tabs .tabs .tab {
  padding: 10px var(--adc-tab-pad, 18px);
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 0.35em;
  min-width: 0;
  white-space: nowrap;
  cursor: pointer;
  color: #becbd2;
  border-top: 1px solid #becbd2;
  border-left: 1px solid #becbd2;
  border-right: 1px solid #becbd2;
  font-size: var(--adc-tab-font, 20px);
  border-radius: 5px 5px 0 0;
  -webkit-user-select: none;  /* Chrome all / Safari all */
  -moz-user-select: none;     /* Firefox all */
  -ms-user-select: none;      /* IE 10+ */
  user-select: none;
}

/* A row of three or fewer tabs fits at the page's full size, whatever the page sets for its
   longer rows. A page whose tabs start smaller than 20px says so in the two -max values. */
.adc_tabs .tabs:not(:has(> .tab:nth-child(4 of .tab:not(.hidden)))) {
  --adc-tab-font: var(--adc-tab-font-max, 20px);
  --adc-tab-pad: var(--adc-tab-pad-max, 18px);
}

/* A tab a page has switched off stays off: the rule above would otherwise show it. */
.adc_tabs .tabs .tab.hidden {
  display: none;
}

/* Should a label ever be wider than its share of the row, it is cut with an ellipsis, not wrapped. */
.adc_tabs .tabs .tab .text {
  overflow: hidden;
  font-size: inherit;
  text-overflow: ellipsis;
}

/* The one-word label a tab carries on a phone; the full label stands in its place from 760 up. */
.adc_tabs .tabs .tab .tab-short {
  display: none;
}

@media (width <= 759px) {
  /* The full labels do not fit across a phone, and an icon alone leaves a visitor guessing
     which tab is which. So each tab is its icon over one short word. */
  .adc_tabs .tabs {
    gap: 3px;
  }

  .adc_tabs .tabs .tab {
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    padding: 8px 2px 6px;
    font-size: 20px;
  }

  .adc_tabs .tabs .tab .text {
    display: none;
  }

  .adc_tabs .tabs .tab .tab-short {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
  }
}

/* The narrowest phones: the longest labels have a pixel or two to spare at 11px. */
@media (width <= 359px) {
  .adc_tabs .tabs .tab .tab-short {
    font-size: 10px;
    letter-spacing: 0;
  }
}

/* Narrower than any current phone's own width (a folded phone's cover screen, a split view). */
@media (width <= 319px) {
  .adc_tabs .tabs .tab {
    padding-right: 0;
    padding-left: 0;
  }

  .adc_tabs .tabs .tab .tab-short {
    font-size: 9px;
  }
}

/* Seven tabs across a phone leave each one about 45 pixels, so they give up their side padding
   and step the label down sooner. */
@media (width <= 759px) {
  .adc_tabs .tabs:has(> .tab:nth-child(7 of .tab:not(.hidden))) .tab {
    padding-right: 0;
    padding-left: 0;
  }
}

@media (width <= 409px) {
  .adc_tabs .tabs:has(> .tab:nth-child(7 of .tab:not(.hidden))) .tab .tab-short {
    font-size: 10px;
    letter-spacing: 0;
  }
}

@media (width <= 359px) {
  .adc_tabs .tabs:has(> .tab:nth-child(7 of .tab:not(.hidden))) .tab .tab-short {
    font-size: 9px;
  }
}

.adc_tabs .tabs .tab:hover {
  border-top: 2px solid #768e9d;
  color: #768e9d;
}

.adc_tabs .tabs .tab.active {
  border-top: 2px solid #47a3da;
  border-left: 1px solid #47a3da;
  border-right: 1px solid #47a3da;
  color: #47a3da;
  position: relative;
}

.adc_tabs .tabs .tab.active::after {
  content: "";
  position: absolute;
  display: block;
  height: 5px;
  width: 100%;
  left: 0;
  bottom: -2px;
  background-color: white;
  z-index: 1;
}

.adc_tabs .tabs_content .content {
  display: none;
  padding: 20px;
  border: 1px solid #47a3da;
  line-height: 20px;
  font-size: 14px;
}

.adc_tabs .tabs_content .content.active {
  display: block;
}

.adc_tabs .tabs_content .content.active.css-fancy-box {
  display: -ms-flexbox;
  display: flex !important;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}
