/* ============================================================
   FEDERATION INTEGRATION PACK v1 — widget styles
   Museum Standard: black panels, gold #FFD700, JetBrains Mono.
   z-index 9000 — always BELOW the universal federation menu (9999).
   ============================================================ */

#fed-chat-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  width: 56px;
  height: 56px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: #000000;
  color: #FFD700;
  border: 1px solid #c9a94e;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  transition: box-shadow 160ms ease, transform 120ms ease;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
#fed-chat-btn:hover,
#fed-chat-btn:focus-visible {
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.55);
  transform: translateY(-2px);
}

#fed-chat-panel {
  position: fixed;
  bottom: 88px;
  right: 20px;
  z-index: 9000;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: min(480px, calc(100vh - 160px));
  display: none;
  flex-direction: column;
  background: #0a0a0a;
  border: 1px solid #c9a94e;
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.3);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 16px;
  color: #FFD700;
}
#fed-chat-panel.fed-open { display: flex; }

.fed-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.35);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fed-chat-badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border: 1px solid #c9a94e;
  border-radius: 999px;
  color: #c9a94e;
}
.fed-chat-close {
  margin-left: auto;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  color: #c9a94e;
  font-size: 20px;
  cursor: pointer;
  font-family: inherit;
}
.fed-chat-close:hover,
.fed-chat-close:focus-visible { color: #FFD700; }

.fed-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}
.fed-chat-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.fed-chat-msg--user {
  align-self: flex-end;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  color: #fff5b8;
}
.fed-chat-msg--bot {
  align-self: flex-start;
  background: #111111;
  border: 1px solid rgba(201, 169, 78, 0.5);
  color: #FFD700;
}
.fed-chat-msg--pending { opacity: 0.6; font-style: italic; }

.fed-chat-msg a { color: #fff5b8; text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
.fed-chat-msg a:hover { color: #FFD700; }

.fed-chat-inputrow {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 215, 0, 0.35);
}
#fed-chat-input {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 8px 12px;
  background: #111111;
  border: 1px solid #c9a94e;
  border-radius: 2px;
  color: #FFD700;
  font-family: inherit;
  font-size: 16px;
  outline: none;
}
#fed-chat-input:focus { border-color: #FFD700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
#fed-chat-input::placeholder { color: #8b7a3a; }
#fed-chat-send {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  background: #FFD700;
  color: #000000;
  border: 1px solid #FFD700;
  border-radius: 2px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
#fed-chat-send:hover:not(:disabled) { background: #fff5b8; box-shadow: 0 0 12px rgba(255, 215, 0, 0.55); }
#fed-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  #fed-chat-panel { right: 16px; bottom: 84px; }
  #fed-chat-btn { right: 16px; bottom: 16px; }
}
