/* BMC23 AI Security Concierge — dark navy & gold floating widget */

.bmc23-ai-root {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 60;
  font-family: var(--sans, "Outfit", "Segoe UI", sans-serif);
  color: var(--ivory, #ece9e3);
  pointer-events: none;
}

.bmc23-ai-root * { box-sizing: border-box; }

body.is-open .bmc23-ai-root {
  visibility: hidden;
  pointer-events: none;
}

.bmc23-ai-launcher,
.bmc23-ai-panel {
  pointer-events: auto;
}

.bmc23-ai-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 16px 12px 14px;
  border: 1px solid var(--gold-line, rgba(201, 165, 106, 0.28));
  border-radius: 999px;
  background: linear-gradient(180deg, var(--navy-3, #1c2540) 0%, var(--navy, #12182a) 100%);
  color: var(--ivory, #ece9e3);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(201, 165, 106, 0.08),
    0 0 24px rgba(201, 165, 106, 0.12);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.25s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 0.25s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 0.25s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bmc23-ai-launcher:hover,
.bmc23-ai-launcher:focus-visible {
  border-color: var(--gold-bright, #e0c48a);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.5),
    0 0 0 1px var(--gold-bright, #e0c48a),
    0 0 28px rgba(201, 165, 106, 0.28);
  outline: none;
}

.bmc23-ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold, #c9a56a);
  box-shadow: 0 0 0 0 rgba(201, 165, 106, 0.7);
  animation: bmc23-ai-pulse 2.2s ease-out infinite;
  flex: 0 0 auto;
}

@keyframes bmc23-ai-pulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 165, 106, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(201, 165, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 165, 106, 0); }
}

.bmc23-ai-root.is-open .bmc23-ai-launcher { display: none; }

.bmc23-ai-panel {
  display: none;
  flex-direction: column;
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100dvh - 32px - env(safe-area-inset-bottom, 0px)));
  max-height: 620px;
  background: linear-gradient(180deg, var(--navy-2, #171e33) 0%, var(--navy, #12182a) 28%, #0e1322 100%);
  border: 1px solid var(--gold-line, rgba(201, 165, 106, 0.28));
  border-radius: 16px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(201, 165, 106, 0.08),
    0 0 40px rgba(18, 24, 42, 0.6);
  overflow: hidden;
}

.bmc23-ai-root.is-open .bmc23-ai-panel { display: flex; }

.bmc23-ai-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-bottom: 1px solid var(--gold-line, rgba(201, 165, 106, 0.28));
  background: rgba(18, 24, 42, 0.7);
}

.bmc23-ai-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold, #c9a56a);
  box-shadow: 0 0 10px rgba(201, 165, 106, 0.6);
  flex: 0 0 auto;
}

.bmc23-ai-head-text { flex: 1; min-width: 0; }

.bmc23-ai-title {
  margin: 0;
  font-family: var(--sans, "Outfit", "Segoe UI", sans-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ivory, #ece9e3);
}

.bmc23-ai-sub {
  margin: 2px 0 0;
  font-family: var(--mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright, #e0c48a);
}

.bmc23-ai-close {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ivory-soft, #d8d3c8);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.bmc23-ai-close:hover,
.bmc23-ai-close:focus-visible {
  border-color: var(--gold-line, rgba(201, 165, 106, 0.28));
  color: var(--gold-bright, #e0c48a);
  outline: none;
}

.bmc23-ai-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.bmc23-ai-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bmc23-ai-msg a {
  color: var(--gold-bright, #e0c48a);
  text-decoration: underline;
}

.bmc23-ai-msg.is-bot {
  align-self: flex-start;
  background: rgba(28, 37, 64, 0.9);
  border: 1px solid rgba(201, 165, 106, 0.16);
  color: var(--ivory, #ece9e3);
}

.bmc23-ai-msg.is-user {
  align-self: flex-end;
  background: var(--gold, #c9a56a);
  color: var(--ink-on-gold, #0b0d10);
  border-radius: 12px 12px 4px 12px;
}

.bmc23-ai-msg.is-error {
  border-color: rgba(201, 165, 106, 0.45);
}

.bmc23-ai-typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  height: 14px;
}

.bmc23-ai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold, #c9a56a);
  opacity: 0.35;
  animation: bmc23-ai-dots 1.1s infinite ease-in-out;
}

.bmc23-ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.bmc23-ai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bmc23-ai-dots {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.bmc23-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}

.bmc23-ai-chip {
  appearance: none;
  border: 1px solid var(--gold-line, rgba(201, 165, 106, 0.28));
  background: var(--gold-dim, rgba(201, 165, 106, 0.16));
  color: var(--gold-bright, #e0c48a);
  border-radius: 999px;
  padding: 7px 11px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.bmc23-ai-chip:hover,
.bmc23-ai-chip:focus-visible {
  border-color: var(--gold-bright, #e0c48a);
  background: rgba(201, 165, 106, 0.24);
  outline: none;
}

.bmc23-ai-form {
  display: flex;
  gap: 8px;
  padding: 12px 12px 8px;
  border-top: 1px solid var(--gold-line, rgba(201, 165, 106, 0.28));
  background: rgba(7, 8, 10, 0.35);
}

.bmc23-ai-input {
  flex: 1;
  min-width: 0;
  resize: none;
  height: 44px;
  max-height: 96px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--gold-line, rgba(201, 165, 106, 0.28));
  background: #0b0d10;
  color: var(--ivory, #ece9e3);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.bmc23-ai-input:focus {
  outline: none;
  border-color: var(--gold, #c9a56a);
}

.bmc23-ai-send {
  appearance: none;
  border: 1px solid var(--gold, #c9a56a);
  background: var(--gold, #c9a56a);
  color: var(--ink-on-gold, #0b0d10);
  border-radius: 10px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.bmc23-ai-send:hover,
.bmc23-ai-send:focus-visible {
  background: var(--gold-bright, #e0c48a);
  border-color: var(--gold-bright, #e0c48a);
  outline: none;
}

.bmc23-ai-send:disabled,
.bmc23-ai-input:disabled,
.bmc23-ai-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bmc23-ai-footnote {
  margin: 0;
  padding: 0 16px 12px;
  font-size: 11px;
  color: var(--steel, #9aa0a6);
  text-align: center;
}

.bmc23-ai-footnote a { color: var(--gold-bright, #e0c48a); }

@media (max-width: 480px) {
  .bmc23-ai-root {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
  }
  .bmc23-ai-panel {
    width: 100%;
    height: min(72dvh, 640px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
  }
  .bmc23-ai-launcher { width: auto; margin-left: auto; display: flex; }
  .bmc23-ai-root.is-open .bmc23-ai-launcher { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bmc23-ai-dot { animation: none; }
  .bmc23-ai-typing span { animation: none; opacity: 0.8; }
  .bmc23-ai-launcher { transition: none; }
}

@media print {
  .bmc23-ai-root { display: none !important; }
}

.bmc23-ai-chips[hidden] { display: none !important; }
