:root {
  --naranja: #C4520A;
  --azul: #2E5FC2;
  --fondo: #0a0a1a;
  --panel: #14142b;
  --panel2: #1d1d3a;
  --texto: #e8e8f0;
  --tenue: #9a9ab0;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
}

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card {
  width: 100%; max-width: 360px; background: var(--panel);
  border-radius: 16px; padding: 2rem; display: flex; flex-direction: column; gap: .9rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.login-card h1 {
  margin: 0; font-size: 1.6rem;
  background: linear-gradient(90deg, var(--naranja), var(--azul));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-card .sub { margin: 0; color: var(--tenue); font-size: .9rem; }
.login-card label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--tenue); }
.login-card input {
  padding: .7rem; border-radius: 10px; border: 1px solid var(--panel2);
  background: var(--panel2); color: var(--texto); font-size: 1rem;
}
button {
  padding: .7rem 1rem; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(90deg, var(--naranja), var(--azul));
  color: white; font-weight: 600; font-size: 1rem;
}
.error { color: #ff7a7a; font-size: .85rem; margin: 0; }

/* App */
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem;
  background: var(--panel); border-bottom: 1px solid var(--panel2);
}
.brand { font-weight: 700; color: var(--naranja); }
.tabs { display: flex; gap: .4rem; flex: 1; }
.tab {
  padding: .35rem .8rem; border-radius: 999px; text-decoration: none;
  color: var(--tenue); font-size: .85rem;
}
.tab.active { background: var(--panel2); color: var(--texto); }
.tab.disabled { opacity: .4; pointer-events: none; }
.who { font-size: .8rem; color: var(--tenue); }
.who a { color: var(--azul); }

/* Dos paneles lado a lado (apilados en móvil) */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; height: calc(100vh - 52px); background: var(--panel2); }
@media (max-width: 720px) { .duo { grid-template-columns: 1fr; height: auto; } .panel { height: 70vh; } }
.panel { display: flex; flex-direction: column; background: var(--fondo); min-height: 0; }
.panel-haiku .phead { border-top: 3px solid var(--naranja); }
.panel-gemini .phead { border-top: 3px solid var(--azul); }
.phead { padding: .7rem 1rem; background: var(--panel); }
.ptitle { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .4rem; }
.newconv { margin-left: auto; font-size: .72rem; font-weight: 600; padding: .25rem .6rem;
  border: 1px solid var(--panel2); border-radius: 999px; background: var(--panel2);
  color: var(--tenue); cursor: pointer; }
.newconv:hover { color: var(--texto); }
.tag { font-size: .7rem; font-weight: 500; padding: .1rem .5rem; border-radius: 999px; margin-left: .4rem; }
.tag.pago { background: rgba(196,82,10,.25); color: #ffb27a; }
.tag.free { background: rgba(46,95,194,.25); color: #9ab8ff; }
.pbenef { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .78rem; color: var(--tenue); line-height: 1.5; }
.pbenef li { margin: .1rem 0; }
.log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; min-height: 0; }
.msg { display: flex; flex-direction: column; max-width: 85%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.bot, .msg.error { align-self: flex-start; }
.bubble {
  padding: .6rem .9rem; border-radius: 14px; white-space: pre-wrap; line-height: 1.4;
}
.msg.me .bubble { background: var(--azul); color: white; border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: var(--panel2); border-bottom-left-radius: 4px; }
.msg.error .bubble { background: #4a1a1a; color: #ffb0b0; }
.meta { font-size: .65rem; color: var(--tenue); margin-top: .2rem; }

.composer { display: flex; gap: .5rem; padding: .8rem 1rem; border-top: 1px solid var(--panel2); background: var(--panel); }
.composer input {
  flex: 1; padding: .7rem .9rem; border-radius: 999px; border: 1px solid var(--panel2);
  background: var(--panel2); color: var(--texto); font-size: 1rem;
}
