:root {
  --of-chat-ink: #07110f;
  --of-chat-surface: #0b1714;
  --of-chat-surface-2: #10211d;
  --of-chat-border: rgba(255,255,255,.11);
  --of-chat-text: #eef7f4;
  --of-chat-muted: #8fa19b;
  --of-chat-teal: #5eead4;
  --of-chat-teal-bright: #8df8e8;
  --of-chat-blue: #123fc4;
  --of-chat-blue-soft: rgba(18,63,196,.28);
  --of-chat-radius: 16px;
  --of-chat-font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.of-chat-launcher,
.of-chat-window,
.of-chat-window * {
  box-sizing: border-box;
}

.of-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(94,234,212,.28);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--of-chat-ink);
  background:
    radial-gradient(circle at 72% 18%, rgba(18,63,196,.5), transparent 33%),
    linear-gradient(135deg, var(--of-chat-teal), var(--of-chat-teal-bright) 58%, var(--of-chat-blue));
  box-shadow: 0 18px 42px rgba(0,0,0,.34), 0 0 0 8px rgba(94,234,212,.055);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.of-chat-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 55px rgba(0,0,0,.4), 0 0 0 8px rgba(94,234,212,.085);
}

.of-chat-launcher svg {
  width: 27px;
  height: 27px;
}

.of-chat-pulse {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 15px;
  height: 15px;
  border: 2px solid #07110f;
  border-radius: 50%;
  background: var(--of-chat-teal);
  box-shadow: 0 0 18px rgba(94,234,212,.8);
}

.of-chat-window {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 1000;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 138px);
  border: 1px solid var(--of-chat-border);
  border-radius: var(--of-chat-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--of-chat-text);
  background:
    radial-gradient(circle at 92% 3%, rgba(94,234,212,.15), transparent 30%),
    radial-gradient(circle at 0% 100%, rgba(18,63,196,.32), transparent 36%),
    var(--of-chat-surface);
  box-shadow: 0 35px 85px rgba(0,0,0,.45);
  font-family: var(--of-chat-font);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 16px)) scale(.98);
  transition: opacity .23s ease, transform .23s ease;
}

.of-chat-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.of-chat-window.moved.open {
  transform: none;
}

.of-chat-window.dragging {
  transition: none;
  user-select: none;
  transform: none !important;
}

.of-chat-header {
  padding: 17px 18px 15px;
  border-bottom: 1px solid var(--of-chat-border);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  cursor: grab;
  touch-action: none;
}

.of-chat-window.dragging .of-chat-header {
  cursor: grabbing;
}

.of-chat-header-top {
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.of-chat-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.of-chat-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--of-chat-ink);
  background: linear-gradient(135deg, var(--of-chat-teal), var(--of-chat-blue));
  font-size: 13px;
  font-weight: 900;
}

.of-chat-brand-name {
  display: block;
  color: var(--of-chat-text);
  font-size: 14px;
  font-weight: 800;
}

.of-chat-brand-sub {
  display: block;
  margin-top: 2px;
  color: var(--of-chat-muted);
  font-size: 11px;
}

.of-chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.of-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--of-chat-teal);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.of-chat-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--of-chat-teal);
  box-shadow: 0 0 0 4px rgba(94,234,212,.12);
}

.of-chat-close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--of-chat-muted);
  background: rgba(255,255,255,.035);
  cursor: pointer;
}

.of-chat-close:hover {
  color: var(--of-chat-text);
  border-color: rgba(94,234,212,.24);
}

.of-chat-close svg {
  width: 15px;
  height: 15px;
}

.of-chat-meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
}

.of-chat-meter-label,
.of-chat-meter-stage {
  color: var(--of-chat-muted);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .85px;
  white-space: nowrap;
}

.of-chat-meter-stage {
  min-width: 78px;
  color: var(--of-chat-teal);
  text-align: right;
}

.of-chat-meter-track {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.09);
}

.of-chat-meter-fill {
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--of-chat-blue), var(--of-chat-teal));
  transition: width .45s cubic-bezier(.22,.75,.32,1);
}

.of-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.of-chat-body::-webkit-scrollbar {
  width: 5px;
}

.of-chat-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,.16);
}

.of-chat-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.of-chat-row.user {
  justify-content: flex-end;
}

.of-chat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  color: var(--of-chat-ink);
  background: linear-gradient(135deg, var(--of-chat-teal), var(--of-chat-blue));
  font-size: 11px;
  font-weight: 900;
}

.of-chat-bubble {
  max-width: 80%;
  padding: 11px 13px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.48;
  animation: ofChatIn .24s ease both;
}

@keyframes ofChatIn {
  from { opacity: 0; transform: translateY(6px); }
}

.of-chat-row.bot .of-chat-bubble {
  border: 1px solid var(--of-chat-border);
  border-bottom-left-radius: 4px;
  color: var(--of-chat-text);
  background: rgba(255,255,255,.06);
}

.of-chat-row.user .of-chat-bubble {
  border-bottom-right-radius: 4px;
  color: var(--of-chat-ink);
  background: linear-gradient(135deg, var(--of-chat-teal), var(--of-chat-teal-bright));
  font-weight: 700;
}

.of-chat-typing-dots {
  padding: 11px 14px;
  border: 1px solid var(--of-chat-border);
  border-radius: 13px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,.06);
}

.of-chat-typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--of-chat-muted);
  animation: ofChatBounce 1.1s infinite ease-in-out;
}

.of-chat-typing-dots span:nth-child(2) {
  animation-delay: .15s;
}

.of-chat-typing-dots span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes ofChatBounce {
  0%, 60%, 100% { opacity: .45; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.of-chat-result {
  margin-left: 32px;
  padding: 16px;
  border: 1px solid rgba(94,234,212,.22);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(18,63,196,.28), transparent 38%),
    rgba(255,255,255,.06);
  animation: ofChatIn .26s ease both;
}

.of-chat-result-tag {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--of-chat-teal);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .9px;
}

.of-chat-result-tag .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--of-chat-teal);
  box-shadow: 0 0 12px rgba(94,234,212,.7);
}

.of-chat-result p {
  margin: 0 0 13px;
  color: #a9bbb5;
  font-size: 12.5px;
  line-height: 1.55;
}

.of-chat-summary {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(94,234,212,.15);
  border-radius: 11px;
  background: rgba(5,11,9,.22);
}

.of-chat-summary span {
  display: block;
  margin-bottom: 9px;
  color: var(--of-chat-teal);
  font-size: 9.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .9px;
}

.of-chat-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.of-chat-summary li {
  margin: 7px 0;
  color: #b7c7c2;
  font-size: 12px;
  line-height: 1.45;
}

.of-chat-summary strong {
  color: var(--of-chat-teal);
}

.of-chat-cta {
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--of-chat-ink);
  background: linear-gradient(115deg, var(--of-chat-teal), var(--of-chat-teal-bright) 72%, var(--of-chat-blue) 116%);
  cursor: pointer;
  font-family: var(--of-chat-font);
  font-size: 12.5px;
  font-weight: 900;
  text-decoration: none;
}

.of-chat-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--of-chat-border);
  display: flex;
  gap: 8px;
  background: rgba(5,11,9,.35);
}

.of-chat-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  outline: none;
  color: var(--of-chat-text);
  background: rgba(255,255,255,.06);
  font: 500 13px var(--of-chat-font);
}

.of-chat-input::placeholder {
  color: #71847e;
}

.of-chat-input:focus {
  border-color: rgba(94,234,212,.45);
  box-shadow: 0 0 0 3px rgba(94,234,212,.08);
}

.of-chat-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--of-chat-ink);
  background: linear-gradient(135deg, var(--of-chat-teal), var(--of-chat-blue));
  cursor: pointer;
  opacity: .45;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.of-chat-send.active {
  opacity: 1;
  pointer-events: auto;
}

.of-chat-send:hover {
  transform: translateY(-1px);
}

.of-chat-send svg {
  width: 17px;
  height: 17px;
}

.of-chat-note {
  padding: 0 14px 12px;
  color: #657871;
  background: rgba(5,11,9,.35);
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .of-chat-window {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: calc(100vw - 24px);
    height: min(590px, calc(100vh - 112px));
  }

  .of-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .of-chat-launcher,
  .of-chat-window,
  .of-chat-bubble,
  .of-chat-typing-dots span,
  .of-chat-meter-fill {
    animation: none !important;
    transition: none !important;
  }
}
