/* NOVIQ assistant: launcher, panel, messages, result cards. */
.nq-btn,
.nq-panel,
.nq-panel * {
  box-sizing: border-box;
}
.nq-btn {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px 13px 15px;
  border: 0;
  border-radius: 999px;
  background: var(--navy, #0d1230);
  color: #fff;
  font: 700 0.92rem/1 var(--f, system-ui, sans-serif);
  box-shadow: 0 10px 30px rgba(13, 18, 48, 0.28);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.nq-btn svg {
  color: var(--lime, #cbf36a);
  flex: none;
}
.nq-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(13, 18, 48, 0.34);
}
.nq-btn:focus-visible,
.nq-panel button:focus-visible,
.nq-panel a:focus-visible,
.nq-panel input:focus-visible {
  outline: 3px solid var(--violet, #6a4cff);
  outline-offset: 2px;
}
body.dr .nq-btn,
body.ct .nq-btn,
body.nq-open .nq-btn {
  opacity: 0;
  pointer-events: none;
}

.nq-panel {
  padding: 0;
  margin: 0;
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 75;
  display: flex;
  flex-direction: column;
  width: min(392px, calc(100vw - 24px));
  height: min(620px, calc(100dvh - 40px));
  background: var(--paper, #fff);
  color: var(--ink, #0d1230);
  border: 1px solid var(--line, #e1e5f0);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(13, 18, 48, 0.3);
  overflow: hidden;
  font: 400 0.93rem/1.5 var(--f, system-ui, sans-serif);
  animation: nq-in 0.2s ease;
}
.nq-panel[hidden] {
  display: none;
}
@keyframes nq-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.nq-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: var(--navy, #0d1230);
  color: #fff;
}
.nq-av {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--lime, #cbf36a);
  color: var(--navy, #0d1230);
  font-weight: 800;
  flex: none;
}
.nq-head div:nth-child(2) {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.nq-head b {
  display: block;
  font-size: 0.98rem;
}
.nq-head small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}
.nq-x {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.nq-x:hover {
  background: rgba(255, 255, 255, 0.22);
}

.nq-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg, #f4f6fb);
  overscroll-behavior: contain;
}
.nq-m {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 94%;
}
.nq-m.nq-user {
  align-self: flex-end;
  align-items: flex-end;
}
.nq-bub {
  padding: 10px 14px;
  border-radius: 16px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.nq-bot .nq-bub {
  background: var(--paper, #fff);
  border: 1px solid var(--line, #e1e5f0);
  border-top-left-radius: 5px;
}
.nq-user .nq-bub {
  background: var(--navy, #0d1230);
  color: #fff;
  border-top-right-radius: 5px;
}
.nq-bub p {
  margin: 0;
}
.nq-bub p + p {
  margin-top: 8px;
}
.nq-bub a {
  color: var(--violet, #6a4cff);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nq-bub ul {
  margin: 8px 0 0;
  padding-left: 1.1em;
}

.nq-typing {
  display: inline-flex;
  gap: 4px;
  padding: 14px 16px;
}
.nq-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink3, #6b7290);
  animation: nq-dot 1s infinite ease-in-out;
}
.nq-typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.nq-typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes nq-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* result cards */
.nq-cards {
  display: grid;
  gap: 8px;
}
.nq-card {
  background: var(--paper, #fff);
  border: 1px solid var(--line, #e1e5f0);
  border-radius: 14px;
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.nq-card:hover {
  border-color: var(--violet, #6a4cff);
  box-shadow: 0 6px 18px rgba(106, 76, 255, 0.12);
}
.nq-main {
  display: grid;
  gap: 3px;
  padding: 11px 13px 10px;
  color: inherit;
  text-decoration: none;
}
.nq-main small {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--violet, #6a4cff);
}
.nq-main b {
  font-size: 0.95rem;
  line-height: 1.3;
}
.nq-main span {
  color: var(--ink2, #444b6b);
  font-size: 0.82rem;
  line-height: 1.4;
}
.nq-main em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink, #0d1230);
}
.nq-note .nq-main small {
  color: #4b7a00;
}
.nq-acts {
  display: flex;
  gap: 8px;
  padding: 0 13px 12px;
}
.nq-act {
  padding: 7px 12px;
  border: 1.5px solid var(--navy, #0d1230);
  border-radius: 999px;
  background: var(--navy, #0d1230);
  color: #fff;
  font: 700 0.78rem/1 var(--f, inherit);
  text-decoration: none;
  cursor: pointer;
}
.nq-act.ghost {
  background: transparent;
  color: var(--navy, #0d1230);
}
.nq-act:hover {
  background: var(--violet, #6a4cff);
  border-color: var(--violet, #6a4cff);
  color: #fff;
}
.nq-act.added {
  background: var(--lime, #cbf36a);
  border-color: var(--lime, #cbf36a);
  color: var(--navy, #0d1230);
}

/* numbered steps inside answers */
.nq-bub ol.nq-steps {
  list-style: none;
  counter-reset: nq-step;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.nq-bub ol.nq-steps li {
  position: relative;
  counter-increment: nq-step;
  margin: 0;
  padding-left: 32px;
  line-height: 1.45;
}
.nq-bub ol.nq-steps li::before {
  content: counter(nq-step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy, #0d1230);
  color: var(--lime, #cbf36a);
  font: 800 0.72rem/1 var(--f, inherit);
}
.nq-bub li + li {
  margin-top: 4px;
}
.nq-bub ol.nq-steps li + li {
  margin-top: 0;
}

/* "was this helpful?" */
.nq-fb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
  font-size: 0.75rem;
  color: var(--ink3, #6b7290);
}
.nq-fb span {
  margin-right: 2px;
}
.nq-fb button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid var(--line2, #ccd2e3);
  border-radius: 50%;
  background: var(--paper, #fff);
  color: var(--ink2, #444b6b);
  cursor: pointer;
}
.nq-fb button:hover {
  border-color: var(--violet, #6a4cff);
  color: var(--violet, #6a4cff);
}
.nq-acts {
  flex-wrap: wrap;
}
.nq-foot a {
  color: var(--violet, #6a4cff);
  font-weight: 700;
}

/* suggestion chips */
.nq-chips {
  display: flex;
  gap: 8px;
  padding: 8px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg, #f4f6fb);
}
.nq-chips::-webkit-scrollbar {
  display: none;
}
.nq-chips:empty {
  display: none;
}
.nq-chip {
  flex: none;
  padding: 7px 13px;
  border: 1.5px solid var(--line2, #ccd2e3);
  border-radius: 999px;
  background: var(--paper, #fff);
  color: var(--ink, #0d1230);
  font: 700 0.8rem/1 var(--f, inherit);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.nq-chip:hover {
  border-color: var(--violet, #6a4cff);
  color: var(--violet, #6a4cff);
}

.nq-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line, #e1e5f0);
  background: var(--paper, #fff);
}
.nq-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1.5px solid var(--line2, #ccd2e3);
  border-radius: 999px;
  background: var(--bg, #f4f6fb);
  color: var(--ink, #0d1230);
  font: 400 16px/1.2 var(--f, inherit); /* 16px stops iOS zoom on focus */
}
.nq-form button {
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--lime, #cbf36a);
  color: var(--navy, #0d1230);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}
.nq-form button:hover {
  background: var(--lime2, #9fd13c);
}
.nq-foot {
  margin: 0;
  padding: 0 14px 10px;
  background: var(--paper, #fff);
  color: var(--ink3, #6b7290);
  font-size: 0.72rem;
  text-align: center;
}
.nq-foot button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--violet, #6a4cff);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 760px) {
  body.has-buybar .nq-btn {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 560px) {
  .nq-btn span {
    display: none;
  }
  .nq-btn {
    padding: 14px;
  }
  .nq-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: min(88dvh, 680px);
    border-radius: 22px 22px 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nq-panel,
  .nq-typing i {
    animation: none;
  }
  .nq-btn {
    transition: none;
  }
}
