/* ============================================
   Really Artificial Intelligence(tm) - styles
   Loaded in addition to style.css
   ============================================ */

.rai {
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.rai-panel {
  background: linear-gradient(180deg, #1c1c2c 0%, #12121c 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Stats bar --- */
.rai-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  justify-content: center;
  background: #191926;
  border: 1px solid #262640;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.rai-stats b { color: var(--accent); font-weight: 700; }

/* --- Messages --- */
.rai-chat {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.25rem 0.1rem;
  margin-bottom: 0.9rem;
  scroll-behavior: smooth;
}

.rai-msg {
  max-width: 85%;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.rai-msg.user {
  align-self: flex-end;
  background: linear-gradient(180deg, #1a2c3c 0%, #142331 100%);
  border: 1px solid #22415c;
  border-bottom-right-radius: 4px;
}

.rai-msg.bot {
  align-self: flex-start;
  background: #1b1b28;
  border: 1px solid #2a2a40;
  border-bottom-left-radius: 4px;
}

.rai-msg.bot .who {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 0.2rem;
}

.rai-msg.bot .meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.rai-msg.bot.brag {
  border-color: rgba(0, 212, 255, 0.35);
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.08), rgba(0, 212, 255, 0.02));
}

/* --- Input row --- */
.rai-inputrow {
  display: flex;
  gap: 0.5rem;
}

.rai-input {
  flex: 1;
  appearance: none;
  background: #0d0d14;
  border: 1px solid #2a2a40;
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  min-width: 0;
}

.rai-input:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.5);
}

.rai-send {
  appearance: none;
  border: 1px solid #00d4ff;
  background: linear-gradient(180deg, #00d4ff 0%, #00a8cc 100%);
  color: #05202b;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, transform 0.06s;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.rai-send:hover { background: linear-gradient(180deg, #33ddff 0%, #00bce0 100%); }
.rai-send:active { transform: translateY(2px); box-shadow: none; }

/* --- Toolbar --- */
.rai-toolbar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.rai-toolbar button {
  appearance: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.rai-toolbar button:hover {
  color: var(--accent);
  border-color: rgba(0, 212, 255, 0.4);
}

@media (max-width: 480px) {
  .rai-chat { max-height: 340px; }
  .rai-msg { max-width: 92%; }
}
