.tabs-with-state {

  input[type="radio"].tab-state {
    display: none;
    appearance: none;
  }

  nav[role="tablist"] {
    border-bottom: var(--border-size-1) solid var(--border-color);
    border-collapse: collapse;
  }

  [role="tab"] {
    display: inline-block;
    margin: 1.5rem 0.5rem calc(-1 * var(--border-size-1)) 0;
    padding: 0.25rem 0.75rem 0;
    font-size: var(--font-size-m);
    line-height: 2;
    color: var(--gray-text);

    border: var(--border-size-1) solid var(--border-color);
    border-radius: var(--button-border-radius) var(--button-border-radius) 0 0;
    cursor: pointer;
  }

  [role="tabpanel"] {
    display: none;
  }

  [type="radio"].tab-state:nth-of-type(1):checked ~ [role="tablist"] [role="tab"]:nth-of-type(1),
  [type="radio"].tab-state:nth-of-type(2):checked ~ [role="tablist"] [role="tab"]:nth-of-type(2),
  [type="radio"].tab-state:nth-of-type(3):checked ~ [role="tablist"] [role="tab"]:nth-of-type(3),
  [type="radio"].tab-state:nth-of-type(4):checked ~ [role="tablist"] [role="tab"]:nth-of-type(4),
  [type="radio"].tab-state:nth-of-type(5):checked ~ [role="tablist"] [role="tab"]:nth-of-type(5),
  [type="radio"].tab-state:nth-of-type(6):checked ~ [role="tablist"] [role="tab"]:nth-of-type(6),
  [type="radio"].tab-state:nth-of-type(7):checked ~ [role="tablist"] [role="tab"]:nth-of-type(7),
  [type="radio"].tab-state:nth-of-type(8):checked ~ [role="tablist"] [role="tab"]:nth-of-type(8),
  [type="radio"].tab-state:nth-of-type(9):checked ~ [role="tablist"] [role="tab"]:nth-of-type(9) {
    color: var(--canvas-text);
    font-weight: 600;
    border-bottom-color: var(--canvas);
  }

  [type="radio"].tab-state:nth-of-type(1):checked ~ [role="tabpanel"]:nth-of-type(1),
  [type="radio"].tab-state:nth-of-type(2):checked ~ [role="tabpanel"]:nth-of-type(2),
  [type="radio"].tab-state:nth-of-type(3):checked ~ [role="tabpanel"]:nth-of-type(3),
  [type="radio"].tab-state:nth-of-type(4):checked ~ [role="tabpanel"]:nth-of-type(4),
  [type="radio"].tab-state:nth-of-type(1):checked ~ [role="tabpanel"]:nth-of-type(5),
  [type="radio"].tab-state:nth-of-type(2):checked ~ [role="tabpanel"]:nth-of-type(6),
  [type="radio"].tab-state:nth-of-type(3):checked ~ [role="tabpanel"]:nth-of-type(7),
  [type="radio"].tab-state:nth-of-type(4):checked ~ [role="tabpanel"]:nth-of-type(8),
  [type="radio"].tab-state:nth-of-type(1):checked ~ [role="tabpanel"]:nth-of-type(9) {
  	display: block;
  }
}


.tabs.pillboxes {

  [role="tablist"] {
    display: flex;
    margin-bottom: 0.5rem;
    gap: 1rem;

    [role="tab"] {
      border-radius: 3rem;
      color: var(--gray-text);
      cursor: pointer;
      text-decoration: none;
      text-align: center;
      padding: 0.5rem 0.75rem;
      position: relative;
      top: 0px;

      &.with-icon {
        padding-inline: 0.75rem 1.15rem;
      }
      
      &.active {
        color: var(--accent-color-text);
        font-weight: 600;
        background-color: var(--accent-color);
      }
    }
  }

  [role="tabpanel"] {
    display: none;
    overflow: auto;
   
    &.active {
      display: inherit;
    }
  }
}


.tabs.underlined {

  [role="tablist"] {
    display: flex;
    margin-bottom: 0.5rem;
    gap: 1rem;
    border-bottom: var(--border-size-2) solid var(--border-color);

    a:hover {
      text-decoration: none !important;
    }

    [role="tab"] {
      color: var(--gray-text);
      cursor: pointer;
      text-decoration: none;
      text-align: center;
      padding: 0.5rem 0.75rem;
      position: relative;
      top: var(--border-size-2);
      align-items: end;
      border-bottom: var(--border-size-2) solid var(--border-color);

      &.with-icon {
        padding-inline: 0.75rem 1.15rem;
      }
      
      &.active {
        color: var(--accent-color);
        font-weight: 600;
        border-bottom: var(--border-size-2) solid var(--accent-color);
      }
    }
  }

  [role="tabpanel"] {
    display: none;
    overflow: auto;
   
    &.active {
      display: inherit;
    }
  }
}



@container (width < 480px) {
  .tabs.underlined {
    [role="tablist"]  {
      flex-direction: column;
      justify-content: center;
      border-bottom: none !important;
    }

    [role="tab"] {
      justify-content: center;
      border-bottom: var(--border-size-2) solid transparent;

      &.active {
        padding-inline: 0 !important;
      }
    }
  }
}
