.agtoc-google-bar,
.agtoc-google-bar * {
  box-sizing: border-box;
}

.agtoc-google-bar {
  --agtoc-sticky-top: 8px;
  --agtoc-max-width: calc(100% - 32px);
  align-items: center;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(60,64,67,.30), 0 1px 3px 1px rgba(60,64,67,.15);
  display: flex;
  flex-direction: row;
  margin: 12px auto 24px;
  max-width: var(--agtoc-max-width);
  padding: 0 10px;
  position: sticky;
  top: var(--agtoc-sticky-top);
  transition: top .25s ease, box-shadow .2s ease;
  width: fit-content;
  z-index: 99;
}

body.admin-bar .agtoc-google-bar {
  top: calc(var(--agtoc-sticky-top) + 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar .agtoc-google-bar {
    top: calc(var(--agtoc-sticky-top) + 46px);
  }
}

.agtoc-google-bar::before,
.agtoc-google-bar::after {
  bottom: 0;
  content: "";
  height: 30px;
  pointer-events: none;
  position: absolute;
  top: calc(50% - 15px);
  width: 20px;
  z-index: 1;
}

.agtoc-google-bar::before {
  background: linear-gradient(90deg, #fff 35%, rgba(255,255,255,0));
  left: 8px;
}

.agtoc-google-bar::after {
  background: linear-gradient(270deg, #fff 35%, rgba(255,255,255,0));
  right: 8px;
}

.agtoc-list {
  display: flex;
  flex-direction: row;
  gap: 0;
  list-style: none !important;
  margin: 0 auto !important;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 !important;
  scrollbar-width: none;
  scroll-behavior: smooth;
  white-space: nowrap;
  width: 100%;
}

.agtoc-list::-webkit-scrollbar {
  display: none;
}

.agtoc-item {
  flex: 0 0 auto;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
  z-index: 2;
}

.agtoc-link {
  align-items: center;
  border-radius: 999px;
  color: #5f6368;
  display: inline-flex;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  min-height: 48px;
  max-width: 360px;
  padding: 0 18px;
  position: relative;
  text-decoration: none !important;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
  vertical-align: top;
}

.agtoc-label-full,
.agtoc-label-mobile {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agtoc-label-mobile {
  display: none;
}

.agtoc-link:visited {
  color: #5f6368;
}

.agtoc-link:hover {
  background-color: #f8f9fa;
  color: #202124;
}

.agtoc-link:focus {
  background-color: #fff;
  box-shadow: 0 0 0 2px #4285f4;
  color: #202124;
  outline: 2px solid transparent;
}

.agtoc-link.agtoc-link--active,
.agtoc-link[aria-current="true"] {
  background-color: #e8f0fe;
  color: #202124;
}

.agtoc-link.agtoc-link--active::after,
.agtoc-link[aria-current="true"]::after {
  background: var(--agtoc-accent, #1a73e8);
  border-radius: 999px;
  bottom: 7px;
  content: "";
  height: 3px;
  left: 18px;
  position: absolute;
  right: 18px;
}

.agtoc-item-h3 .agtoc-link,
.agtoc-item-h4 .agtoc-link {
  font-size: 14px;
  font-weight: 500;
}

.agtoc-button {
  align-items: center;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 50%;
  color: #5f6368;
  display: none;
  flex: 0 0 48px;
  height: 48px;
  justify-content: center;
  margin: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: relative;
  transition: opacity .2s ease, color .2s ease, border-color .2s ease;
  width: 48px;
  z-index: 3;
}

.agtoc-button .agtoc-icon {
  display: block;
  fill: currentColor;
}

.agtoc-button:hover,
.agtoc-button:focus {
  color: #202124;
}

.agtoc-button:focus {
  border-color: var(--agtoc-accent, #1a73e8);
  outline: none;
}

@media (min-width: 1024px) {
  .agtoc-google-bar {
    padding: 0;
  }

  .agtoc-google-bar::before,
  .agtoc-google-bar::after {
    display: none;
  }

  .agtoc-list {
    width: calc(100% - 96px);
  }

  .agtoc-button {
    display: flex;
  }

  .agtoc-button.agtoc-button--active {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 599px) {
  .agtoc-google-bar {
    border-radius: 24px;
    margin-left: auto;
    margin-right: auto;
    max-width: calc(100% - 20px);
    padding-left: 8px;
    padding-right: 8px;
    width: calc(100% - 20px);
  }

  .agtoc-link {
    font-size: 14px;
    min-height: 44px;
    max-width: min(58vw, 210px);
    padding: 0 13px;
  }

  .agtoc-label-full {
    display: none;
  }

  .agtoc-label-mobile {
    display: block;
  }

  .agtoc-link.agtoc-link--active::after,
  .agtoc-link[aria-current="true"]::after {
    left: 13px;
    right: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agtoc-list,
  html {
    scroll-behavior: auto;
  }

  .agtoc-google-bar,
  .agtoc-link,
  .agtoc-button {
    transition: none;
  }
}
