
button.omnifact {
  -webkit-appearance: none;
  color: var(--color-ui-primary-text);
  cursor: pointer;
  background-color: var(--color-ui-primary);
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  border-radius: 4px;
  transition: background-color .1s;
}

button.omnifact:hover {
  background-color: var(--color-ui-primary-hover);
}

#omnifact-launch {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 1000;
}

#omnifact-launch button {
  background-image: url("../assets/omnifact/icon_chat.svg");
  background-position: 50% 54%;
  width: 56px;
  height: 56px;
  transition: opacity .3s linear;
  position: absolute;
  bottom: 0;
  right: 0;
  box-shadow: 0 10px 10px #0000000a, 0 20px 25px -5px #0000001a;
}

#omnifact-launch .tooltip {
  color: var(--color-ui-secondary-text);
  pointer-events: none;
  opacity: 0;
  background: #323232;
  border-radius: 16px 16px 0;
  width: 22em;
  padding: 1em;
  transition: all .5s .1s;
  position: absolute;
  bottom: 72px;
  right: 0;
  transform: translateY(10px);
}

#omnifact-launch button:hover + .tooltip {
  opacity: 1;
  transition: all .7s .8s;
  transform: none;
}

#omnifact-layer {
  opacity: 1;
  z-index: 1001;
  pointer-events: none;
  width: 100%;
  height: 100%;
  transition: all .25s;
  position: fixed;
  top: 0;
  left: 0;
}

#omnifact-window {
  pointer-events: auto;
  background: var(--color-bg);
  border-radius: 8px;
  width: 25em;
  max-width: calc(100% - 48px);
  height: 32em;
  min-height: 24em;
  max-height: calc(100% - 48px);
  font-size: 16px;
  transition: transform .25s, width .35s .1s, height .45s;
  position: absolute;
  bottom: 16px;
  right: 16px;
  overflow: hidden;
  transform: translateX(calc(100% + 20px));
  box-shadow: 0 10px 10px #0000000a, 0 20px 25px -5px #0000001a;
}

#omnifact-window.expanded {
  width: 35em;
  height: 80em;
}

#omnifact-window.expanded .omnifact-header button.omnifact-expand {
  background-image: url("../assets/omnifact/icon_collapse.svg");
}

#omnifact-window.expanded .omnifact-output {
  width: 35em;
}

#omnifact-window .omnifact-header {
  color: var(--color-ui-secondary-text);
  background: #323232;
  justify-content: space-between;
  align-items: center;
  gap: .5em;
  width: 100%;
  height: 5.25em;
  padding: 0 1em;
  display: flex;
}

#omnifact-window .omnifact-header .omnifact-avatar {
  background-color: var(--color-bg);
  background-image: url("../assets/omnifact/energiesparkommissar.png");
  background-size: cover;
  border-radius: 8px;
  flex: none;
  width: 48px;
  height: 48px;
}

#omnifact-window .omnifact-header .omnifact-title {
  flex: auto;
  width: 100%;
  padding: 0 .5em;
}

#omnifact-window .omnifact-header h2 {
  margin: 0;
  font-size: 1.25em;
  font-weight: 300;
  color: var(--color-ui-secondary-text);
}

#omnifact-window .omnifact-header span.label {
  border-radius: 1em;
  padding: .2em 0 .2em 1.5em;
  font-size: .75em;
  font-weight: 600;
  display: inline-block;
  position: relative;
}

#omnifact-window .omnifact-header span.label:before {
  content: "";
  background: url("../assets/omnifact/icon_assistant.svg") 0 0 / contain;
  width: 12px;
  height: 12px;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

#omnifact-window .omnifact-header button {
  color: #aeaeae;
  background-color: #565656;
  flex: none;
  width: 28px;
  height: 28px;
}

#omnifact-window .omnifact-header button:hover {
  background-color: #292929;
}

#omnifact-window .omnifact-header button.omnifact-expand {
  background-image: url("../assets/omnifact/icon_expand.svg");
}

.expanded #omnifact-window .omnifact-header button.omnifact-expand {
  background-image: url("../assets/omnifact/icon_collapse.svg");
}

#omnifact-window .omnifact-header button.omnifact-close {
  background-color: #0000;
  background-image: url("../assets/omnifact/icon_close.svg");
}

#omnifact-window .omnifact-output {
  width: 100%;
  height: calc(100% - 10.25em);
  padding: 1em;
  overflow-y: scroll;
}

#omnifact-window .omnifact-output > div {
  color: var(--color-text);
  background: #f0f0f0;
  border-radius: 0 16px 16px;
  margin: 0 0 1em;
  padding: 1em;
}

#omnifact-window .omnifact-output > div strong {
  font-weight: 400;
}

#omnifact-window .omnifact-output > div span.subhead {
  margin-bottom: .5em;
  font-size: 1em;
  font-weight: 600;
  display: block;
}

#omnifact-window .omnifact-output > div span.bullet, #omnifact-window .omnifact-output > div strong {
  margin-top: 1em;
  font-weight: 600;
  display: block;
}

#omnifact-window .omnifact-output > div .references {
  padding: 0;
}

#omnifact-window .omnifact-output > div .references h3 {
  color: var(--color-text-contrast);
  cursor: pointer;
  margin: 1em 0;
  font-size: .85em;
  font-weight: 400;
}

#omnifact-window .omnifact-output > div .references h3:before {
  content: "";
  background-image: url("../assets/omnifact/icon_chevron.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  width: .75em;
  height: .75em;
  margin-right: .25em;
  display: inline-block;
  transform: rotate(90deg);
}

#omnifact-window .omnifact-output > div .references .list {
  color: #6e6e6e;
  font-size: .75em;
  font-weight: 600;
  display: none;
}

#omnifact-window .omnifact-output > div .references .list span {
  display: block;
}

#omnifact-window .omnifact-output > div .references .list .pages {
  font-weight: 400;
}

#omnifact-window .omnifact-output > div .references.expanded .list {
  display: block;
}

#omnifact-window .omnifact-output > div.user {
  color: #fff;
  background: #565656;
  border-top-left-radius: 16px;
  border-bottom-right-radius: 0;
  transition: all .4s;
}

#omnifact-window .omnifact-output > div.user.new {
  opacity: 0;
  transform: translateY(2em);
}

#omnifact-window .omnifact-output > div.suggestion {
  cursor: pointer;
  background: none;
  border: 1px solid #565656;
  border-radius: 8px;
  padding: .5em 1em;
}

#omnifact-window .omnifact-output > div.suggestion:hover, #omnifact-window .omnifact-output > div.suggestion.clicked {
  opacity: .5;
}

#omnifact-window .omnifact-output > div.loading {
  background: none;
  position: relative;
}

#omnifact-window .omnifact-output > div.loading:after {
  content: "";
  background: url("../assets/omnifact/3-dots-fade.svg") center / contain no-repeat;
  width: 30px;
  height: 60%;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

#omnifact-window .omnifact-input {
  border-top: 1px solid #bebebe;
  justify-content: space-between;
  align-items: center;
  height: 5em;
  padding: 0 1em;
  display: flex;
}

#omnifact-window .omnifact-input input {
  -webkit-appearance: none;
  background: #fff;
  border: none;
  outline: none;
  width: 100%;
  padding: 10px 40px 10px 10px;
  font-size: 1em;
  font-weight: 300;
}

#omnifact-window .omnifact-input button {
  background-image: url("../assets/omnifact/icon_send.svg");
  width: 28px;
  height: 28px;
}

#omnifact-window.await-response .omnifact-input button {
  background-color: var(--color-ui-secondary);
  opacity: 0.2;
  pointer-events: none;
}

body.show-omnifact #omnifact-launch button {
  opacity: 0;
}

body.show-omnifact #omnifact-launch .tooltip {
  display: none;
}

body.show-omnifact #omnifact-layer {
  opacity: 1;
}

body.show-omnifact #omnifact-window {
  transform: translateX(0);
}

@media screen and (width <= 599px) {
  #omnifact-launch {
    bottom: 40px;
  }

  #omnifact-launch button {
    width: 48px;
    height: 48px;
  }

  #omnifact-layer {
    height: 100vh;
  }

  #omnifact-window {
    box-shadow: none;
    border-radius: 0;
    max-width: none;
    inset: 0 auto 0 0;
    overflow: auto;
    width: 100vw !important;
    height: 100vh !important;
  }

  #omnifact-window .omnifact-header button.omnifact-expand {
    display: none;
  }

  #omnifact-window .omnifact-output {
    width: 100vw !important;
  }
}
