/* NOVE support chat (NF-520). Uses the site's own tokens (nove.css :root and the
   client area's dark theme), so it follows the brand and dark mode by itself. */
.nsc { position: fixed; right: 20px; bottom: 20px; z-index: 900; font-family: var(--font); }
.nsc.is-page .nsc-bubble { display: none; }
.nsc-bubble {
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; display: grid; place-items: center; position: relative;
  box-shadow: 0 10px 24px -6px rgba(236, 28, 36, .55), 0 2px 6px rgba(25, 25, 25, .15);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.nsc-bubble:hover { transform: translateY(-2px) scale(1.03); }
.nsc-bubble:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.nsc.is-open .nsc-bubble { transform: scale(.92); }
.nsc-badge {
  position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--yellow); color: var(--ink); font: 700 12px/22px var(--font);
  box-shadow: 0 0 0 2px var(--surface);
}
.nsc-panel {
  position: absolute; right: 0; bottom: 74px; width: 380px; height: min(640px, calc(100vh - 120px));
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  animation: nsc-in .28s var(--ease);
}
.nsc-panel[hidden] { display: none; }
@keyframes nsc-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.nsc-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px;
  background: var(--ink); color: #fff;
}
.nsc-head-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nsc-head-text strong { font: 600 16px/1.2 var(--font-head); }
.nsc-status { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .85; line-height: 1.35; }
.nsc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-dim); flex: none; }
.nsc-dot.is-online { background: var(--teal); box-shadow: 0 0 0 3px rgba(0, 240, 181, .25); }
.nsc-dot.is-closed { background: var(--orange); }
.nsc-icon {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1);
  color: #fff; display: grid; place-items: center; cursor: pointer; flex: none;
}
.nsc-icon:hover { background: rgba(255, 255, 255, .2); }
.nsc-icon[hidden] { display: none; }
.nsc-body { flex: 1; overflow-y: auto; padding: 16px 16px 8px; overscroll-behavior: contain; }
.nsc-foot { border-top: 1px solid var(--border); padding: 10px 12px; background: var(--surface); }
.nsc-foot[hidden] { display: none; }
.nsc-safe { margin: 0; padding: 6px 14px 10px; font-size: 11px; color: var(--muted); text-align: center; }

.nsc-hello h3, .nsc-guest h3 { margin: 0 0 4px; font: 600 20px/1.25 var(--font-head); }
.nsc-hello p, .nsc-guest p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.nsc-guest { display: grid; gap: 10px; }
.nsc-guest p { margin-bottom: 4px; }
.nsc-or { margin-top: 6px; font-size: 13px; color: var(--muted); }
.nsc h4 { margin: 16px 0 8px; font: 600 13px/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.nsc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nsc-link { color: var(--brand); font-size: 13px; font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.nsc-link:hover { text-decoration: underline; }
.nsc-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nsc-topic {
  text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 500 13px/1.35 var(--font); cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nsc-topic:hover, .nsc-topic:focus-visible { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.nsc-list { display: grid; gap: 8px; }
.nsc-conv {
  text-align: left; display: grid; gap: 4px; padding: 11px 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
.nsc-conv:hover { border-color: var(--border-bright); background: var(--surface-2); }
.nsc-conv.is-unread { border-color: var(--brand); }
.nsc-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.nsc-conv-top strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nsc-conv-sub { font-size: 12px; color: var(--muted); }
.nsc-pill { flex: none; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.nsc-conv.is-unread .nsc-pill { background: var(--brand); color: #fff; }
.nsc-pill.is-answered { background: var(--success-bg); color: var(--success); }
.nsc-pill.is-resolved, .nsc-pill.is-closed { background: var(--surface-3); color: var(--muted); }

.nsc-facts { display: grid; gap: 6px; }
.nsc-facts h4:first-child { margin-top: 0; }
.nsc-fact {
  display: block; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text);
  font-size: 13px; line-height: 1.45; text-decoration: none; border-left: 3px solid var(--border-bright);
}
a.nsc-fact:hover { background: var(--surface-3); }
.nsc-fact.is-good { border-left-color: var(--success); }
.nsc-fact.is-bad { border-left-color: var(--danger); }
.nsc-article { display: block; padding: 8px 0; font-size: 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.nsc-article::after { content: " →"; color: var(--brand); }
.nsc-still { color: var(--text) !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 15px !important; }
.nsc-skel { height: 68px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: nsc-sk 1.2s infinite linear; }
@keyframes nsc-sk { to { background-position: -200% 0; } }

.nsc-thread-head { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.nsc-thread-head strong { font: 600 15px/1.3 var(--font-head); overflow-wrap: anywhere; }
.nsc-thread-head span { font-size: 12px; color: var(--muted); }
.nsc-thread-head .nsc-link { justify-self: start; margin-top: 2px; }
.nsc-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; list-style: none; margin: 12px 0 6px; padding: 0; }
.nsc-track li { display: grid; gap: 5px; font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.nsc-track i { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); }
.nsc-track li.is-done { color: var(--text); font-weight: 600; }
.nsc-track li.is-done i { background: var(--success); }
.nsc-msgs { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; }
.nsc-msg { display: flex; flex-direction: column; max-width: 86%; gap: 3px; }
.nsc-msg.is-me { align-self: flex-end; align-items: flex-end; }
.nsc-msg.is-them { align-self: flex-start; }
.nsc-who { font-size: 11.5px; font-weight: 600; color: var(--muted); padding-left: 4px; }
.nsc-text {
  padding: 10px 13px; border-radius: 18px; font-size: 14px; line-height: 1.5; white-space: pre-wrap;
  overflow-wrap: anywhere; display: grid; gap: 8px;
}
.nsc-msg.is-me .nsc-text { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.nsc-msg.is-them .nsc-text { background: var(--surface-2); color: var(--text); border-bottom-left-radius: 6px; border: 1px solid var(--border); }
.nsc-msg time, .nsc-seen { font-size: 11px; color: var(--muted); padding: 0 4px; }
.nsc-seen { color: var(--success); font-weight: 600; }
.nsc-file { color: inherit; font-size: 13px; text-decoration: underline; }
.nsc-file.is-image img { display: block; max-width: 100%; max-height: 220px; border-radius: 12px; object-fit: cover; }
.nsc-system { align-self: center; text-align: center; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 6px 12px; border-radius: 999px; max-width: 92%; line-height: 1.4; }
.nsc-typing { align-self: flex-start; font-size: 12px; color: var(--muted); font-style: italic; padding-left: 4px; }
.nsc-typing::after { content: ""; display: inline-block; width: 18px; animation: nsc-dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes nsc-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.nsc-rate { margin: 6px 0 4px; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); display: grid; gap: 10px; }
.nsc-rate p { margin: 0; font-size: 14px; }
.nsc-stars { display: flex; gap: 6px; }
.nsc-star { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 20px; color: var(--muted-dim); cursor: pointer; }
.nsc-star.is-on { color: #f5a400; border-color: #f5c64a; background: #fff9e6; }
.nsc-closed { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.nsc-error { margin: 0 0 8px; font-size: 13px; color: var(--danger); background: var(--danger-bg); padding: 8px 10px; border-radius: 10px; }

.nsc-compose { display: grid; gap: 8px; }
.nsc-acct { font-size: 14px; padding: 8px 10px; border-radius: 12px; }
.nsc-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.nsc-input {
  flex: 1; min-width: 0; resize: none; border: 1px solid var(--border-bright); border-radius: 20px;
  padding: 10px 14px; font: 15px/1.4 var(--font); background: var(--surface); color: var(--text); max-height: 140px;
}
.nsc-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.nsc-attach, .nsc-send {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; cursor: pointer; border: 0;
}
.nsc-attach { background: var(--surface-2); color: var(--muted); position: relative; overflow: hidden; }
.nsc-attach:hover { color: var(--text); }
.nsc-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.nsc-send { background: var(--yellow); color: var(--ink); }
.nsc-send:hover { background: var(--yellow-deep); }
.nsc-send:disabled { opacity: .5; cursor: progress; }
.nsc-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.nsc-chip[hidden] { display: none; }
.nsc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The client area has a bottom tab bar on phones: sit above it. */
@media (max-width: 1080px) { body.client .nsc { bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media (max-width: 640px) {
  .nsc { right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .nsc-bubble { width: 54px; height: 54px; }
  .nsc-panel {
    position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .nsc-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .nsc.is-open .nsc-bubble { display: none; }
  body.nsc-lock { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .nsc-panel, .nsc-bubble, .nsc-skel { animation: none; transition: none; } }
@media print { .nsc { display: none; } }

/* The full-page conversation (dashboard/support_detail.html). */
.nsc-page { display: grid; grid-template-rows: auto 1fr auto; max-width: 820px; min-height: min(72vh, 760px); padding: 0; overflow: hidden; }
.nsc-page .nsc-page-body { padding: 18px 20px; overflow-y: auto; max-height: 68vh; }
.nsc-page .nsc-page-foot { border-top: 1px solid var(--border); padding: 12px 16px; }
.nsc-page .nsc-msg { max-width: 78%; }
@media (max-width: 640px) {
  .nsc-page { min-height: calc(100dvh - 190px); border-radius: 18px; }
  .nsc-page .nsc-page-body { padding: 14px; max-height: none; }
  .nsc-page .nsc-msg { max-width: 90%; }
}
.nsc-notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--warning-bg); color: var(--text); font-size: 13px; line-height: 1.45; }
.nsc-topic.is-suggested { border-color: var(--brand); background: var(--brand-soft); }
.nsc-safe a { color: inherit; font-weight: 600; }
/* The guest question form (NF-617). The honeypot sits off screen, out of tab order. */
.nsc-guest-form { display: grid; gap: 6px; }
.nsc-guest-form[hidden] { display: none; }
.nsc-guest-form label { font-size: 13px; font-weight: 600; }
.nsc-guest-form .nsc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.nsc-guest-note { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--muted); }
.nsc-guest-sent { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); font-size: 14px; line-height: 1.45; }
.nsc-guest-sent[hidden] { display: none; }
