.nori-guide[hidden] {
  display: none;
}

.nori-guide {
  position: fixed;
  z-index: 900;
  right: clamp(12px, 2vw, 28px);
  bottom: clamp(14px, 2vw, 26px);
  width: min(390px, calc(100vw - 24px));
  height: min(610px, calc(100svh - 28px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid #7084ff45;
  border-radius: 24px;
  color: #f5f2eb;
  background:
    radial-gradient(circle at 100% 0, #315cff2b, transparent 34%),
    linear-gradient(150deg, #111522f7, #070910fa 74%);
  box-shadow: 0 30px 100px #000d, 0 0 70px #1e55ff17;
  transform-origin: bottom right;
  animation: noriGuideIn .32s cubic-bezier(.2, .8, .2, 1);
}

.nori-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 17px 14px;
  border-bottom: 1px solid #ffffff12;
}

.nori-guide-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.nori-guide-avatar {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #6581ff55;
  border-radius: 50%;
  background: #0b1020;
}

.nori-guide-avatar img {
  width: 54px;
  max-width: none;
  transform: translateY(5px);
}

.nori-guide-title {
  display: grid;
  gap: 2px;
}

.nori-guide-title strong {
  font-size: .91rem;
}

.nori-guide-title span {
  color: #8f94a4;
  font-size: .68rem;
}

.nori-guide-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nori-guide-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ee39b;
  box-shadow: 0 0 12px #4ee39b;
}

.nori-guide-actions {
  display: flex;
  gap: 5px;
}

.nori-guide-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff17;
  border-radius: 50%;
  color: #c9ccd8;
  background: #ffffff08;
  cursor: pointer;
  font-size: 1rem;
}

.nori-guide-messages {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: #536ee766 transparent;
}

.nori-message {
  max-width: 88%;
  width: fit-content;
  margin-bottom: 10px;
  padding: 11px 13px;
  border: 1px solid #ffffff12;
  border-radius: 7px 17px 17px 17px;
  color: #d7d9e1;
  background: #ffffff08;
  font-size: .81rem;
  line-height: 1.55;
  animation: noriMessageIn .25s ease both;
}

.nori-message strong {
  color: #fff;
}

.nori-message a {
  color: #9cb1ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nori-message.is-user {
  margin-left: auto;
  border-color: #607cff4d;
  border-radius: 17px 7px 17px 17px;
  color: #fff;
  background: linear-gradient(135deg, #1b65f0, #6c43ef);
}

.nori-typing {
  width: 58px;
  display: flex;
  gap: 4px;
}

.nori-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9da8d4;
  animation: noriTyping 1s ease-in-out infinite;
}

.nori-typing i:nth-child(2) { animation-delay: .13s; }
.nori-typing i:nth-child(3) { animation-delay: .26s; }

.nori-guide-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 16px;
  border-top: 1px solid transparent;
}

.nori-option {
  min-height: 36px;
  border: 1px solid #7890ff55;
  border-radius: 999px;
  padding: 8px 12px;
  color: #dfe5ff;
  background: #17203fd1;
  cursor: pointer;
  font: inherit;
  font-size: .72rem;
  line-height: 1.2;
  transition: transform .18s, border-color .18s, background .18s;
}

.nori-option:hover,
.nori-option:focus-visible {
  border-color: #8ea2ff;
  background: #22305df0;
  transform: translateY(-1px);
}

.nori-option.is-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #176cf2, #7441ef);
}

.nori-option.is-link {
  text-decoration: none;
}

.nori-guide-footer {
  display: flex;
  justify-content: center;
  padding: 9px 14px 12px;
  border-top: 1px solid #ffffff0d;
  color: #646a7b;
  font-size: .58rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.nori-guide-open .nori-chat {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(.92);
}

.nori-chat {
  transition: opacity .25s ease, transform .3s ease;
}

@keyframes noriGuideIn {
  from { opacity: 0; transform: translateY(16px) scale(.94); }
  to { opacity: 1; transform: none; }
}

@keyframes noriMessageIn {
  from { opacity: 0; transform: translateY(6px); }
}

@keyframes noriTyping {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 640px) {
  .nori-guide {
    inset: 8px;
    width: auto;
    height: auto;
    max-height: calc(100svh - 16px);
    border-radius: 20px;
  }

  .nori-guide-header {
    padding: 13px 14px;
  }

  .nori-guide-messages {
    padding: 15px 13px 10px;
  }

  .nori-guide-options {
    padding: 0 13px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nori-guide,
  .nori-message,
  .nori-typing i {
    animation: none;
  }
}
