::selection {
  background: #2F6E5B;
  color: #F5F1E4;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #DCD3B9 transparent;
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #DCD3B9;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #c7bb95;
}

.fold-corner {
  position: relative;
  overflow: hidden;
}

.fold-corner::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 20px 20px 0;
  border-color: transparent var(--fold, #DCD3B9) transparent transparent;
  transition: border-width .2s ease;
}

.fold-corner:hover::after {
  border-width: 0 26px 26px 0;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.msg-in {
  animation: msgIn .32s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes shakeError {

  10%,
  90% {
    transform: translateX(-1px);
  }

  20%,
  80% {
    transform: translateX(2px);
  }

  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }

  40%,
  60% {
    transform: translateX(4px);
  }
}

.animate-shake {
  animation: shakeError .5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: .45;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.dot-bounce {
  animation: dotBounce 1.1s infinite ease-in-out;
  display: inline-block;
}

@keyframes drawThread {
  to {
    stroke-dashoffset: 0;
  }
}

.thread-draw {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: drawThread 4s ease-out .15s forwards;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.13 0 0 0 0 0.19 0 0 0 0 0.16 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

#chatbot-sidebar {
  transition: transform .32s cubic-bezier(.2, .7, .3, 1);
}

@media (min-width: 768px) {
  #chatbot-sidebar {
    position: static !important;
    inset: auto !important;
    transform: none !important;
  }
}

#chatbot-backdrop {
  transition: opacity .28s ease;
}

@keyframes rootSway {

  0%,
  100% {
    transform: rotate(-1.6deg);
  }

  50% {
    transform: rotate(1.6deg);
  }
}

@keyframes rootDrift {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(10px);
  }
}

@keyframes rootDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.root-path {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation:
    rootDraw var(--draw-dur, 2.6s) ease-out var(--draw-delay, .1s) forwards,
    rootSway var(--sway-dur, 10s) ease-in-out infinite var(--sway-delay, 2s),
    rootDrift var(--drift-dur, 14s) ease-in-out infinite var(--sway-delay, 2s);
}

.root-path--static {
  animation: none;
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: reduce) {

  .msg-in,
  .animate-shake,
  .dot-bounce,
  .thread-draw,
  .root-path,
  #chatbot-sidebar,
  #chatbot-backdrop {
    animation: none !important;
    transition: none !important;
  }

  .root-path {
    stroke-dashoffset: 0 !important;
  }
}
