/* The chat on the landing page, in whatever design is showing it.

   Colours come from two variables so a design only has to say what it is:
   --nx-chat-face (the panel) and --nx-chat-mine (the visitor's bubbles and
   the send button). The defaults suit a light page; the dark designs set
   their own below. */
.nx-chat {
  --nx-chat-face: #ffffff;
  --nx-chat-edge: rgba(0, 0, 0, .12);
  --nx-chat-them: #f1f1ef;
  --nx-chat-mine: var(--accent, #1c1c1a);
  --nx-chat-on-mine: #ffffff;
  --nx-chat-ink: inherit;
  --nx-chat-dim: #8b8b85;
  max-width: 40rem; margin: 1.6rem auto 0; text-align: start;
  border: 1px solid var(--nx-chat-edge); border-radius: 20px;
  background: var(--nx-chat-face); color: var(--nx-chat-ink);
  box-shadow: 0 24px 60px -40px rgba(0, 0, 0, .5); overflow: hidden;
}
.nx-log { display: grid; gap: .55rem; padding: 1rem; max-height: min(40vh, 18rem); overflow-y: auto; scroll-behavior: smooth; }
.nx-msg { display: flex; align-items: flex-end; gap: .5rem; }
.nx-msg-me { justify-content: flex-end; }
.nx-avatar { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(140deg, #FF7A3D, #C0322E 46%, #3B2BC9); }
.nx-bubble { margin: 0; max-width: 78%; padding: .6rem .95rem; font-size: .95rem; line-height: 1.5; border-radius: 16px; animation: nx-bubble-in .28s ease both; }
.nx-msg-them .nx-bubble { background: var(--nx-chat-them); border-start-start-radius: 4px; }
.nx-msg-me .nx-bubble { background: var(--nx-chat-mine); color: var(--nx-chat-on-mine); border-end-end-radius: 4px; }
@keyframes nx-bubble-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.nx-msg.is-typing .nx-bubble { display: flex; gap: 4px; padding: .8rem .95rem; }
.nx-msg.is-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--nx-chat-dim); animation: nx-dot 1s infinite; }
.nx-msg.is-typing i:nth-child(2) { animation-delay: .15s; }
.nx-msg.is-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes nx-dot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.nx-compose { display: flex; align-items: center; gap: .5rem; padding: .6rem; border-top: 1px solid var(--nx-chat-edge); }
.nx-compose input { flex: 1 1 auto; min-width: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 1rem; padding: .6rem .5rem; }
.nx-compose input::placeholder { color: var(--nx-chat-dim); }
.nx-compose input:focus { outline: none; }
.nx-compose input:disabled { opacity: .6; }
.nx-send { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer; background: var(--nx-chat-mine); color: var(--nx-chat-on-mine); }
.nx-send:hover { filter: brightness(1.1); }
.nx-send:disabled { opacity: .5; cursor: default; }
[dir="rtl"] .nx-send svg { transform: scaleX(-1); }

/* A class selector beats the browser's own [hidden] { display: none }, so
   every element here that the script shows and hides by that attribute has
   to say so itself. .nx-attach did not, which is why "Add photos" sat next
   to the first question instead of waiting for the photo step. */
.nx-picker[hidden], .nx-attach[hidden], .nx-send[hidden], .nx-send-word[hidden],
.nx-chip[hidden] { display: none; }

/* The ten, before a word is typed: point at the nearest business and the
   questions follow. The full catalogue is the last chip. */
.nx-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem;
  padding: .6rem; border-top: 1px solid var(--nx-chat-edge);
  max-height: min(44vh, 20rem); overflow-y: auto;
}
.nx-chip {
  display: grid; gap: .45rem; text-align: start; min-width: 0; padding: .5rem;
  border: 1px solid var(--nx-chat-edge); border-radius: 12px;
  background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: none;
}
.nx-chip:hover, .nx-chip:focus-visible { border-color: var(--tpl-accent, currentColor); }
/* The drawing itself is template-mock.css, shared with the catalogue, so
   a template is shown the same way wherever it is offered. Its paper stays
   white on a dark chat on purpose: it is a picture of a page. */
.nx-chip .tpl { pointer-events: none; }
.nx-chip:hover .tpl { transform: translateY(-1px); }
.nx-chip-text { display: grid; min-width: 0; padding: 0 .15rem .1rem; }
.nx-chip-text strong { font-size: .85rem; font-weight: 600; }
.nx-chip-text small { font-size: .68rem; opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-chip-all { place-content: center; text-align: center; border-style: dashed; font-size: .82rem; min-height: 5.5rem; }

/* The photo step: an attach button where the text box was, and a send
   button that says what it will do — Skip until something is chosen. */
.nx-attach {
  flex: 1 1 auto; display: inline-flex; align-items: center; gap: .5rem; justify-content: flex-start;
  padding: .6rem .7rem; border: 1px dashed var(--nx-chat-edge); border-radius: 12px;
  background: none; color: inherit; font: inherit; font-size: .95rem; cursor: pointer;
}
.nx-attach:hover { border-style: solid; }
.nx-send.is-wide { width: auto; border-radius: 999px; padding: 0 1rem; gap: .4rem; grid-auto-flow: column; }
.nx-send-word { font: inherit; font-size: .9rem; font-weight: 600; }

.nx-plain { display: flex; gap: .5rem; max-width: 40rem; margin: 1.6rem auto 0; }
.nx-plain input { flex: 1; padding: .8rem 1rem; border-radius: 999px; border: 1px solid var(--nx-chat-edge, rgba(0,0,0,.12)); }

/* The dark designs. The city one is ink with an orange signal; Studio dark
   keeps its own panel colour. */
.lc .nx-chat { --nx-chat-face: #0C1218; --nx-chat-edge: #2B3B4A; --nx-chat-them: #16202B;
                --nx-chat-mine: #FF6A2B; --nx-chat-on-mine: #06080B; --nx-chat-ink: #EEF3F7; --nx-chat-dim: #6E7D8A; }
.l2 .nx-chat { --nx-chat-face: #12131a; --nx-chat-edge: rgba(255,255,255,.14); --nx-chat-them: #1d1f29;
                --nx-chat-mine: #6c5cff; --nx-chat-on-mine: #ffffff; --nx-chat-ink: #eceaf6; --nx-chat-dim: #9a97b5; }

@media (prefers-reduced-motion: reduce) {
  .nx-bubble { animation: none; }
  .nx-msg.is-typing i { animation: none; }
  .nx-log { scroll-behavior: auto; }
}
