/* Brama Industries — Orba chat widget + form wiring styles.
   Prefixed .brama-chat-* so nothing clashes with the site's own classes.
   Palette matches the site: ink #0B0D10, steel #1a1e24, mist #f4f2ec,
   mute #9aa3ad, signal #eb3132, press #b82525, line #2a313c. */

.brama-chat-btn {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #eb3132;
  color: #f4f2ec;
  font: 600 14px/1 "Inter", system-ui, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}
.brama-chat-btn:hover { background: #b82525; }
.brama-chat-btn svg { flex: none; }

.brama-chat-panel {
  position: fixed;
  right: 16px;
  bottom: 84px;
  z-index: 61;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 160px));
  min-height: 320px;
  overflow: hidden;
  background: #0b0d10;
  border: 1px solid #2a313c;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  font-family: "Inter", system-ui, sans-serif;
}
.brama-chat-hidden { display: none !important; }

.brama-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #1a1e24;
  border-bottom: 1px solid #2a313c;
}
.brama-chat-head .brama-chat-title {
  font: 600 15px/1.3 "Inter Tight", "Inter", system-ui, sans-serif;
  color: #f4f2ec;
}
.brama-chat-head .brama-chat-sub {
  font-size: 12px;
  line-height: 1.4;
  color: #9aa3ad;
}
.brama-chat-close {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid #2a313c;
  border-radius: 8px;
  background: transparent;
  color: #f4f2ec;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.brama-chat-close:hover { border-color: #eb3132; color: #eb3132; }

.brama-chat-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}
.brama-chat-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.brama-chat-ai {
  align-self: flex-start;
  background: #1a1e24;
  border: 1px solid #2a313c;
  color: #f4f2ec;
}
.brama-chat-user {
  align-self: flex-end;
  background: #eb3132;
  color: #fff;
}
.brama-chat-typing { color: #9aa3ad; }
.brama-chat-typing .dot {
  display: inline-block;
  animation: brama-chat-blink 1.2s infinite;
}
.brama-chat-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.brama-chat-typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes brama-chat-blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.brama-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}
.brama-chat-chip {
  border: 1px solid #2a313c;
  border-radius: 999px;
  background: transparent;
  color: #f4f2ec;
  font: 500 12px/1 "Inter", system-ui, sans-serif;
  padding: 7px 12px;
  cursor: pointer;
  text-decoration: none;
}
.brama-chat-chip:hover { border-color: #eb3132; color: #eb3132; }

.brama-chat-sendbtn {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: #eb3132;
  color: #fff;
  font: 600 14px/1.3 "Inter", system-ui, sans-serif;
  cursor: pointer;
  text-align: center;
}
.brama-chat-sendbtn:hover { background: #b82525; }

.brama-chat-inputrow {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #2a313c;
}
.brama-chat-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #2a313c;
  border-radius: 8px;
  background: #1a1e24;
  color: #f4f2ec;
  font-size: 14px;
  outline: none;
}
.brama-chat-input:focus { border-color: #eb3132; }
.brama-chat-input::placeholder { color: #9aa3ad; }
.brama-chat-send {
  flex: none;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #eb3132;
  color: #fff;
  font: 600 14px/1 "Inter", system-ui, sans-serif;
  cursor: pointer;
}
.brama-chat-send:hover { background: #b82525; }
.brama-chat-send:disabled,
.brama-chat-input:disabled { opacity: 0.5; cursor: default; }

/* Mobile: the site's bottom dock is 44px + safe-area; float above it. */
@media (max-width: 820px) {
  .brama-chat-btn {
    right: 12px;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .brama-chat-panel {
    right: 12px;
    bottom: calc(116px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px);
    height: min(540px, calc(100dvh - 190px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .brama-chat-typing .dot { animation: none; }
}
