/* Helper widget — Nadia (marketing) + Nadia (app / embed). Tokens: ../tokens.css */
:root {
  --navy: #0D1B2A;
  --navy-2: #12263A;
  --teal: #00B4A6;
  --teal-dark: #009688;
  --teal-soft: rgba(0, 180, 166, 0.14);
  --ink: #1E293B;
  --muted: #64748B;
  --line: #E2E8F0;
  --paper: #F8FAFC;
  --white: #FFFFFF;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --display: "Instrument Serif", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mh-navy: #0D1B2A;
  --mh-navy-2: #12263A;
  --mh-teal: #00B4A6;
  --mh-teal-dark: #009688;
  --mh-teal-soft: rgba(0, 180, 166, 0.14);
  --mh-ink: #1E293B;
  --mh-muted: #64748B;
  --mh-line: #E2E8F0;
  --mh-paper: #F8FAFC;
  --mh-white: #fff;
  --mh-shadow: 0 24px 64px rgba(13, 27, 42, 0.22);
  --mh-font: "Inter", system-ui, -apple-system, sans-serif;
  --mh-display: "Instrument Serif", Georgia, serif;
  --mh-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mh-z: 90;
}

.mh-fab, .mh-send, .mh-close, .mh-chip, .mh-topics button { font-family: inherit; }
.mh-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: var(--mh-z);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--mh-navy);
  color: #fff;
  font: 600 0.92rem var(--mh-font);
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(13, 27, 42, 0.28);
  transition: transform 180ms var(--mh-ease), background 180ms var(--mh-ease);
}
.mh-fab:hover { background: #12263A; transform: translateY(-1px); }
.mh-fab:focus-visible { outline: 2px solid var(--mh-teal); outline-offset: 3px; }
.mh-root--nadia .mh-fab {
  background: var(--mh-teal);
  box-shadow: 0 12px 32px rgba(0, 180, 166, 0.38);
  animation: mh-invite 2.8s var(--mh-ease) 1.4s 2;
}
.mh-root--nadia .mh-fab:hover { background: var(--mh-teal-dark); }
@keyframes mh-invite {
  0%, 100% { transform: none; }
  40% { transform: translateY(-3px); }
  70% { transform: translateY(-1px); }
}
.mh-fab-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(145deg, var(--mh-teal), var(--mh-teal-dark));
  display: grid; place-items: center;
  font-family: var(--mh-display); font-size: 1.05rem; line-height: 1;
}
.mh-fab[hidden], .mh-panel[hidden] { display: none !important; }

.mh-panel {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: calc(var(--mh-z) + 1);
  width: min(400px, calc(100vw - 24px));
  height: min(620px, calc(100dvh - 120px));
  background: var(--mh-white);
  border: 1px solid var(--mh-line);
  border-radius: 20px;
  box-shadow: var(--mh-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--mh-font);
  color: var(--mh-ink);
}
.mh-head {
  background: var(--mh-navy);
  color: #fff;
  padding: 16px 16px 14px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
}
.mh-head-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(145deg, var(--mh-teal), var(--mh-teal-dark));
  display: grid; place-items: center;
  font-family: var(--mh-display); font-size: 1.3rem; line-height: 1;
}
.mh-head h2 {
  margin: 0;
  font-family: var(--mh-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #fff;
}
.mh-head p { margin: 2px 0 0; font-size: 11.5px; color: #94A3B8; }
.mh-close {
  width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,0.08); color: #fff;
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.mh-close:hover { background: rgba(255,255,255,0.16); }

.mh-demo {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px;
  background: #F1F5F9; color: #475569;
  font-size: 11.5px; font-weight: 500;
  border-bottom: 1px solid #E2E8F0;
}
.mh-demo a { color: #334155; text-decoration: underline; }
.mh-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px;
  background: #F8FAFC; color: #64748B;
  font-size: 11px; font-weight: 500;
  border-top: 1px solid #E2E8F0;
}
.mh-footer a { color: #334155; text-decoration: underline; }

.mh-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: var(--mh-paper);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mh-msg { max-width: 92%; }
.mh-msg.user { align-self: flex-end; }
.mh-msg .bubble {
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mh-msg.user .bubble {
  background: var(--mh-navy);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.mh-msg.expert .bubble {
  background: #fff;
  color: var(--mh-ink);
  border: 1px solid var(--mh-line);
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 2px rgba(13, 27, 42, 0.04);
}
.mh-who {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mh-teal-dark);
  margin-bottom: 4px;
}
.mh-cite {
  margin-top: 8px; font-size: 11px; color: var(--mh-muted);
}
.mh-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mh-chip {
  border: 1px solid var(--mh-line); background: #fff;
  border-radius: 999px; padding: 6px 10px;
  font: 600 11.5px var(--mh-font); color: var(--mh-navy); cursor: pointer;
}
.mh-chip:hover { border-color: var(--mh-teal); color: var(--mh-teal-dark); }

.mh-suggest {
  padding: 10px 14px 4px;
  display: flex; flex-wrap: wrap; gap: 6px;
  background: #fff; border-top: 1px solid var(--mh-line);
}
.mh-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 14px 14px;
  background: #fff;
  border-top: 1px solid var(--mh-line);
}
.mh-form textarea {
  width: 100%; min-height: 44px; max-height: 96px; resize: none;
  border: 1px solid var(--mh-line); border-radius: 12px;
  padding: 10px 12px; font: 400 0.92rem var(--mh-font); color: var(--mh-ink);
}
.mh-form textarea:focus { outline: 2px solid var(--mh-teal); border-color: transparent; }
.mh-send {
  align-self: end;
  height: 44px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--mh-teal); color: #fff; font: 600 0.9rem var(--mh-font);
  cursor: pointer;
}
.mh-send:hover { background: var(--mh-teal-dark); }
.mh-send:disabled { opacity: 0.55; cursor: default; }
.mh-cta {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 10px; padding: 9px 14px; border-radius: 10px;
  background: var(--mh-teal); color: #fff !important; font: 600 0.82rem var(--mh-font);
  text-decoration: none;
}
.mh-cta:hover { background: var(--mh-teal-dark); }
.mh-typing .bubble { display: flex; gap: 5px; align-items: center; min-width: 52px; }
.mh-typing .bubble i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--mh-muted);
  animation: mh-dot 1s ease-in-out infinite;
}
.mh-typing .bubble i:nth-child(2) { animation-delay: 0.15s; }
.mh-typing .bubble i:nth-child(3) { animation-delay: 0.3s; }
@keyframes mh-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Dedicated /help desk */
.mh-desk {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.mh-desk-main {
  background: #fff;
  border: 1px solid var(--mh-line);
  border-radius: 24px;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(13, 27, 42, 0.08);
}
.mh-desk-main .mh-log { min-height: 420px; max-height: 560px; }
.mh-topics {
  background: #fff;
  border: 1px solid var(--mh-line);
  border-radius: 24px;
  padding: 22px;
}
.mh-topics h3 { margin: 0 0 6px; color: var(--mh-navy); font-size: 0.95rem; }
.mh-topics p { margin: 0 0 14px; color: var(--mh-muted); font-size: 0.85rem; }
.mh-topics button {
  display: block; width: 100%; text-align: left;
  background: var(--mh-paper); border: 1px solid var(--mh-line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  font: 500 0.88rem var(--mh-font); color: var(--mh-navy); cursor: pointer;
}
.mh-topics button:hover { border-color: var(--mh-teal); }
.mh-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--mh-teal-dark); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}

@media (max-width: 860px) {
  .mh-desk { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mh-fab { right: 12px; bottom: 12px; }
  .mh-panel {
    right: 8px; left: 8px; bottom: 72px; width: auto;
    height: min(72dvh, 640px); border-radius: 16px;
  }
  .mh-nudge { right: 12px; bottom: 72px; }
}

.mh-live {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mh-teal);
  box-shadow: 0 0 0 0 rgba(0, 180, 166, 0.55);
  margin-right: 7px;
  vertical-align: middle;
  animation: mh-pulse 2.2s ease-out infinite;
}
@keyframes mh-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 180, 166, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(0, 180, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 180, 166, 0); }
}

.mh-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.mh-cta-row .mh-cta { margin-top: 0; }
.mh-mail {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--mh-line);
  color: var(--mh-navy);
  font: 600 0.82rem var(--mh-font);
  text-decoration: none;
  background: #fff;
}
.mh-mail:hover { border-color: var(--mh-teal); color: var(--mh-teal-dark); }

.mh-capture {
  margin-top: 10px;
  padding: 10px;
  background: #fff;
  border: 1px dashed var(--mh-teal);
  border-radius: 12px;
  display: grid;
  gap: 6px;
}
.mh-capture label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mh-teal-dark);
}
.mh-capture-input {
  width: 100%;
  border: 1px solid var(--mh-line);
  border-radius: 10px;
  padding: 9px 11px;
  font: 400 0.92rem var(--mh-font);
  color: var(--mh-ink);
}
.mh-capture-input:focus { outline: 2px solid var(--mh-teal); border-color: transparent; }
.mh-capture-go {
  justify-self: start;
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  background: var(--mh-navy);
  color: #fff;
  font: 600 0.82rem var(--mh-font);
  cursor: pointer;
}
.mh-capture-go:hover { background: var(--mh-navy-2); }

.mh-nudge {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: calc(var(--mh-z) + 2);
  width: min(280px, calc(100vw - 28px));
  background: #fff;
  color: var(--mh-ink);
  border: 1px solid var(--mh-line);
  border-radius: 18px;
  box-shadow: var(--mh-shadow);
  padding: 16px 16px 14px;
  font-family: var(--mh-font);
  animation: mh-nudge-in 420ms var(--mh-ease);
}
.mh-nudge::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -6px;
  width: 12px; height: 12px;
  background: #fff;
  border-right: 1px solid var(--mh-line);
  border-bottom: 1px solid var(--mh-line);
  transform: rotate(45deg);
}
.mh-nudge-title {
  font-family: var(--mh-display);
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  color: var(--mh-navy);
  margin: 0 28px 4px 0;
  line-height: 1.2;
}
.mh-nudge-body {
  margin: 0 0 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--mh-muted);
}
.mh-nudge-go {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--mh-teal);
  color: #fff;
  font: 600 0.82rem var(--mh-font);
  cursor: pointer;
}
.mh-nudge-go:hover { background: var(--mh-teal-dark); }
.mh-nudge-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--mh-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.mh-nudge-x:hover { background: var(--mh-paper); color: var(--mh-navy); }
@keyframes mh-nudge-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mh-fab, .mh-panel { transition: none; animation: none; }
  .mh-root--nadia .mh-fab { animation: none; }
  .mh-live, .mh-nudge { animation: none; }
}
