/* Nathan chat widget (t99u). Every rule is scoped under #nnc-root; no global resets.
   Stacking: launcher 60, panel 88 (above sticky headers at 50, below the quote dialog at 90 and the lightbox at 120). */
#nnc-root.nnc {
  --nnc-primary: #854fff;
  --nnc-secondary: #6b3fd4;
  --nnc-bg: #ffffff;
  --nnc-ink: #333333;
  --nnc-soft: #f1f1f1;
  --nnc-line: #e5e7eb;
  position: static;
  font-family: "Geist Sans", "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--nnc-ink);
}
#nnc-root.nnc *, #nnc-root.nnc *::before, #nnc-root.nnc *::after { box-sizing: border-box; }
#nnc-root.nnc [hidden] { display: none !important; }
#nnc-root.nnc button { font: inherit; letter-spacing: normal; text-transform: none; margin: 0; }
#nnc-root.nnc :focus-visible { outline: 3px solid #b99bff; outline-offset: 2px; }
#nnc-root.nnc .nnc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }

#nnc-root.nnc .nnc-launcher {
  position: fixed; right: 20px; bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--nnc-primary); color: #fff; font-weight: 600; font-size: 15px;
  padding: 12px 20px; min-height: 46px; box-shadow: 0 6px 18px rgba(68, 30, 160, 0.32);
}
#nnc-root.nnc .nnc-launcher:hover { background: var(--nnc-secondary); }
#nnc-root.nnc.nnc-is-open .nnc-launcher { display: none; }

#nnc-root.nnc .nnc-panel {
  position: fixed; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 88;
  width: 360px; height: min(540px, calc(100vh - 120px)); max-height: calc(100dvh - 120px);
  background: var(--nnc-bg); border-radius: 12px; box-shadow: 0 10px 34px rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; overflow: hidden; margin: 0;
}
#nnc-root.nnc .nnc-head {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  background: var(--nnc-primary); color: #fff; padding: 16px 18px; min-height: 58px; margin: 0;
}
#nnc-root.nnc .nnc-title { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 700; font-size: 17px; white-space: nowrap; color: #fff; }
#nnc-root.nnc .nnc-iconbtn {
  background: none; border: 0; color: #fff; cursor: pointer; width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 18px; line-height: 1;
}
#nnc-root.nnc .nnc-iconbtn:hover { background: rgba(255, 255, 255, 0.16); }
#nnc-root.nnc .nnc-close { margin-left: auto; }
#nnc-root.nnc .nnc-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

#nnc-root.nnc .nnc-preface { padding: 22px 18px; overflow-y: auto; gap: 10px; }
#nnc-root.nnc .nnc-ptitle { margin: 0; font-size: 19px; font-weight: 700; color: var(--nnc-ink); }
#nnc-root.nnc .nnc-psub { margin: 0 0 8px; color: #666; font-size: 14px; }
#nnc-root.nnc .nnc-option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: #f8f9fa; border: 1px solid var(--nnc-line); border-radius: 10px; padding: 14px; color: var(--nnc-ink);
}
#nnc-root.nnc .nnc-option:hover { background: #f0f0f0; border-color: var(--nnc-primary); }
#nnc-root.nnc .nnc-oicon { width: 40px; height: 40px; border-radius: 50%; background: var(--nnc-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
#nnc-root.nnc .nnc-otitle { display: block; font-weight: 700; font-size: 15px; }
#nnc-root.nnc .nnc-odesc { display: block; font-size: 13px; color: #666; }

#nnc-root.nnc .nnc-log { flex: 1; overflow-y: auto; padding: 18px 16px; overscroll-behavior: contain; }
#nnc-root.nnc .nnc-msg { display: flex; gap: 10px; margin: 0 0 10px; align-items: flex-start; }
#nnc-root.nnc .nnc-user { flex-direction: row-reverse; }
#nnc-root.nnc .nnc-avatar {
  position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--nnc-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; margin-bottom: 18px;
}
#nnc-root.nnc .nnc-name { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--nnc-ink); white-space: nowrap; }
#nnc-root.nnc .nnc-bubble { max-width: 80%; padding: 10px 13px; border-radius: 12px; background: var(--nnc-soft); color: var(--nnc-ink); overflow-wrap: anywhere; font-size: 14.5px; }
#nnc-root.nnc .nnc-user .nnc-bubble { background: var(--nnc-primary); color: #fff; }
#nnc-root.nnc .nnc-bubble p { margin: 0 0 8px; color: inherit; font-size: inherit; }
#nnc-root.nnc .nnc-bubble p:last-child { margin-bottom: 0; }
#nnc-root.nnc .nnc-bubble ul, #nnc-root.nnc .nnc-bubble ol { margin: 0 0 8px; padding-left: 20px; }
#nnc-root.nnc .nnc-bubble code { font-family: monospace; background: rgba(0, 0, 0, 0.06); padding: 0 3px; border-radius: 3px; }
#nnc-root.nnc .nnc-bubble a, #nnc-root.nnc .nnc-detail-a a { color: var(--nnc-secondary); text-decoration: underline; }
#nnc-root.nnc .nnc-linkbtn { background: none; border: 0; padding: 0; color: var(--nnc-secondary); text-decoration: underline; cursor: pointer; font-weight: 600; }
#nnc-root.nnc .nnc-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
#nnc-root.nnc .nnc-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--nnc-primary); animation: nnc-bounce 1.2s infinite ease-in-out; }
#nnc-root.nnc .nnc-dots i:nth-child(2) { animation-delay: 0.15s; }
#nnc-root.nnc .nnc-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes nnc-bounce { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { #nnc-root.nnc .nnc-dots i { animation: none; opacity: 0.7; } }

#nnc-root.nnc .nnc-bar { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--nnc-line); margin: 0; background: #fff; }
#nnc-root.nnc .nnc-input {
  flex: 1; min-width: 0; height: 42px; border: 1px solid #ccc; border-radius: 8px; padding: 0 12px;
  font: inherit; font-size: 16px; color: var(--nnc-ink); background: #fff; margin: 0; box-shadow: none;
}
#nnc-root.nnc .nnc-input:focus { border-color: var(--nnc-primary); outline: none; box-shadow: 0 0 0 3px rgba(133, 79, 255, 0.2); }
#nnc-root.nnc .nnc-send { border: 0; border-radius: 8px; background: var(--nnc-primary); color: #fff; font-weight: 600; padding: 0 16px; height: 42px; cursor: pointer; }
#nnc-root.nnc .nnc-send:hover { background: var(--nnc-secondary); }
#nnc-root.nnc .nnc-send:disabled { background: #cccccc; cursor: default; }

#nnc-root.nnc .nnc-info { background: #f8f9fa; border: 1px solid var(--nnc-line); border-radius: 10px; padding: 12px; margin: 0 0 10px; }
#nnc-root.nnc .nnc-info-head { margin: 0 0 8px; font-weight: 600; }
#nnc-root.nnc .nnc-info form { display: grid; gap: 8px; margin: 0; }
#nnc-root.nnc .nnc-info-msg { margin: 0; font-size: 13px; color: #666; }

#nnc-root.nnc .nnc-results, #nnc-root.nnc .nnc-detail { flex: 1; overflow-y: auto; padding: 14px; overscroll-behavior: contain; }
#nnc-root.nnc .nnc-faq { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--nnc-line); border-radius: 10px; padding: 12px 14px; margin: 0 0 8px; cursor: pointer; color: var(--nnc-ink); }
#nnc-root.nnc .nnc-faq:hover { border-color: var(--nnc-primary); background: #f8f9fa; }
#nnc-root.nnc .nnc-faq-q { display: block; font-weight: 700; font-size: 14.5px; }
#nnc-root.nnc .nnc-faq-p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: #666; margin-top: 2px; }
#nnc-root.nnc .nnc-loading, #nnc-root.nnc .nnc-empty { display: flex; justify-content: center; padding: 20px; color: #666; margin: 0; }
#nnc-root.nnc .nnc-detail-back { background: none; border: 0; padding: 0; margin: 0 0 10px; color: var(--nnc-secondary); font-weight: 600; cursor: pointer; }
#nnc-root.nnc .nnc-detail-q { margin: 0 0 8px; font-weight: 700; font-size: 16px; }
#nnc-root.nnc .nnc-detail-a p { margin: 0 0 8px; }

/* Hide while the page's own overlays are open (mobile menu, quote dialog, lightbox). */
body.nav-open #nnc-root.nnc, body.sheet-open #nnc-root.nnc, body.lb-open #nnc-root.nnc { display: none; }

/* Mobile: compact circular FAB at the corner; JS reserves .hero-actions space so CTAs do not sit under it. */
@media (max-width: 600px) {
  #nnc-root.nnc .nnc-launcher {
    right: 14px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 52px; height: 52px; min-height: 52px; padding: 0;
    border-radius: 50%; font-size: 0; line-height: 0;
    box-shadow: 0 6px 18px rgba(68, 30, 160, 0.36);
  }
  #nnc-root.nnc .nnc-launcher-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
  #nnc-root.nnc .nnc-launcher::before {
    content: ""; display: block; width: 22px; height: 22px; margin: 0 auto;
    background: center / contain no-repeat
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 2H4a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm-3 9H7V9h10v2zm0-3H7V6h10v2z'/%3E%3C/svg%3E");
  }
  #nnc-root.nnc .nnc-panel {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: 14px 14px 0 0;
    height: calc(100vh - 56px); height: calc(100dvh - 56px); max-height: none; padding-bottom: env(safe-area-inset-bottom);
  }
  #nnc-root.nnc .nnc-bubble { max-width: 84%; }
}
