/* ─── VOLTFRIQ OCEAN — CHAT STYLES ────────────────────────────────── */

.chat-container {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0;
}

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px; display: flex;
  flex-direction: column; gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.chat-msg {
  display: flex; max-width: 85%;
}
.chat-msg-self { align-self: flex-end; }
.chat-msg-other { align-self: flex-start; }
.chat-msg-system { align-self: center; max-width: 90%; }

.chat-bubble {
  padding: 12px 16px; border-radius: 18px;
  font-size: 14px; line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg-self .chat-bubble {
  background: var(--yellow); color: var(--dark);
  border-bottom-right-radius: 6px;
}
.chat-msg-other .chat-bubble {
  background: var(--light); color: var(--dark);
  border-bottom-left-radius: 6px;
}

.chat-system-text {
  font-size: 12px; color: var(--mid);
  background: var(--light); padding: 6px 14px;
  border-radius: 20px; text-align: center;
  font-weight: 500;
}

.chat-sender {
  font-size: 11px; color: rgba(0,0,0,0.4);
  margin-top: 4px;
}
.chat-msg-self .chat-sender { color: rgba(0,0,0,0.35); }

.chat-text { white-space: pre-wrap; }

/* Card bubbles (assessment, quotation, receipt) */
.chat-card-bubble {
  background: var(--white) !important;
  border: 1.5px solid #E5E7EB;
  border-radius: 16px !important;
  padding: 0; overflow: hidden;
}
.chat-card-header {
  padding: 12px 16px; font-weight: 700;
  font-size: 14px; border-bottom: 1px solid #F3F4F6;
  background: var(--light);
}
.chat-card-body {
  padding: 14px 16px;
}
.chat-card-row {
  font-size: 13px; margin-bottom: 6px;
  line-height: 1.5; color: var(--dark);
}
.chat-card-bubble .chat-sender {
  padding: 8px 16px; border-top: 1px solid #F3F4F6;
}

/* Quotation specific */
.chat-q-section { margin-bottom: 12px; }
.chat-q-label {
  font-size: 12px; font-weight: 700;
  color: var(--mid); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.chat-q-note { font-weight: 400; font-size: 11px; }
.chat-q-item {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 4px 0;
  border-bottom: 1px solid #F3F4F6;
}
.chat-q-item:last-child { border-bottom: none; }
.chat-q-total {
  display: flex; justify-content: space-between;
  font-size: 15px; padding-top: 10px;
  border-top: 2px solid var(--dark);
  margin-top: 4px;
}

/* Receipt */
.chat-receipt .chat-card-header {
  background: var(--green-light); color: #065F46;
}

/* Input bar */
.chat-input-bar {
  display: flex; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #E5E7EB;
  background: var(--white);
  flex-shrink: 0;
}

.chat-text-input {
  flex: 1; padding: 12px 16px;
  border: 1.5px solid #E5E7EB; border-radius: 24px;
  font-family: inherit; font-size: 14px;
  outline: none; background: var(--light);
}
.chat-text-input:focus { border-color: var(--yellow); background: var(--white); }

.chat-send-btn {
  width: 44px; height: 44px;
  background: var(--yellow); border: none;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--dark); flex-shrink: 0;
  transition: background 0.15s;
}
.chat-send-btn:hover { background: var(--yellow-dark); }

/* Full-app dark theme unification */
.chat-messages {
  background: transparent;
}

.chat-msg-other .chat-bubble {
  background: linear-gradient(180deg, rgba(12, 24, 41, 0.96) 0%, rgba(8, 17, 31, 0.98) 100%);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.chat-system-text {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.chat-sender,
.chat-msg-self .chat-sender {
  color: var(--text-tertiary);
}

.chat-card-bubble {
  background: linear-gradient(180deg, rgba(12, 24, 41, 0.98) 0%, rgba(8, 17, 31, 0.98) 100%) !important;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.chat-card-header {
  border-bottom-color: var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.chat-card-row,
.chat-q-item {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.chat-q-label,
.chat-q-note {
  color: var(--text-secondary);
}

.chat-q-total {
  border-top-color: var(--border-strong);
}

.chat-receipt .chat-card-header {
  background: rgba(38, 194, 129, 0.14);
  color: #9ff0c8;
}

.chat-card-bubble .chat-sender {
  border-top-color: var(--border-subtle);
}

.chat-input-bar {
  border-top-color: var(--border-subtle);
  background: rgba(5, 11, 21, 0.96);
  backdrop-filter: blur(14px);
}

.chat-text-input {
  border-color: var(--border-subtle);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
}

.chat-text-input::placeholder {
  color: var(--text-tertiary);
}

.chat-text-input:focus {
  border-color: rgba(255, 184, 0, 0.55);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--focus-ring);
}
