/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

@import url("chrome://global/content/elements/moz-box.tokens.css");

:host {
  display: block;
  outline: var(--box-border);
  border-radius: var(--box-border-radius);
  overflow: hidden;
}

::slotted(*) {
  --box-border-inline-end: none;
  --box-border-inline-start: none;
}

::slotted(*:not(.last)) {
  --box-border-radius-end: 0;
  --box-border-block-end: 0;
}

::slotted(*:not(.first, [position="0"])) {
  --box-border-radius-start: 0;
}

/* targets the first element when we have a header, since the element at
position 0 won't have the .first class */
::slotted([position="0"]:not(.first)) {
  --box-border-radius-start: 0;
  --box-border-block-start: none;
}

::slotted(.first) {
  --box-border-radius-start: var(--box-border-radius-inner);
  --box-border-block-start: none;
}

::slotted(.last) {
  --box-border-radius-end: var(--box-border-radius-inner);
  --box-border-block-end: none;
}

slot[name="header"]::slotted(:first-child) {
  --box-border-block-end: var(--box-border);
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.scroll-container {
  max-height: var(--box-group-max-height, none);
  overflow-y: auto;
}
