/* ===== GIRAFE Chatbot — Pro Clean v3.8.1 ===== */
:root{
  --bg:#f8f9fb; --paper:#fff; --ink:#0f172a; --ink-2:#475569;
  --muted:#64748b; --line:#e9eef6; --line-2:#dfe6ef;
  --brand:#ff7b8a; --brand-600:#ff5f74; --pri:#4c7cf3; --pri-600:#3a6bf0;
  --bot-bg:#ffffff; --bot-br:#e8eef9; --me-bg:#ffeef1; --me-br:#ffd5dc; --me-ink:#8a1130;
  --shadow-s:0 4px 16px rgba(20,32,64,0.06); --shadow-m:0 10px 28px rgba(18,38,77,0.08);
  --ring-pri:0 0 0 3px rgba(76,124,243,0.15); --radius:16px; --radius-sm:12px;
}

/* Wrapper + CTA inferior */
.gchat{ max-width:1220px; margin:0 auto; padding:12px 12px 28px; }
.gchat .chat-cta-planet{ margin-top:14px; text-align:center; }
.gchat .cta-pill{
  display:inline-flex; align-items:center; gap:8px; padding:10px 14px;
  border-radius:999px; background:#f5f8ff; border:1px solid #e3e9ff; color:#1d2a55;
  text-decoration:none; font-weight:700; box-shadow:0 6px 18px rgba(76,124,243,.10);
}
.gchat .cta-pill:hover{ background:#eef4ff; }

/* Shell */
.gchat .chat-shell{
  background:var(--paper); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-m); display:flex; flex-direction:column; height:clamp(520px, 70vh, 80vh); overflow:hidden;
}

/* Topbar + chips */
.gchat .chat-topbar{
  position:sticky; top:0; z-index:2; background:linear-gradient(0deg,#fff,#f4f7ff);
  border-bottom:1px solid var(--line); padding:12px; box-shadow:0 2px 8px rgba(18,38,77,.04);
}
.gchat .chip-grid{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; max-width:760px; margin:0 auto; }
.gchat .chip{
  border:1px solid #dfe6fb; background:#f3f6ff; color:#233567; border-radius:999px; padding:11px 14px;
  font-size:.96rem; line-height:1; cursor:pointer; transition:transform .08s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.gchat .chip:hover{ transform:translateY(-1px); background:#eaf0ff; border-color:#ccd9ff; }

/* Stream */
.gchat .chat-stream{ flex:1 1 auto; background:var(--bg); padding:18px 16px 10px; overflow:auto; scroll-behavior:smooth; overscroll-behavior:contain; font-size:15.5px; }
.gchat .msg{ display:flex; width:100%; margin:12px 0; line-height:1.65; color:var(--ink); }
.gchat .msg.me{ justify-content:flex-end; }
.gchat .msg.bot{ justify-content:flex-start; }
.gchat .msg .bubble{
  display:block; max-width:86%; padding:14px 16px; border-radius:14px; border:1px solid var(--line); background:var(--paper);
  word-break:break-word; overflow-wrap:anywhere;
}
.gchat .msg .bubble h3{ margin:0 0 6px; font-size:1.02em; line-height:1.35; }
.gchat .msg .bubble p{ margin:0 0 8px; }
.gchat .msg .bubble ul{ margin:6px 0 8px 18px; }
.gchat .msg.bot .bubble{ background:var(--bot-bg); border-color:var(--bot-br); border-radius:14px 14px 14px 6px; }
.gchat .msg.me .bubble{ background:var(--me-bg); border-color:var(--me-br); color:var(--me-ink); border-radius:14px 14px 6px 14px; }

/* Typing */
.gchat .typing{ display:inline-flex; gap:6px; align-items:center; }
.gchat .typing i{ width:6px; height:6px; border-radius:999px; background:#9aa7c4; display:inline-block; animation:ty 1.2s infinite ease-in-out; }
.gchat .typing i:nth-child(2){ animation-delay:.15s; }
.gchat .typing i:nth-child(3){ animation-delay:.3s; }
@keyframes ty{ 0%,80%,100%{ transform:scale(0.6); opacity:.5 } 40%{ transform:scale(1); opacity:1 } }

/* Estados y textos auxiliares */
.gchat .muted{ color:var(--ink-2); opacity:.9; }
.gchat .note{ background:#fff9fb; border:1px solid #ffe1e8; padding:8px 10px; border-radius:10px; }
.gchat .error{ background:#fff2f4; border:1px solid #ffd7de; color:#8c1d2a; padding:8px 10px; border-radius:10px; }
.gchat .success{ background:#e8fff3; border:1px solid #b4f1ce; color:#0f5132; padding:8px 10px; border-radius:10px; }
.gchat .welcome{ color:var(--ink-2); }

/* Controles (desktop) */
.gchat .chat-controls{
  display:grid; grid-template-columns:1fr auto auto; gap:10px; padding:12px; background:#fff; border-top:1px solid var(--line);
}
.gchat .ctrl-input{
  width:100%; min-height:44px; max-height:160px; resize:none; border:1px solid var(--line); border-radius:12px; padding:10px 12px;
  font-size:15px; outline:none; background:#fff; transition:box-shadow .2s ease, border-color .2s ease;
}
.gchat .ctrl-input:focus{ border-color:#cfd8f3; box-shadow:var(--ring-pri); }
.gchat .ctrl-btn, .gchat .ctrl-chip{
  border:1px solid var(--line); background:#598aff; color:#111827; border-radius:12px; padding:10px 14px; font-size:14px; cursor:pointer;
  transition:transform .08s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.gchat .ctrl-btn.primary{ background:var(--pri); color:#fff; border-color:var(--pri); box-shadow:0 6px 18px rgba(76,124,243,.22); }
.gchat .ctrl-chip.cta{ background:var(--brand); color:#fff; border-color:var(--brand); }
.gchat .ctrl-btn.icon{ display:inline-flex; align-items:center; justify-content:center; padding:4px 12px; }

/* Wizard + backdrop */
.gchat .wizard-backdrop{ position:sticky; bottom:0; height:0; }
.gchat .wizard-backdrop::before{ content:""; position:fixed; inset:0; background:rgba(9,15,34,.18); backdrop-filter:saturate(1.1) blur(3px); }
.gchat .wizard{
  position:fixed; left:50%; transform:translateX(-50%) translateY(14px); bottom:0; width:min(960px, calc(100% - 24px));
  z-index:30; background:linear-gradient(180deg,rgba(248,249,251,0),rgba(248,249,251,1) 22%,#fff 22%); padding:10px 12px 12px; border-top:1px solid var(--line);
  opacity:0; pointer-events:none; transition:opacity .16s ease, transform .16s ease;
}
.gchat .wizard.is-open{ opacity:1; transform:translateX(-50%) translateY(0); pointer-events:auto; }
.gchat .wiz-step{ background:var(--paper); border:1px solid var(--line); border-radius:12px; padding:12px; box-shadow:var(--shadow-m); }
.gchat .wiz-title{ font-weight:700; color:var(--ink); margin-bottom:10px; font-size:15px; }
.gchat .wiz-row{ display:grid; grid-template-columns:1fr auto; gap:8px; margin-bottom:10px; }
.gchat .grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.gchat .field span{ display:block; font-size:12px; color:var(--muted); margin:0 0 6px; }
.gchat .switch{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:#334155; margin-top:6px; }
.gchat .mini-map{ width:100%; height:260px; border:1px solid var(--line-2); border-radius:12px; overflow:hidden; background:#eef3fb; }

/* Review */
.gchat .review-block{ border:1px solid var(--line); border-radius:14px; background:#fff; padding:12px; box-shadow:var(--shadow-s); }
.gchat .rev-head{ font-weight:800; margin-bottom:8px; }
.gchat .rev-sec{ margin-bottom:10px; }
.gchat .rev-label{ font-weight:700; color:#0b132b; }
.gchat .rev-text{ color:#1f2937; }
.gchat .rev-actions{ display:flex; gap:8px; flex-wrap:wrap; }

/* Título + pill “Résumé” acoplado */
.gchat .rev-title-wrap{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:8px 0 10px;
}
.gchat .rev-title{ margin:0; font-weight:800; font-size:16.5px; color:#0f172a; }

/* Preview (card) */
.gchat .card-bubble{ border:1px solid var(--line); border-radius:14px; background:#fff; padding:12px; box-shadow:var(--shadow-s); }
.gchat .card-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.gchat .card-type{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:800; letter-spacing:.02em; color:#2b2f36; padding:6px 10px; border-radius:999px; background:#f5f7ff; border:1px solid #e3e8ff; }
.gchat .card-excerpt{ margin:0 0 8px; color:#334155; font-size:14px; }
.gchat .card-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.gchat .card-hint{ margin:10px 0 0; font-size:12.5px; color:#64748b; }

/* Chips públicas para card */
.gchat .chip.pub{
  display:inline-flex; align-items:center; gap:6px; padding:2px 8px; margin-right:6px;
  background:#f5f7ff; border:1px solid #e3e8ff; border-radius:999px; font-size:12px; font-weight:700; color:#223;
}

/* Responsive */
@media (min-width:1024px){
  .gchat .chat-shell{ height:clamp(560px, 72vh, 82vh); }
  .gchat .mini-map{ height:300px; }
  .gchat .msg .bubble{ max-width:70%; }
}
@media (max-width:720px){
  .content{padding: 15% 0 0 0; }
  .gchat .grid-2{ grid-template-columns:1fr; }
  /* controles en una sola columna: textarea + 2 botones */
  .gchat .chat-controls{
    grid-template-columns:1fr;
    grid-auto-flow:row;
    gap:8px;
  }
  .gchat .chat-controls .ctrl-btn,
  .gchat .chat-controls .ctrl-chip{
    width:100%;
  }
  .gchat .msg .bubble{ max-width: 85%; font-size: 1.2rem; }
  .gchat .chip{ font-size: 1.1rem; padding: 6px 14px;}
  .gchat .chip-grid{ grid-template-columns:1fr; max-width:720px; gap:6px; }
}

/* Utilidades */
*{ accent-color:var(--pri); }
.hidden{ display:none !important; }
