/* =====================================================
   rc-ai.css — Maruja
   Asistente IA lateral para República Creativa
===================================================== */

.maruja-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 355;
  width: 48px;
  min-height: 152px;
  border: 1px solid rgba(0,0,0,.34);
  border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  background: #3f3f41;
  color: #fff;
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background .12s ease, transform .12s ease;
}
.maruja-tab:hover,
.maruja-tab.active { background: #2f2f31; }
.maruja-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 18px 0;
}
.maruja-tab span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.maruja-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(28,28,30,.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.maruja-overlay.show { opacity: 1; pointer-events: auto; }

.maruja-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, calc(100vw - 18px));
  z-index: 360;
  background: var(--surface);
  border-left: 1px solid var(--line-soft);
  box-shadow: var(--shadow-modal);
  transform: translateX(102%);
  transition: transform .18s ease;
  display: flex;
  flex-direction: column;
}
.maruja-drawer.show { transform: translateX(0); }

.maruja-head {
  padding: var(--s4);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
}
.maruja-head-copy { flex: 1; min-width: 0; }
.maruja-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.maruja-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b4b4d;
  display: inline-block;
}
.maruja-title {
  font-size: 26px;
  font-weight: var(--fw-semibold);
  color: var(--text);
  line-height: 1.1;
}

.maruja-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  background: linear-gradient(to bottom, rgba(0,0,0,.01), transparent 180px);
}
.maruja-empty {
  margin: auto 0;
  padding: var(--s4);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: rgba(0,0,0,.01);
}
.maruja-empty-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin-bottom: 6px;
}
.maruja-empty-copy {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.maruja-msg { display: flex; }
.maruja-msg-user { justify-content: flex-end; }
.maruja-msg-ai { justify-content: flex-start; }
.maruja-bubble {
  max-width: 90%;
  border-radius: 18px;
  padding: 13px 14px;
  font-size: var(--fs-sm);
  line-height: 1.58;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
}
.maruja-msg-user .maruja-bubble {
  background: #4b4b4d;
  color: #fff;
  border-color: transparent;
}
.maruja-msg-ai .maruja-bubble {
  background: var(--surface);
  color: var(--text);
}
.maruja-msg-text { word-break: break-word; }

.maruja-compose {
  padding: var(--s4);
  display: flex;
  gap: var(--s3);
  align-items: flex-end;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}
.maruja-input {
  flex: 1;
  min-height: 92px;
  max-height: 180px;
  resize: none;
  border: var(--line-w) solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-sm);
  line-height: 1.55;
  padding: var(--s3);
}
.maruja-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(229,57,53,.12);
}
.maruja-actions-row {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
}
.maruja-send {
  min-width: 82px;
  height: 42px;
}
