@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

/* Sistema visual tomado de la referencia Genie: canvas claro, superficies
   suaves, lila y verde pastel como lenguaje principal, azul puntual para
   selección y acción. Radios amplios, tipografía Outfit. */

:root {
  --canvas: #FFFFFF;
  --surface: #F3F3F1;
  --surface-2: #EAEAE7;
  --lilac: #DAD4E2;
  --lilac-soft: #EFEBF3;
  --green: #C3DCA8;
  --green-soft: #E6F0DC;
  --blue: #2684FC;
  --blue-soft: #E4EFFE;
  --ink: #1A1A1A;
  --ink-2: #5C5C5C;
  --ink-3: #8E8E8E;
  --line: rgba(21, 21, 21, 0.08);
  --line-2: rgba(21, 21, 21, 0.14);
  --danger: #C4442F;
  --danger-soft: #FBEAE6;

  --r-card: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --r-pill: 999px;

  --rail: 72px;
  --history: 312px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--canvas); color: var(--ink);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: 0 0 auto; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: var(--r-pill); }
::-webkit-scrollbar-track { background: transparent; }

/* ── Estructura ────────────────────────────────────────────────────────── */

/* La app ocupa exactamente la pantalla; nada de scroll lateral. */
.app {
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--rail) var(--history) minmax(0, 1fr);
  height: 100dvh;
  background: var(--surface);
}

/* ── Rail ──────────────────────────────────────────────────────────────── */

.rail {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0 18px; gap: 10px;
  background: var(--surface);
}
.rail-brand {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--ink); color: var(--canvas);
  display: grid; place-items: center;
  font-weight: 600; font-size: 16px; letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.rail-new {
  width: 44px; height: 44px; border-radius: var(--r-pill);
  background: var(--blue); color: #fff;
  display: grid; place-items: center;
  transition: transform 0.15s ease;
  /* Sin esto el tooltip se posiciona contra el body y se va fuera de la
     pantalla, generando scroll horizontal en toda la página. */
  position: relative;
}
.rail-new:hover { transform: scale(1.06); }
.rail-sep { width: 24px; height: 1px; background: var(--line-2); margin: 6px 0; }

.rail-btn {
  width: 44px; height: 44px; border-radius: var(--r-pill);
  display: grid; place-items: center; color: var(--ink-3);
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}
.rail-btn:hover { background: var(--surface-2); color: var(--ink); }
.rail-btn.on { background: var(--canvas); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.rail-spacer { flex: 1; }

.rail-avatar {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--lilac); color: #4A4256;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
}

.tip {
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 400;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.12s ease; z-index: 40;
}
.rail-btn:hover .tip, .rail-new:hover .tip { opacity: 1; }

/* El scrim vive fuera del flujo SIEMPRE, no solo en mobile: como hijo del
   grid ocuparía una columna y desarmaría todo el layout de escritorio. */
.scrim {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(21, 21, 21, 0.24);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.app.drawer .scrim { opacity: 1; pointer-events: auto; }
@media (min-width: 861px) { .scrim { display: none; } }

/* ── Historial ─────────────────────────────────────────────────────────── */

.history {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface);
  padding-right: 8px;
}
.history-head { padding: 22px 16px 12px; }
.history-title { font-size: 19px; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 14px; }

.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--canvas); border-radius: var(--r-pill);
  padding: 0 15px; height: 42px; color: var(--ink-3);
}
.search input {
  border: none; outline: none; background: none; width: 100%;
  font-size: 14px; color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); }

.tabs { display: flex; gap: 4px; padding: 12px 16px 6px; }
.tabs button {
  flex: 1; padding: 8px 10px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  transition: background 0.15s ease, color 0.15s ease;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--canvas); color: var(--ink); }

.history-list { flex: 1; overflow-y: auto; padding: 6px 8px 20px 16px; }
.group-label {
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  padding: 14px 8px 8px;
}

.entry {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: var(--r-md); margin-bottom: 3px;
  text-align: left; transition: background 0.15s ease;
}
.entry:hover { background: var(--surface-2); }
.entry.on { background: var(--canvas); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

.entry-icon {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: grid; place-items: center; overflow: hidden;
  background: var(--lilac-soft); color: #5B5168;
}
.entry-icon.video { background: var(--green-soft); color: #4C6136; }
.entry-icon.image { background: var(--lilac-soft); color: #5B5168; }
.entry-icon.audio { background: var(--blue-soft); color: #1A5FBC; }
.entry-icon.failed { background: var(--danger-soft); color: var(--danger); }
.entry-icon img, .entry-icon video { width: 100%; height: 100%; object-fit: cover; }

.entry-body { min-width: 0; flex: 1; }
.entry-name {
  font-size: 14px; font-weight: 400; color: var(--ink); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.entry-meta {
  font-size: 12px; color: var(--ink-3); margin-top: 3px;
  display: flex; align-items: center; gap: 6px;
}
.entry-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }

.history-empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ── Main ──────────────────────────────────────────────────────────────── */

.main {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--canvas);
  border-radius: var(--r-card) 0 0 var(--r-card);
  margin: 8px 0 8px 0;
  overflow: hidden;
}

.main-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 30px 14px; flex: 0 0 auto;
}
.main-title { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; }
.head-stats { display: flex; align-items: center; gap: 8px; }
.stat {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border-radius: var(--r-pill);
  padding: 7px 14px; font-size: 13px; color: var(--ink-2);
}
.stat b { font-weight: 500; color: var(--ink); }
.stat.warn { background: var(--danger-soft); color: var(--danger); }
.stat.warn b { color: var(--danger); }

.stage { flex: 1; overflow-y: auto; padding: 0 30px; min-height: 0; }

/* Bienvenida */

.welcome { max-width: 720px; margin: 0 auto; padding: 26px 0 10px; text-align: center; }
.welcome-avatar {
  width: 76px; height: 76px; border-radius: var(--r-pill); margin: 0 auto 20px;
  background: var(--lilac); display: grid; place-items: center; color: #4A4256;
}
.welcome h1 {
  font-size: 35px; font-weight: 300; letter-spacing: -0.03em;
  line-height: 1.16; margin: 0 0 8px;
}
.welcome h1 b { font-weight: 600; }
.welcome p { font-size: 15px; color: var(--ink-2); margin: 0 0 30px; font-weight: 300; }

.quick-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; text-align: left;
}
.quick {
  background: var(--surface); border-radius: var(--r-md); padding: 16px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.quick:hover { background: var(--surface-2); transform: translateY(-2px); }
.quick-icon {
  width: 38px; height: 38px; border-radius: 12px; margin-bottom: 12px;
  display: grid; place-items: center;
}
.quick-name { font-size: 14px; font-weight: 500; }
.quick-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }

/* Resultado */

.result { max-width: 860px; margin: 0 auto; padding: 4px 0 16px; }
.result-media {
  border-radius: var(--r-card); overflow: hidden; background: var(--surface);
  margin-bottom: 18px;
}
.result-media video, .result-media img {
  width: 100%; display: block;
  max-height: min(52vh, 520px); object-fit: contain; background: var(--surface);
}
.result-media audio { width: 100%; padding: 22px; }

.result-pending {
  border-radius: var(--r-card); background: var(--lilac-soft);
  padding: 60px 20px; text-align: center; margin-bottom: 18px;
}
.result-pending .bar {
  width: 148px; height: 4px; border-radius: var(--r-pill);
  background: rgba(90,75,110,0.18); margin: 16px auto 0; overflow: hidden;
}
.result-pending .bar i {
  display: block; height: 100%; width: 40%; border-radius: var(--r-pill);
  background: #7E6E92; animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.result-pending .lbl { font-size: 14px; color: #5B5168; font-weight: 500; }

.result-failed {
  border-radius: var(--r-card); background: var(--danger-soft);
  padding: 34px 26px; margin-bottom: 18px; color: var(--danger);
}
.result-failed .lbl { font-weight: 500; margin-bottom: 5px; }
.result-failed p { margin: 0; font-size: 14px; line-height: 1.5; }

.result-prompt {
  font-size: 17px; font-weight: 300; line-height: 1.5;
  letter-spacing: -0.01em; margin: 0 0 16px;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border-radius: var(--r-pill);
  padding: 6px 13px; font-size: 12.5px; color: var(--ink-2);
}
.chip b { font-weight: 500; color: var(--ink); }
.chip.green { background: var(--green-soft); color: #4C6136; }

.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.act {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--r-pill); padding: 10px 17px;
  font-size: 13.5px; font-weight: 500; background: var(--surface); color: var(--ink);
  transition: background 0.15s ease;
}
.act:hover { background: var(--surface-2); }
.act.primary { background: var(--blue); color: #fff; }
.act.primary:hover { background: #1a75ec; }

/* ── Composer ──────────────────────────────────────────────────────────── */

.composer-wrap { flex: 0 0 auto; padding: 10px 30px 22px; }
.composer-inner { max-width: 860px; margin: 0 auto; }

.qa-row { display: flex; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; }
.qa {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border-radius: var(--r-pill);
  padding: 8px 15px; font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease;
}
.qa:hover { background: var(--surface-2); color: var(--ink); }
.qa.on { background: var(--ink); color: #fff; }

.attach {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  background: var(--surface); border-radius: var(--r-md); padding: 10px 12px;
}
.attach-thumb {
  width: 56px; height: 56px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3);
}
.attach-thumb img, .attach-thumb video { width: 100%; height: 100%; object-fit: cover; }
.attach-body { flex: 1; min-width: 0; }
.attach-name { font-size: 13.5px; font-weight: 500; }
.attach-sub { font-size: 12px; color: var(--ink-3); }
.attach-x { width: 30px; height: 30px; border-radius: var(--r-pill); display: grid; place-items: center; color: var(--ink-3); }
.attach-x:hover { background: var(--surface-2); color: var(--ink); }

.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--r-md);
  padding: 20px; text-align: center; color: var(--ink-3); font-size: 13.5px;
  margin-bottom: 12px; transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }

.params { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.param { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
/* Un enum largo —los 30 efectos de Pikaffects— no entra en una fila. Sin esto
   se estiraba hasta 3800px y las últimas opciones quedaban fuera de alcance,
   cortadas contra el borde y sin manera de llegar. */
.param .seg { max-width: 100%; overflow-x: auto; }
.param .seg button { flex: 0 0 auto; }
.param-label { font-size: 12px; color: var(--ink-3); margin-right: 3px; }
.seg { display: inline-flex; background: var(--surface); border-radius: var(--r-pill); padding: 3px; }
.seg button {
  padding: 5px 12px; border-radius: var(--r-pill); font-size: 12.5px;
  font-weight: 500; color: var(--ink-3); transition: background 0.15s ease, color 0.15s ease;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--canvas); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

.param input[type=number], .param input[type=text] {
  background: var(--surface); border: none; border-radius: var(--r-pill);
  padding: 7px 13px; font-size: 12.5px; width: 108px; outline: none;
}
.param input:focus { box-shadow: 0 0 0 2px var(--blue-soft); }

.composer {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--surface); border-radius: var(--r-card);
  padding: 10px 10px 10px 16px;
  transition: box-shadow 0.15s ease;
}
.composer:focus-within { box-shadow: 0 0 0 2px var(--blue-soft); }

.model-chip {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  background: var(--canvas); border-radius: var(--r-pill);
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  margin-bottom: 2px; max-width: 210px;
}
.model-chip:hover { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.model-chip .mc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.composer textarea {
  flex: 1; border: none; outline: none; background: none; resize: none;
  font-size: 15px; line-height: 1.5; padding: 9px 0; max-height: 150px;
  font-weight: 300;
}
.composer textarea::placeholder { color: var(--ink-3); }

.send {
  width: 44px; height: 44px; border-radius: var(--r-pill); flex: 0 0 auto;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.send:hover:not(:disabled) { transform: scale(1.06); }
.send:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
.send.wide {
  width: auto; padding: 0 20px; font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}

.composer-note {
  font-size: 12.5px; color: var(--ink-3); margin-top: 9px;
  padding: 0 6px; text-align: center;
}
.composer-note.alert { color: var(--danger); }

/* ── Modal ─────────────────────────────────────────────────────────────── */

.overlay {
  position: fixed; inset: 0; background: rgba(21,21,21,0.28);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 9vh; z-index: 60;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--canvas); border-radius: var(--r-card);
  width: min(700px, 92vw); max-height: 74vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.14);
}
.modal-head { padding: 16px 18px 12px; }
.modal-list { overflow-y: auto; padding: 4px 10px 14px; }

.op {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 11px 12px; border-radius: var(--r-md); text-align: left;
  transition: background 0.15s ease;
}
.op:hover { background: var(--surface); }
.op-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.op-body { flex: 1; min-width: 0; }
.op-name { font-size: 14px; font-weight: 500; }
.op-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.op-price { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; font-weight: 500; }

/* ── Login ─────────────────────────────────────────────────────────────── */

.login-wrap {
  display: grid; place-items: center; min-height: 100dvh; background: var(--surface);
}
.login {
  background: var(--canvas); border-radius: var(--r-card);
  padding: 40px 36px; width: min(392px, 92vw);
}
.login-mark {
  width: 52px; height: 52px; border-radius: 17px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 20px;
  margin-bottom: 22px; letter-spacing: -0.02em;
}
.login h1 { font-size: 26px; font-weight: 300; letter-spacing: -0.02em; margin: 0 0 4px; }
.login h1 b { font-weight: 600; }
.login .sub { color: var(--ink-3); font-size: 14px; margin: 0 0 26px; font-weight: 300; }
.login label { display: block; font-size: 12.5px; color: var(--ink-2); margin: 0 0 6px; }
.login .fld { margin-bottom: 14px; }
.login input {
  width: 100%; background: var(--surface); border: none; outline: none;
  border-radius: var(--r-pill); padding: 13px 18px; font-size: 14.5px;
}
.login input:focus { box-shadow: 0 0 0 2px var(--blue-soft); }
.login button[type=submit] {
  width: 100%; margin-top: 10px; background: var(--ink); color: #fff;
  border-radius: var(--r-pill); padding: 14px; font-size: 14.5px; font-weight: 500;
  transition: transform 0.15s ease;
}
.login button[type=submit]:hover { transform: translateY(-1px); }

.alert {
  background: var(--danger-soft); color: var(--danger);
  border-radius: var(--r-md); padding: 11px 15px; font-size: 13.5px;
  margin-bottom: 18px; line-height: 1.45;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  :root { --history: 268px; }
}

@media (max-width: 860px) {
  :root { --rail: 56px; }

  .app { grid-template-columns: var(--rail) minmax(0, 1fr); }

  /* El drawer arranca desplazado su propio ancho MÁS el rail; si no, asoma
     una franja por el borde izquierdo. */
  .history {
    position: fixed; inset: 0 auto 0 var(--rail); width: 292px; z-index: 50;
    transform: translateX(calc(-100% - var(--rail)));
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
    padding-right: 0;
  }
  .app.drawer .history { transform: none; }

  .rail { padding-top: 14px; gap: 8px; }
  .rail-brand { width: 34px; height: 34px; border-radius: 11px; font-size: 14px; margin-bottom: 8px; }
  .rail-new, .rail-btn { width: 38px; height: 38px; }
  .rail-avatar { width: 34px; height: 34px; font-size: 12px; }
  .tip { display: none; }

  .main { border-radius: var(--r-card) var(--r-card) 0 0; margin: 8px 8px 0; }
  .stage, .composer-wrap, .main-head { padding-left: 16px; padding-right: 16px; }
  .main-head { padding-top: 16px; gap: 10px; }
  .main-title {
    font-size: 15px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; min-width: 0;
  }
  .head-stats { flex: 0 0 auto; }
  .stat { padding: 6px 11px; font-size: 12px; }
  .head-stats .stat.hide-sm { display: none; }

  .welcome { padding-top: 12px; }
  .welcome h1 { font-size: 27px; }
  .welcome-avatar { width: 62px; height: 62px; margin-bottom: 14px; }
  .welcome p { margin-bottom: 22px; font-size: 14px; }

  .composer { border-radius: var(--r-md); padding: 8px 8px 8px 12px; }
  .params { gap: 6px; }
  .result-media video, .result-media img { max-height: 44vh; }
}

@media (max-width: 640px) {
  .head-stats .stat.hide-md { display: none; }
}

@media (max-width: 560px) {
  .quick-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  /* El nombre del modelo pasa a la cabecera: en el chip solo queda el icono. */
  .model-chip { max-width: none; padding: 9px; }
  .model-chip .mc-name { display: none; }
  .composer textarea { font-size: 16px; }
  .result-actions .act { flex: 1 1 auto; justify-content: center; }
}

.more {
  border-radius: var(--r-pill); padding: 7px 14px; font-size: 12.5px;
  font-weight: 500; color: var(--ink-3); background: transparent;
  border: 1px solid var(--line-2); transition: color 0.15s ease, border-color 0.15s ease;
}
.more:hover { color: var(--ink); border-color: var(--ink-3); }

/* ── Configuración ─────────────────────────────────────────────────────── */

.settings-wrap { min-height: 100dvh; background: var(--surface); padding: 40px 20px; }
.settings { max-width: 720px; margin: 0 auto; }

.settings-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.settings-head h1 { font-size: 26px; font-weight: 300; letter-spacing: -0.02em; margin: 0; }

.card {
  background: var(--canvas); border-radius: var(--r-card);
  padding: 26px 28px; margin-bottom: 16px;
}
.card h2 { font-size: 17px; font-weight: 500; margin: 0 0 6px; letter-spacing: -0.01em; }
.card .help { font-size: 13px; color: var(--ink-3); margin: 0 0 18px; line-height: 1.5; }
.card .help:last-child { margin: 6px 0 0; }
.card a { color: var(--blue); }

.card label {
  display: block; font-size: 12.5px; color: var(--ink-2);
  margin: 0 0 6px; font-weight: 500;
}
.card input {
  width: 100%; background: var(--surface); border: none; outline: none;
  border-radius: var(--r-pill); padding: 13px 18px; font-size: 14.5px;
}
.card input:focus { box-shadow: 0 0 0 2px var(--blue-soft); }

.status {
  border-radius: var(--r-md); padding: 12px 16px;
  font-size: 13.5px; font-weight: 500; margin-bottom: 20px;
}
.status.on  { background: var(--green-soft); color: #3F5730; }
.status.off { background: var(--danger-soft); color: var(--danger); }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.grid3 .help { margin: 6px 0 0; font-size: 12px; }

.ok-box {
  background: var(--green-soft); color: #3F5730;
  border-radius: var(--r-md); padding: 12px 16px;
  font-size: 13.5px; margin-bottom: 18px; line-height: 1.45;
}

.save {
  background: var(--ink); color: #fff; border-radius: var(--r-pill);
  padding: 14px 30px; font-size: 14.5px; font-weight: 500;
  transition: transform 0.15s ease;
}
.save:hover { transform: translateY(-1px); }

.foot { font-size: 12.5px; color: var(--ink-3); margin: 20px 2px 0; line-height: 1.6; }
.foot code {
  background: var(--surface-2); border-radius: 6px;
  padding: 2px 6px; font-size: 12px; font-family: ui-monospace, monospace;
}

/* Marca de proveedor: color propio + monograma. */
.vmark {
  border-radius: 11px; display: grid; place-items: center;
  font-weight: 600; letter-spacing: -0.02em; flex: 0 0 auto;
  font-family: 'Outfit', sans-serif; overflow: hidden;
}
/* Con logo: fondo claro y un filete, porque casi todos son monocromos negros. */
.vmark-logo {
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(20, 20, 18, 0.08);
}
.vmark-logo img { width: 58%; height: 58%; object-fit: contain; }
/* El logo ya trae su propio fondo: llena el chip entero. */
.vmark-fill img { width: 100%; height: 100%; object-fit: cover; }

/* Salida del chat, al pie del selector de modelos de texto. */
.op-exit { margin-top: 6px; border-top: 1px solid rgba(20, 20, 18, 0.07); }
.op-exit .op-ico {
  width: 38px; height: 38px; display: grid; place-items: center;
  color: var(--ink-3); flex: 0 0 auto;
}

/* Selector de modelos */
.picker-head { padding: 14px 16px 10px; }
.sorts { display: flex; gap: 4px; margin-top: 12px; }
.sorts button {
  padding: 7px 13px; border-radius: var(--r-pill); font-size: 12.5px;
  font-weight: 500; color: var(--ink-3); background: var(--surface);
  transition: background 0.15s ease, color 0.15s ease;
}
.sorts button:hover { color: var(--ink); }
.sorts button.on { background: var(--ink); color: #fff; }

.op-right { text-align: right; flex: 0 0 auto; }
.op-price { font-size: 13px; color: var(--ink); font-weight: 500; white-space: nowrap; }
.op-price.var { color: var(--ink-3); font-weight: 400; }
.op-base { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; }

.rec {
  display: inline-block; background: var(--green-soft); color: #46603A;
  border-radius: var(--r-pill); padding: 2px 8px;
  font-size: 10.5px; font-weight: 600; margin-left: 7px; vertical-align: 1px;
}
.cheap {
  display: inline-block; background: var(--blue-soft); color: #1A5FBC;
  border-radius: var(--r-pill); padding: 2px 8px;
  font-size: 10.5px; font-weight: 600; margin-left: 7px; vertical-align: 1px;
}
.picker-note {
  font-size: 11.5px; color: var(--ink-3); padding: 10px 18px 4px; line-height: 1.5;
}

/* ── Chat de texto ─────────────────────────────────────────────────────── */

.thread { max-width: 760px; margin: 0 auto; padding: 10px 0 20px; }

.msg { margin-bottom: 16px; display: flex; }
.msg.user { justify-content: flex-end; }
.msg-body {
  border-radius: var(--r-md); padding: 12px 16px;
  font-size: 15px; line-height: 1.6; white-space: pre-wrap;
  max-width: 82%; word-break: break-word;
}
.msg.user .msg-body { background: var(--blue-soft); color: #143A6B; border-bottom-right-radius: 8px; }
.msg.assistant .msg-body { background: var(--surface); border-bottom-left-radius: 8px; font-weight: 300; }
.msg-cost { font-size: 11px; color: var(--ink-3); align-self: flex-end; margin-left: 8px; }

.typing { display: flex; gap: 5px; align-items: center; padding: 16px; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%,60%,100% { opacity: 0.25; } 30% { opacity: 1; } }
