:root {
  /* Intterco Brand Tokens */
  --ic-accent: #DDAC5F;
  --ic-accent-dim: rgba(221, 172, 95, 0.2);
  --ic-bg-glass: rgba(46, 60, 60, 0.95); /* Deep Charcoal Glass */
  --ic-border: rgba(255, 255, 255, 0.1);
  --ic-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  
  /* Tech Specs */
  --ic-font: 'Plus Jakarta Sans', sans-serif;
  --ic-ease: cubic-bezier(0.19, 1, 0.22, 1); /* Mechanical Ease */
}

/* Main Container (Injected via JS) */
#intterco-chat-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: 90%;
  z-index: 999999;
  font-family: var(--ic-font);
}

/* Launcher Button */
.ic-chat-launcher {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 64px;
  height: 64px;
  /* Slightly squared for tech feel, not perfect circle */
  border-radius: 8px; 
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ic-bg-glass);
  border: 1px solid var(--ic-accent);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: all 0.3s var(--ic-ease);
  z-index: 2;
}

.ic-chat-launcher:hover {
  transform: translateY(-4px);
  background: var(--ic-accent);
  box-shadow: 0 0 20px var(--ic-accent-dim);
}

.ic-chat-launcher:hover svg { stroke: #2E3C3C; }

.ic-chat-launcher svg {
  width: 28px;
  height: 28px;
  stroke: var(--ic-accent);
  transition: stroke 0.3s;
}

/* Wrapper */
.ic-chat-wrap {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 100%;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  transition: all 0.4s var(--ic-ease);
}

.ic-chat-wrap.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Window */
.ic-chat-window {
  width: 100%;
  height: 600px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #1F2929; /* Solid Matte Charcoal */
  border: 1px solid var(--ic-border);
  border-radius: 4px; /* Sharp corners */
  box-shadow: var(--ic-shadow);
}

/* Header */
.ic-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(30, 40, 40, 0.98);
  border-bottom: 1px solid var(--ic-border);
}

.ic-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: #fff;
  text-transform: uppercase;
}

.ic-chat-icon {
  height: 24px;
  width: auto;
}

.ic-close {
  background: transparent;
  border: none;
  color: var(--ic-accent);
  cursor: pointer;
  transition: 0.3s;
}

/* Body */
.ic-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  /* Subtle grid background pattern */
  background-image: radial-gradient(var(--ic-border) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: #232E2E;
  scrollbar-width: thin;
  scrollbar-color: var(--ic-border) transparent;
}

/* Messages */
.ic-msg {
  display: flex;
  margin-bottom: 16px;
  animation: slideIn 0.3s var(--ic-ease);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.ic-msg.user { justify-content: flex-end; }

.ic-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

/* Bot Bubble */
.ic-msg.bot .ic-bubble {
  background: #2E3C3C;
  border-color: var(--ic-border);
  color: #E0E0E0;
  border-left: 2px solid var(--ic-accent); /* Tech accent line */
}

/* User Bubble */
.ic-msg.user .ic-bubble {
  background: var(--ic-accent);
  color: #1F2929;
  font-weight: 600;
}

/* Input Area */
.ic-chat-input {
  padding: 16px;
  background: #171F1F;
  border-top: 1px solid var(--ic-border);
  display: flex;
  gap: 10px;
}

.ic-chat-input input {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--ic-border);
  border-radius: 2px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--ic-font);
  font-size: 0.9rem;
  outline: none;
  transition: 0.3s;
}

.ic-chat-input input:focus {
  border-color: var(--ic-accent);
}

.ic-send {
  background: transparent;
  border: 1px solid var(--ic-accent);
  color: var(--ic-accent);
  padding: 0 20px;
  border-radius: 2px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: 0.3s;
}

.ic-send:hover {
  background: var(--ic-accent);
  color: #1F2929;
}

/* Typing Indicator */
.ic-typing {
  display: flex; gap: 4px; padding: 4px 8px;
}
.ic-typing span {
  width: 4px; height: 4px; background: var(--ic-accent);
  animation: pulse 1s infinite;
}
.ic-typing span:nth-child(2) { animation-delay: 0.2s; }
.ic-typing span:nth-child(3) { animation-delay: 0.4s; }

/* Mobile */
@media (max-width: 640px) {
  #intterco-chat-container { width: 100%; right: 0; bottom: 0; max-width: 100%; }
  .ic-chat-launcher { bottom: 20px; right: 20px; }
  .ic-chat-wrap { bottom: 0; }
  .ic-chat-window { height: 100vh; max-height: 100vh; border-radius: 0; }
}