.nzdj-chat {
  --nzdj-bg: #090a0c;
  --nzdj-panel: #111419;
  --nzdj-panel-2: #171b21;
  --nzdj-line: rgba(255, 255, 255, 0.10);
  --nzdj-text: #f4f5f6;
  --nzdj-muted: #9da4ad;
  --nzdj-accent: #ff4d16;
  --nzdj-accent-2: #ff7a18;
  --nzdj-online: #91ff6a;
  position: relative;
  isolation: isolate;
  width: min(1120px, calc(100% - 32px));
  min-height: 720px;
  margin: 48px auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 77, 22, 0.13), transparent 34%),
    linear-gradient(145deg, #0d0f12, var(--nzdj-bg) 58%);
  color: var(--nzdj-text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35), inset 0 1px rgba(255, 255, 255, 0.05);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.nzdj-chat *,
.nzdj-chat *::before,
.nzdj-chat *::after {
  box-sizing: border-box;
}

.nzdj-chat__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 48%);
}

.nzdj-chat__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 42px 48px 28px;
  border-bottom: 1px solid var(--nzdj-line);
}

.nzdj-chat__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
  color: #c3c8ce;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.nzdj-chat__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nzdj-online);
  box-shadow: 0 0 0 4px rgba(145, 255, 106, 0.10), 0 0 18px rgba(145, 255, 106, 0.55);
}

.nzdj-chat h1 {
  margin: 0;
  color: #fff;
  font-family: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  font-size: clamp(42px, 7vw, 82px);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-transform: uppercase;
}

.nzdj-chat__lede {
  max-width: 670px;
  margin: 14px 0 0;
  color: var(--nzdj-muted);
  font-size: clamp(15px, 2vw, 18px);
}

.nzdj-chat__badge {
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 77, 22, 0.55);
  color: #ff8a63;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  transform: skewX(-7deg);
}

.nzdj-chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 48px 0;
}

.nzdj-chat__suggestions button {
  appearance: none;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--nzdj-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #d7dbe0;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nzdj-chat__suggestions button:hover {
  border-color: rgba(255, 77, 22, 0.6);
  background: rgba(255, 77, 22, 0.08);
  color: #fff;
  transform: translateY(-1px);
}

.nzdj-chat__log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 330px;
  max-height: 500px;
  margin: 22px 48px;
  padding: 4px 8px 4px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #353a42 transparent;
  scrollbar-width: thin;
}

.nzdj-message {
  width: min(82%, 740px);
  animation: nzdj-rise 220ms ease-out both;
}

.nzdj-message--user {
  align-self: flex-end;
}

.nzdj-message__label {
  margin: 0 0 5px 4px;
  color: var(--nzdj-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nzdj-message--user .nzdj-message__label {
  margin-right: 4px;
  text-align: right;
}

.nzdj-message__body {
  padding: 15px 18px;
  border: 1px solid var(--nzdj-line);
  border-radius: 4px 17px 17px 17px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.035));
  color: #ecedef;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nzdj-message--user .nzdj-message__body {
  border-color: rgba(255, 77, 22, 0.35);
  border-radius: 17px 4px 17px 17px;
  background: linear-gradient(145deg, rgba(255, 77, 22, 0.23), rgba(255, 77, 22, 0.12));
  color: #fff;
}

.nzdj-message--error .nzdj-message__body {
  border-color: rgba(255, 122, 24, 0.5);
  background: rgba(255, 122, 24, 0.08);
  color: #ffd0bc;
}

.nzdj-message--typing .nzdj-message__body {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 72px;
}

.nzdj-message--typing .nzdj-message__body span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nzdj-accent);
  animation: nzdj-pulse 1s ease-in-out infinite;
}

.nzdj-message--typing .nzdj-message__body span:nth-child(2) { animation-delay: 120ms; }
.nzdj-message--typing .nzdj-message__body span:nth-child(3) { animation-delay: 240ms; }

.nzdj-chat__composer {
  margin: 0 48px 24px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: rgba(17, 20, 25, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
}

.nzdj-chat__composer > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nzdj-chat__input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.nzdj-chat textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  margin: 0;
  padding: 12px 10px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
}

.nzdj-chat textarea::placeholder {
  color: #777f89;
}

.nzdj-chat__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 112px;
  min-height: 52px;
  padding: 0 19px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--nzdj-accent), var(--nzdj-accent-2));
  color: #fff;
  box-shadow: 0 10px 28px rgba(255, 77, 22, 0.22);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.nzdj-chat__send:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.nzdj-chat__send:disabled {
  cursor: wait;
  opacity: 0.72;
}

.nzdj-chat__send.is-loading span:last-child {
  animation: nzdj-spin 1s linear infinite;
}

.nzdj-chat__meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 8px 0;
  color: #737b85;
  font-size: 11px;
}

.nzdj-chat__notice {
  margin: 0;
  padding: 0 48px 28px;
  color: #6f7680;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.nzdj-chat button:focus-visible,
.nzdj-chat textarea:focus-visible {
  outline: 3px solid rgba(255, 122, 24, 0.55);
  outline-offset: 3px;
}

@keyframes nzdj-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes nzdj-pulse {
  0%, 70%, 100% { opacity: 0.28; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

@keyframes nzdj-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
  .nzdj-chat {
    width: min(100%, calc(100% - 16px));
    min-height: 650px;
    margin: 20px auto;
    border-radius: 18px;
  }

  .nzdj-chat__header {
    padding: 30px 22px 22px;
  }

  .nzdj-chat__badge {
    display: none;
  }

  .nzdj-chat__suggestions {
    flex-wrap: nowrap;
    padding: 16px 22px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nzdj-chat__suggestions::-webkit-scrollbar { display: none; }
  .nzdj-chat__suggestions button { flex: 0 0 auto; }

  .nzdj-chat__log {
    min-height: 300px;
    margin: 18px 22px;
    padding-right: 2px;
  }

  .nzdj-message { width: 92%; }

  .nzdj-chat__composer {
    margin: 0 14px 18px;
    padding: 12px;
  }

  .nzdj-chat__input-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .nzdj-chat__send {
    width: 100%;
  }

  .nzdj-chat__meta span:first-child { display: none; }
  .nzdj-chat__meta { justify-content: flex-end; }
  .nzdj-chat__notice { padding: 0 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .nzdj-chat *,
  .nzdj-chat *::before,
  .nzdj-chat *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
