/* =============================================================
   NUSEI Dashboard — AI assistant panel
   Self-contained. Does not touch existing dashboard styles.
   Palette follows the NUSEI brand guideline:
     navy #071B38 · Nusantara orange #F0651E · Georgia / Arial
   ============================================================= */

.nz-launch {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px 13px 17px;
  border: 0;
  border-radius: 999px;
  background: #071b38;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(7, 27, 56, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.nz-launch:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(7, 27, 56, 0.34); }
.nz-launch svg { flex: none; }
.nz-launch[hidden] { display: none; }

/* ---- panel ---- */
.nz-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 950;
  display: flex;
  flex-direction: column;
  width: min(480px, 100vw);
  height: 100dvh;
  background: #fbfaf8;
  border-left: 1px solid #e3ded6;
  box-shadow: -18px 0 48px rgba(7, 27, 56, 0.14);
  font-family: Arial, Helvetica, sans-serif;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}
.nz-panel.is-open { transform: translateX(0); }

.nz-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 14px;
  background: #071b38;
  color: #fff;
}
.nz-head-text { flex: 1; min-width: 0; }
.nz-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.nz-head p {
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #a8b6c9;
}
.nz-new {
  flex: none; height: 30px; padding: 0 10px;
  border: 0; border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff; font-family: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer;
}
.nz-new:hover { background: rgba(255, 255, 255, 0.2); }

.nz-close {
  flex: none;
  width: 30px; height: 30px;
  border: 0; border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff; font-size: 15px; line-height: 1; cursor: pointer;
}
.nz-close:hover { background: rgba(255, 255, 255, 0.2); }

/* ---- scroll area ---- */
.nz-body { flex: 1; overflow-y: auto; padding: 18px; scroll-behavior: smooth; }

.nz-intro {
  padding: 16px 16px 4px;
  border: 1px solid #e8e2d9;
  border-radius: 10px;
  background: #fff;
}
.nz-intro h3 {
  margin: 0 0 8px;
  font-family: Georgia, serif;
  font-size: 15px; font-weight: 400; color: #071b38;
}
.nz-intro p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.6; color: #55524c; }
.nz-intro .nz-scope {
  padding: 9px 11px; margin-bottom: 12px;
  border-left: 2px solid #f0651e;
  background: #fdf6f2;
  font-size: 11.5px; line-height: 1.55; color: #5a4436;
}
.nz-intro .nz-disclaimer {
  padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid #e0dacf; border-radius: 7px;
  background: #f7f5f1;
  font-size: 11px; line-height: 1.55; color: #6b665e;
}

.nz-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; }
.nz-suggest button {
  padding: 7px 11px;
  border: 1px solid #ded7cc; border-radius: 999px;
  background: #fff; color: #071b38;
  font-family: inherit; font-size: 11.5px; text-align: left; cursor: pointer;
}
.nz-suggest button:hover { border-color: #f0651e; background: #fff8f4; }

/* ---- messages ---- */
.nz-msg { margin-bottom: 18px; }
.nz-msg.user {
  margin-left: auto;
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 12px 12px 3px 12px;
  background: #071b38;
  color: #fff;
  font-size: 13.5px; line-height: 1.5;
}
.nz-msg.bot { max-width: 100%; }
.nz-msg.bot .nz-answer {
  font-size: 13.5px; line-height: 1.68; color: #23201c;
  white-space: pre-wrap; word-wrap: break-word;
}
.nz-msg.bot .nz-answer strong { color: #071b38; }

.nz-refused .nz-answer {
  padding: 13px 14px;
  border-left: 2px solid #c8bfb2;
  background: #f4f1ec;
  color: #4a463f;
  font-size: 13px;
}

/* an assertion with no surviving citation */
.nz-unsourced {
  background: #fdf3e3;
  border-bottom: 2px dotted #c98a1e;
  padding: 1px 0;
  cursor: help;
}
.nz-warn {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 11px; padding: 9px 11px;
  border: 1px solid #ecd9ae; border-radius: 7px;
  background: #fdf8ee;
  font-size: 11.5px; line-height: 1.5; color: #8a6420;
}
.nz-warn::before { content: "!"; font-weight: 700; flex: none; }

/* citation chips */
.nz-cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px; margin: 0 1px;
  border: 0; border-radius: 4px;
  background: #f0651e; color: #fff;
  font-family: inherit; font-size: 10px; font-weight: 700;
  vertical-align: super; cursor: pointer;
}
.nz-cite:hover { background: #071b38; }

.nz-sources { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e6e0d7; }
.nz-sources h4 {
  margin: 0 0 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; color: #8c867c;
}
.nz-src {
  padding: 9px 11px; margin-bottom: 6px;
  border: 1px solid #e8e2d9; border-radius: 7px; background: #fff;
}
.nz-src-title { font-size: 12px; font-weight: 700; color: #071b38; line-height: 1.35; }
.nz-src-meta { margin-top: 2px; font-size: 10.5px; color: #8c867c; }
.nz-src-quote {
  margin-top: 7px; padding-left: 9px;
  border-left: 2px solid #f0651e;
  font-family: Georgia, serif; font-size: 11.5px; font-style: italic;
  line-height: 1.5; color: #55524c;
}

/* ---- states ---- */
.nz-status { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: #8c867c; }
.nz-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #f0651e;
  animation: nz-pulse 1.1s ease-in-out infinite;
}
@keyframes nz-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.nz-error {
  padding: 11px 13px; border-radius: 7px;
  background: #fdf0ec; border: 1px solid #f3d3c6;
  font-size: 12.5px; color: #9c3d18;
}

/* ---- composer ---- */
.nz-foot { flex: none; padding: 12px 14px 14px; background: #fff; border-top: 1px solid #e6e0d7; }
.nz-form { display: flex; gap: 8px; align-items: flex-end; }
.nz-form textarea {
  flex: 1; max-height: 130px; padding: 10px 12px;
  border: 1px solid #ded7cc; border-radius: 9px;
  background: #fbfaf8; color: #23201c;
  font-family: inherit; font-size: 13.5px; line-height: 1.5;
  resize: none; outline: none;
}
.nz-form textarea:focus { border-color: #f0651e; background: #fff; }
.nz-send {
  flex: none; width: 38px; height: 38px;
  border: 0; border-radius: 9px;
  background: #f0651e; color: #fff; font-size: 15px; cursor: pointer;
}
.nz-send:disabled { background: #d8d2c8; cursor: default; }
.nz-note { margin: 9px 2px 0; font-size: 10.5px; line-height: 1.5; color: #8c867c; }

/* ---- passphrase gate ---- */
.nz-gate { padding: 22px 20px; }
.nz-gate h3 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 16px; font-weight: 400; color: #071b38; }
.nz-gate p { margin: 0 0 15px; font-size: 12.5px; line-height: 1.6; color: #55524c; }
.nz-gate input {
  width: 100%; padding: 10px 12px; margin-bottom: 10px;
  border: 1px solid #ded7cc; border-radius: 9px;
  background: #fff; font-family: inherit; font-size: 13.5px; outline: none;
}
.nz-gate input:focus { border-color: #f0651e; }
.nz-gate button {
  width: 100%; padding: 11px;
  border: 0; border-radius: 9px; background: #071b38; color: #fff;
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.nz-gate button:hover { background: #0d2c58; }

@media (max-width: 560px) {
  .nz-panel { width: 100vw; border-left: 0; }
  .nz-launch { right: 16px; bottom: 16px; }
}
