/* ───────────────────────────────────────────────────────────
   oiu.im — hoja de estilo
   Paleta: crema / gris / negro. Acento único: oliva para "en línea".
   Display: Fraunces · UI/Body: Inter
   ─────────────────────────────────────────────────────────── */

:root {
  /* Crema, gris, negro */
  --cream:        #F2EEE6;
  --cream-deep:   #E7E1D5;
  --paper:        #FBF9F4;
  --gray:         #A8A29A;
  --gray-soft:    #C9C3B8;
  --ink:          #3A3835;
  --ink-strong:   #141312;
  /* Acento único */
  --olive:        #6B7A4F;
  --olive-soft:   #8A9A6B;
  /* Estados (derivados, sin romper la paleta salvo "online") */
  --st-online:    var(--olive);
  --st-away:      #B8AE97;   /* gris cálido */
  --st-busy:      #4A4844;   /* casi negro */
  --st-offline:   #C9C3B8;   /* gris vacío */

  --radius:       14px;
  --radius-sm:    9px;
  --shadow:       0 1px 2px rgba(20,19,18,.05), 0 8px 24px rgba(20,19,18,.07);
  --shadow-soft:  0 1px 3px rgba(20,19,18,.06);

  --font-display: "Fraunces", Georgia, serif;
  --font-ui:      "Inter", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

/* ─── Marca ─────────────────────────────────────────────── */
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}

/* ═══════════════════════════════════════════════════════════
   PANTALLA DE ACCESO (login / registro)
   ═══════════════════════════════════════════════════════════ */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--paper), transparent 60%),
    var(--cream);
}
.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
}
.gate-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink-strong);
  text-align: center;
}
.gate-logo .dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--olive);
  margin-left: 3px;
  vertical-align: baseline;
  animation: breathe 2.6s ease-in-out infinite;
}
.gate-tagline {
  text-align: center;
  color: var(--gray);
  font-size: 13.5px;
  margin: 10px 0 30px;
  letter-spacing: 0.01em;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink-strong);
  background: var(--cream);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color .15s, background .15s;
}
.input:focus {
  outline: none;
  border-color: var(--olive-soft);
  background: var(--paper);
}
.input-affix {
  display: flex;
  align-items: center;
  background: var(--cream);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.input-affix:focus-within { border-color: var(--olive-soft); }
.input-affix .input { border: none; background: transparent; }
.input-affix .suffix {
  padding: 0 13px;
  color: var(--gray);
  font-size: 14px;
  white-space: nowrap;
  border-left: 1px solid var(--cream-deep);
  align-self: stretch;
  display: flex;
  align-items: center;
}
.btn {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  color: var(--paper);
  background: var(--ink-strong);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: transform .08s, background .15s;
}
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.gate-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--gray);
}
.gate-switch a { color: var(--ink-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.gate-error {
  background: #FBEDE9;
  border: 1px solid #E8C4B8;
  color: #7A3B28;
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 16px;
}
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   APP — layout principal
   ═══════════════════════════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--cream-deep);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.me {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--cream-deep);
}
.me-top { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--cream-deep);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink-strong);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-info { min-width: 0; flex: 1; }
.me-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.me-addr { font-size: 12px; color: var(--gray); }
.me-pm {
  margin-top: 10px;
  width: 100%;
  font-family: var(--font-ui);
  font-size: 13px;
  font-style: italic;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  transition: border-color .15s, background .15s;
}
.me-pm:focus { outline: none; border-color: var(--cream-deep); background: var(--paper); }

/* Selector de estado propio */
.status-pick { display: flex; gap: 6px; margin-top: 12px; }
.status-opt {
  flex: 1;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--gray);
  background: var(--cream);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 4px;
  cursor: pointer;
  text-align: center;
  transition: all .12s;
}
.status-opt.active { color: var(--ink-strong); border-color: var(--cream-deep); background: var(--paper); }
.status-opt .pip {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}

/* Buscar / agregar contacto */
.add-bar { padding: 14px 16px; border-bottom: 1px solid var(--cream-deep); }
.add-row { display: flex; gap: 7px; }
.add-row .input-affix { flex: 1; }
.add-row .input { padding: 9px 11px; font-size: 14px; }
.add-row .suffix { font-size: 13px; padding: 0 10px; }
.btn-add {
  background: var(--olive);
  color: var(--paper);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-add:hover { background: #5A6842; }

/* Solicitudes pendientes */
.requests { padding: 6px 16px 0; }
.request-card {
  background: var(--cream);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.request-card b { color: var(--ink-strong); }
.request-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn-mini {
  flex: 1; font-size: 12.5px; font-weight: 500;
  border-radius: 7px; padding: 6px; cursor: pointer; border: none;
}
.btn-accept { background: var(--olive); color: var(--paper); }
.btn-decline { background: var(--cream-deep); color: var(--ink); }

/* Lista de contactos */
.contacts { flex: 1; overflow-y: auto; padding: 8px 0; }
.group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray);
  padding: 12px 20px 6px;
}
.contact {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .12s;
}
.contact:hover { background: var(--cream); }
.contact.active { background: var(--cream); border-left-color: var(--ink-strong); }
.contact.is-offline { opacity: .55; }
.pip {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  position: relative;
}
.pip.online  { background: var(--st-online); }
.pip.away    { background: var(--st-away); }
.pip.busy    { background: var(--st-busy); }
.pip.offline { background: transparent; border: 1.5px solid var(--st-offline); }
/* el pulso vivo solo para "en línea" */
.pip.online::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%; border: 1.5px solid var(--olive);
  opacity: 0; animation: pulse 2.4s ease-out infinite;
}
.contact-body { min-width: 0; flex: 1; }
.contact-name {
  font-weight: 500; font-size: 14.5px; color: var(--ink-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.contact-pm {
  font-size: 12.5px; font-style: italic; color: var(--gray);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.contact-badge {
  background: var(--olive); color: var(--paper);
  font-size: 11px; font-weight: 600;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: grid; place-items: center; padding: 0 5px;
}

/* ─── Panel de conversación ─────────────────────────────── */
.convo {
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--cream);
}
.convo-empty {
  flex: 1; display: grid; place-items: center; text-align: center; color: var(--gray);
}
.convo-empty .big {
  font-family: var(--font-display);
  font-size: 34px; color: var(--gray-soft);
  letter-spacing: -0.02em; margin-bottom: 8px;
}
.convo-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  background: var(--paper);
  border-bottom: 1px solid var(--cream-deep);
}
.convo-head .contact-name { font-size: 16px; }
.convo-head .pip { width: 8px; height: 8px; }
.convo-status { font-size: 12.5px; color: var(--gray); }
.nudge-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--cream-deep);
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 500; color: var(--ink);
  cursor: pointer; transition: all .12s;
}
.nudge-btn:hover { background: var(--cream); border-color: var(--gray-soft); }

.messages {
  flex: 1; overflow-y: auto;
  padding: 22px;
  display: flex; flex-direction: column; gap: 4px;
}
.msg { max-width: 70%; }
.msg.them { align-self: flex-start; }
.msg.me   { align-self: flex-end; }
.bubble {
  padding: 9px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  word-wrap: break-word;
}
.msg.them .bubble {
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  color: var(--ink-strong);
  border-bottom-left-radius: 5px;
}
.msg.me .bubble {
  background: var(--ink-strong);
  color: var(--paper);
  border-bottom-right-radius: 5px;
}
.msg-meta { font-size: 11px; color: var(--gray); margin: 2px 4px 8px; }
.msg.me .msg-meta { text-align: right; }
.msg.system {
  align-self: center;
  font-size: 12px; font-style: italic; color: var(--gray);
  padding: 4px 0;
}

.typing-row { padding: 0 22px 8px; height: 20px; }
.typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.typing-dots span {
  width: 5px; height: 5px; border-radius: 50%; background: var(--gray);
  animation: typing 1.3s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }

.composer {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 14px 22px 18px;
  background: var(--paper);
  border-top: 1px solid var(--cream-deep);
}
.composer textarea {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--ink-strong);
  background: var(--cream);
  border: 1px solid var(--cream-deep);
  border-radius: 12px;
  padding: 11px 14px;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
  transition: border-color .15s;
}
.composer textarea:focus { outline: none; border-color: var(--olive-soft); }
.btn-send {
  background: var(--ink-strong); color: var(--paper);
  border: none; border-radius: 12px;
  padding: 11px 20px; font-size: 14.5px; font-weight: 500;
  cursor: pointer; transition: background .15s;
}
.btn-send:hover { background: #000; }

/* ─── Zumbido (nudge) ───────────────────────────────────── */
.nudging { animation: nudge 0.6s linear; }

/* ─── Animaciones ───────────────────────────────────────── */
@keyframes breathe {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(1.15); opacity: .75; }
}
@keyframes pulse {
  0%   { transform: scale(0.8); opacity: .7; }
  100% { transform: scale(2.1); opacity: 0; }
}
@keyframes typing {
  0%,60%,100% { transform: translateY(0); opacity: .4; }
  30%         { transform: translateY(-4px); opacity: 1; }
}
@keyframes nudge {
  0%,100% { transform: translate(0,0) rotate(0); }
  3%  { transform: translate(-14px,-9px) rotate(-1.5deg); }
  6%  { transform: translate(15px,8px) rotate(1.5deg); }
  9%  { transform: translate(-15px,9px) rotate(-1.4deg); }
  12% { transform: translate(14px,-8px) rotate(1.4deg); }
  16% { transform: translate(-14px,8px) rotate(-1.3deg); }
  20% { transform: translate(14px,-7px) rotate(1.3deg); }
  24% { transform: translate(-13px,7px) rotate(-1.2deg); }
  28% { transform: translate(13px,-7px) rotate(1.2deg); }
  32% { transform: translate(-13px,6px) rotate(-1.1deg); }
  36% { transform: translate(12px,-6px) rotate(1.1deg); }
  40% { transform: translate(-12px,6px) rotate(-1deg); }
  44% { transform: translate(11px,-5px) rotate(1deg); }
  48% { transform: translate(-11px,5px) rotate(-0.9deg); }
  52% { transform: translate(10px,-5px) rotate(0.9deg); }
  56% { transform: translate(-9px,4px) rotate(-0.8deg); }
  60% { transform: translate(9px,-4px) rotate(0.8deg); }
  64% { transform: translate(-8px,4px) rotate(-0.6deg); }
  68% { transform: translate(7px,-3px) rotate(0.6deg); }
  72% { transform: translate(-6px,3px) rotate(-0.5deg); }
  76% { transform: translate(6px,-3px) rotate(0.5deg); }
  80% { transform: translate(-5px,2px) rotate(-0.3deg); }
  84% { transform: translate(4px,-2px) rotate(0.3deg); }
  88% { transform: translate(-3px,2px); }
  92% { transform: translate(2px,-1px); }
  96% { transform: translate(-1px,1px); }
}
.chat-window.nudging { animation: nudge 2.5s cubic-bezier(.36,.07,.19,.97); }

@media (prefers-reduced-motion: reduce) {
  .pip.online::after, .gate-logo .dot { animation: none; }
  .nudging { animation: none; }
}

/* ─── Responsive (móvil) ────────────────────────────────── */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .app.viewing-convo .sidebar { display: none; }
  .app:not(.viewing-convo) .convo { display: none; }
  .back-btn { display: inline-flex !important; }
}
.back-btn {
  display: none;
  background: transparent; border: none; cursor: pointer;
  font-size: 20px; color: var(--ink); margin-right: 4px;
}

/* Scrollbars discretas */
.contacts::-webkit-scrollbar, .messages::-webkit-scrollbar { width: 8px; }
.contacts::-webkit-scrollbar-thumb, .messages::-webkit-scrollbar-thumb {
  background: var(--cream-deep); border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   EMOTICONES
   ═══════════════════════════════════════════════════════════ */
.emo {
  display: inline-block;
  width: 1.2em; height: 1.2em;
  vertical-align: -0.22em;
  margin: 0 1px;
}

/* Botón y panel del selector de emoticones */
.composer-tools { display: flex; gap: 6px; align-items: center; }
.tool-btn {
  background: transparent;
  border: 1px solid var(--cream-deep);
  border-radius: 10px;
  width: 38px; height: 38px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.tool-btn:hover { background: var(--cream); border-color: var(--gray-soft); }
.tool-btn svg { width: 20px; height: 20px; }

.picker {
  position: absolute;
  bottom: 76px;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 40;
}
.wink-picker {
  left: 12px; right: 12px;
  max-height: 320px;
  display: flex; flex-direction: column;
}
.picker-title {
  font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--gray); margin-bottom: 8px;
  flex-shrink: 0;
}
.emo-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.emo-grid button {
  background: transparent; border: none; border-radius: 8px;
  padding: 6px; cursor: pointer; transition: background .1s;
  display: grid; place-items: center;
}
.emo-grid button:hover { background: var(--cream); }
.emo-grid button svg { width: 24px; height: 24px; }

.wink-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  overflow-y: auto;
  padding-right: 4px;
}
.wink-grid button {
  display: flex; align-items: center; gap: 9px;
  text-align: left; background: transparent; border: none;
  border-radius: 9px; padding: 8px 10px; cursor: pointer;
  font-family: var(--font-ui); font-size: 13.5px; color: var(--ink);
  transition: background .1s;
}
.wink-grid button:hover { background: var(--cream); color: var(--ink-strong); }
.wink-ico { font-size: 20px; line-height: 1; flex-shrink: 0; }
.wink-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* scrollbar discreto del picker */
.wink-grid::-webkit-scrollbar { width: 7px; }
.wink-grid::-webkit-scrollbar-thumb { background: var(--cream-deep); border-radius: 4px; }
.wink-grid::-webkit-scrollbar-track { background: transparent; }

/* Mensaje de wink en el hilo */
.msg.wink-note {
  align-self: center;
  font-size: 12.5px; font-style: italic; color: var(--olive);
  padding: 4px 0;
}

/* ═══════════════════════════════════════════════════════════
   WINKS — overlays a pantalla completa
   ═══════════════════════════════════════════════════════════ */
.wink-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.wink-static {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display); font-size: 28px; color: var(--ink-strong);
  background: var(--paper); padding: 16px 28px; border-radius: 14px;
  box-shadow: var(--shadow); border: 1px solid var(--cream-deep);
}
.wink-heart {
  position: absolute; bottom: -40px; color: #C0392B;
  animation: wink-rise 3.6s ease-in forwards;
}
.wink-confetti {
  position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px;
  animation: wink-fall 3.4s ease-in forwards;
}
.wink-sparkle {
  position: absolute; width: 10px; height: 10px;
  background: radial-gradient(circle, #fff, var(--olive-soft));
  border-radius: 50%;
  animation: wink-twinkle 2.4s ease-in-out forwards;
}
.wink-flame {
  position: absolute; bottom: -30px;
  font-size: 90px;
  animation: wink-rise 3.4s ease-out forwards;
}
.wink-rose {
  position: absolute; bottom: -40px;
  font-size: 72px;
  animation: wink-rise 3.6s ease-out forwards;
}
/* Generadores reutilizables (emoji) */
.wink-floater { position: absolute; bottom: -60px; animation: wink-rise 3.6s ease-in forwards; }
.wink-faller  { position: absolute; top: -50px; animation: wink-emoji-fall 3.6s linear forwards; }
.wink-twinkler{ position: absolute; animation: wink-twinkle 2.6s ease-in-out forwards; }
.wink-pulser  { position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); animation: wink-pop 3.6s ease-out forwards; }
@keyframes wink-emoji-fall {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(112vh) rotate(160deg); opacity: .35; }
}
@keyframes wink-rise {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-105vh) scale(1.1); opacity: 0; }
}
@keyframes wink-fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: .2; }
}
@keyframes wink-twinkle {
  0%,100% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.4); opacity: 1; }
}
@keyframes wink-pop {
  0% { transform: translate(-50%,-50%) scale(0); opacity: 0; }
  20% { transform: translate(-50%,-50%) scale(1.3); opacity: 1; }
  80% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1.1); opacity: 0; }
}
@keyframes wink-bloom {
  0% { transform: translate(-50%,-50%) scale(0) rotate(-40deg); opacity: 0; }
  30% { transform: translate(-50%,-50%) scale(1.2) rotate(0); opacity: 1; }
  80% { transform: translate(-50%,-50%) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1) rotate(0); opacity: 0; }
}

/* ── Winks nuevos ── */
.wink-kiss { position: absolute; bottom: -50px; animation: wink-rise 3.4s ease-in forwards; }
.wink-star { position: absolute; color: #D9A441; animation: wink-twinkle 2.6s ease-in-out forwards; }
.wink-party { position: absolute; bottom: -50px; animation: wink-rise 3.6s ease-in forwards; }
.wink-snow { position: absolute; top: -30px; color: #fff;
  text-shadow: 0 0 3px rgba(120,140,160,.5); animation: wink-snowfall 3.8s linear forwards; }
.wink-drop { position: absolute; top: -30px; width: 2px;
  background: linear-gradient(transparent, #6FA8DC); animation: wink-droplet 2.2s linear forwards; }
.wink-bubble { position: absolute; bottom: -60px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.85), rgba(111,168,220,.25));
  border: 1px solid rgba(111,168,220,.4); animation: wink-floatup 3.8s ease-in forwards; }
.wink-flash { position: absolute; inset: 0; background: #fff; opacity: 0;
  animation: wink-strobe 3s ease-out forwards; }
.wink-bolt { position: absolute; top: 8%; font-size: 90px; color: #F2D044;
  opacity: 0; animation: wink-zap 3s ease-out forwards; }

@keyframes wink-snowfall {
  0% { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(108vh) translateX(40px) rotate(220deg); opacity: .4; }
}
@keyframes wink-droplet {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(108vh); opacity: .3; }
}
@keyframes wink-floatup {
  0% { transform: translateY(0) scale(.4); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translateY(-110vh) scale(1); opacity: 0; }
}
@keyframes wink-strobe {
  0%,100% { opacity: 0; }
  6% { opacity: .85; } 10% { opacity: 0; }
  22% { opacity: .7; } 26% { opacity: 0; }
  46% { opacity: .6; } 50% { opacity: 0; }
}
@keyframes wink-zap {
  0%,100% { opacity: 0; transform: scale(.8); }
  8% { opacity: 1; transform: scale(1.15); }
  14% { opacity: 0; }
  30% { opacity: 1; transform: scale(1.05); }
  36% { opacity: 0; }
  52% { opacity: 1; }
  58% { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════
   AVATARES con foto
   ═══════════════════════════════════════════════════════════ */
.contact-avatar {
  position: relative;
  width: 38px; height: 38px;
  flex-shrink: 0;
}
.contact-avatar .avatar,
.contact-avatar > img {
  width: 38px; height: 38px;
  border-radius: 11px;
  object-fit: cover;
  background: var(--cream-deep);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--ink-strong);
}
/* pip posicionado sobre la esquina del avatar */
.contact-avatar .pip {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 12px; height: 12px;
  border: 2.5px solid var(--paper);
  box-sizing: content-box;
}
.contact:hover .contact-avatar .pip,
.contact.active .contact-avatar .pip { border-color: var(--cream); }

.convo-head .contact-avatar { width: 38px; height: 38px; }
.convo-head .contact-avatar .pip { border-color: var(--paper); }

/* Avatar propio editable */
.avatar-edit { position: relative; cursor: pointer; }
.avatar-edit img { width: 100%; height: 100%; object-fit: cover; }
.avatar-cam {
  position: absolute; bottom: -3px; right: -3px;
  width: 18px; height: 18px;
  background: var(--ink-strong); color: var(--paper);
  border-radius: 50%; border: 2px solid var(--paper);
  font-size: 11px; line-height: 14px; text-align: center;
  opacity: 0; transition: opacity .15s;
}
.avatar-edit:hover .avatar-cam { opacity: 1; }

/* Acceso al panel de admin desde la barra lateral */
.admin-access {
  display: block; margin-top: 12px;
  font-size: 12.5px; font-weight: 500; color: var(--gray);
  text-decoration: none; text-align: center;
  padding: 8px; border-radius: 8px; border: 1px solid var(--cream-deep);
  transition: all .12s;
}
.admin-access:hover { color: var(--ink-strong); background: var(--cream); }

/* ═══════════════════════════════════════════════════════════
   v3 — estados extra, now playing, herramientas
   ═══════════════════════════════════════════════════════════ */
.pip.brb   { background: #B8AE97; }
.pip.lunch { background: #C4A86B; }
.status-opt .pip.brb   { background: #B8AE97; }
.status-opt .pip.lunch { background: #C4A86B; }

.me-np {
  margin-top: 6px;
  font-style: normal;
  color: var(--olive);
}
.me-np::placeholder { color: var(--gray); font-style: italic; }

.np { color: var(--olive); font-style: normal; }

.me-tools { display: flex; gap: 6px; margin-top: 12px; }
.me-tool {
  flex: 1; background: var(--cream); border: 1px solid transparent;
  border-radius: 8px; padding: 7px; cursor: pointer; font-size: 15px;
  transition: all .12s; opacity: .55;
}
.me-tool:hover { opacity: 1; background: var(--paper); border-color: var(--cream-deep); }
.me-tool.on { opacity: 1; background: var(--paper); border-color: var(--olive-soft); }

/* Estrella favorito */
.fav-star { color: #C4A04B; font-size: 12px; }

/* Botón de menú contextual del contacto */
.contact { position: relative; }
.contact-menu-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--gray); font-size: 18px; line-height: 1;
  padding: 4px 8px; border-radius: 6px; opacity: 0;
  transition: opacity .12s, background .12s;
}
.contact:hover .contact-menu-btn { opacity: 1; }
.contact-menu-btn:hover { background: var(--cream-deep); color: var(--ink-strong); }

.contact-menu {
  min-width: 190px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  z-index: 80;
}
.contact-menu button {
  text-align: left; background: transparent; border: none;
  border-radius: 7px; padding: 9px 12px; cursor: pointer;
  font-family: var(--font-ui); font-size: 13.5px; color: var(--ink);
  transition: background .1s;
}
.contact-menu button:hover { background: var(--cream); }
.contact-menu button.danger { color: #8B2A22; }

/* Iconos del encabezado de conversación */
.head-icon {
  background: transparent; border: 1px solid transparent;
  border-radius: 8px; padding: 6px 9px; cursor: pointer;
  font-size: 15px; opacity: .6; transition: all .12s;
}
.head-icon:hover { opacity: 1; background: var(--cream); border-color: var(--cream-deep); }

/* ─── Barra de búsqueda ───────────────────────────────────── */
.search-bar {
  padding: 12px 22px; background: var(--paper);
  border-bottom: 1px solid var(--cream-deep);
}
.search-bar .input { font-size: 14px; }
.search-results { margin-top: 8px; max-height: 200px; overflow-y: auto; }
.search-hit {
  padding: 8px 10px; border-radius: 8px; font-size: 13.5px;
  color: var(--ink); cursor: default; border-bottom: 1px solid var(--cream);
}
.search-who { font-weight: 600; color: var(--olive); }
.search-date { color: var(--gray); font-size: 12px; float: right; }
.search-empty { color: var(--gray); font-size: 13px; padding: 12px; text-align: center; }

/* ─── Mensajes de archivo ─────────────────────────────────── */
.file-bubble { padding: 8px !important; }
.file-thumb {
  display: block; max-width: 220px; max-height: 200px;
  border-radius: 10px; margin-bottom: 6px;
}
.file-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
.file-ico { font-size: 20px; }
.file-meta { font-size: 13px; line-height: 1.3; }
.file-size { color: var(--gray); font-size: 11.5px; }
.msg.me .file-size { color: var(--gray-soft); }

/* Remitente en salas grupales */
.room-sender {
  font-size: 11.5px; font-weight: 600; color: var(--olive);
  margin: 0 4px 2px;
}

/* ═══════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════ */
.toast-layer {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9998; max-width: 340px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px;
  transform: translateX(120%); opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--cream-deep); overflow: hidden;
  display: grid; place-items: center;
}
.toast-icon img { width: 100%; height: 100%; object-fit: cover; }
.toast-mark { font-family: var(--font-display); font-weight: 600; color: var(--ink-strong); font-size: 14px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 14px; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-text { font-size: 12.5px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 20px; color: var(--gray); line-height: 1; padding: 0 2px;
}
.toast-close:hover { color: var(--ink-strong); }

/* ═══════════════════════════════════════════════════════════
   MODALES (salas, bloqueados)
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(20,19,18,.32);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 420px; max-height: 80vh;
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--cream-deep);
}
.modal-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink-strong); }
.modal-x { background: transparent; border: none; cursor: pointer; font-size: 24px; color: var(--gray); line-height: 1; }
.modal-x:hover { color: var(--ink-strong); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--cream);
}
.modal-row .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.modal-divider {
  margin: 18px 0 12px; font-size: 11px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--gray);
}
.room-row { cursor: pointer; border-radius: 8px; padding: 10px 8px; }
.room-row:hover { background: var(--cream); }
.chk-grid {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 160px; overflow-y: auto; margin-top: 8px;
}
.chk {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink); cursor: pointer;
  padding: 4px 0;
}
.chk input { accent-color: var(--olive); width: 16px; height: 16px; }

@media (max-width: 760px) {
  .toast-layer { left: 12px; right: 12px; max-width: none; }
}

/* ═══════════════════════════════════════════════════════════
   v4 — MODO OSCURO (variante cálida de la paleta)
   ═══════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --cream:        #1C1A17;
  --cream-deep:   #2A2722;
  --paper:        #232019;
  --gray:         #8A8278;
  --gray-soft:    #4A453E;
  --ink:          #D8D2C7;
  --ink-strong:   #F2EEE6;
  --olive:        #8A9A6B;
  --olive-soft:   #6B7A4F;
  --shadow:       0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.4);
}
[data-theme="dark"] .gate { background:
  radial-gradient(120% 80% at 50% -10%, #232019, transparent 60%), var(--cream); }
[data-theme="dark"] .gate-error { background:#3A2420; border-color:#5A3530; color:#E8B0A0; }
[data-theme="dark"] .msg.them .bubble { background: var(--cream-deep); }
[data-theme="dark"] .pip.offline { border-color: var(--gray-soft); }

/* ═══════════════════════════════════════════════════════════
   v4 — REACCIONES
   ═══════════════════════════════════════════════════════════ */
.msg { position: relative; }
.msg-hover-tools {
  position: absolute; top: -10px;
  display: none; gap: 2px;
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: 16px; padding: 2px; box-shadow: var(--shadow-soft);
  z-index: 5;
}
.msg.them .msg-hover-tools { left: 8px; }
.msg.me .msg-hover-tools { right: 8px; }
.msg:hover .msg-hover-tools { display: flex; }
.hover-tool {
  background: transparent; border: none; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; font-size: 14px;
  display: grid; place-items: center; transition: background .1s;
}
.hover-tool:hover { background: var(--cream); }

.reactions { display: flex; gap: 4px; margin: 3px 4px 0; flex-wrap: wrap; }
.msg.me .reactions { justify-content: flex-end; }
.reaction-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: 11px; padding: 1px 7px; font-size: 12px;
  cursor: pointer; transition: all .1s;
}
.reaction-chip.mine { border-color: var(--olive); background: var(--cream); }
.reaction-chip:hover { border-color: var(--olive-soft); }
.reaction-count { color: var(--gray); font-size: 11px; }

.react-picker {
  position: absolute; display: flex; gap: 2px;
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: 18px; padding: 4px 6px; box-shadow: var(--shadow);
  z-index: 60;
}
.react-picker button {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; padding: 3px; border-radius: 50%; transition: transform .1s;
}
.react-picker button:hover { transform: scale(1.3); }

/* ═══════════════════════════════════════════════════════════
   v4 — RESPONDER / CITA
   ═══════════════════════════════════════════════════════════ */
.reply-quote {
  border-left: 3px solid var(--olive-soft);
  padding: 3px 8px; margin-bottom: 4px;
  background: rgba(107,122,79,.08);
  border-radius: 5px; font-size: 12.5px; color: var(--gray);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg.me .reply-quote { background: rgba(255,255,255,.1); color: var(--gray-soft); }

.reply-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 22px; background: var(--cream);
  border-top: 1px solid var(--cream-deep);
  font-size: 13px; color: var(--gray);
}
.reply-bar .reply-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar b { color: var(--ink-strong); }
.reply-cancel { background: transparent; border: none; cursor: pointer; font-size: 18px; color: var(--gray); }

/* mensaje editado / borrado */
.msg-edited { font-size: 10.5px; color: var(--gray); font-style: italic; margin-left: 4px; }
.msg.deleted .bubble {
  font-style: italic; color: var(--gray);
  background: transparent !important; border: 1px dashed var(--cream-deep) !important;
}

/* visto / entregado */
.msg-receipt { font-size: 10.5px; color: var(--gray); margin-left: 4px; }
.msg-receipt.seen { color: var(--olive); }

/* última vez */
.last-seen { font-size: 11.5px; color: var(--gray); font-style: italic; }

/* ═══════════════════════════════════════════════════════════
   v4 — MENSAJES DE VOZ
   ═══════════════════════════════════════════════════════════ */
.voice-bubble { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.voice-bubble audio { height: 36px; max-width: 220px; }
.voice-rec {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: #3A2420; color: #E8B0A0;
  border-radius: 12px; margin: 0 22px 8px;
}
.voice-rec .dot-rec {
  width: 10px; height: 10px; border-radius: 50%; background: #C0392B;
  animation: breathe 1.2s ease-in-out infinite;
}
.voice-rec .rec-time { font-variant-numeric: tabular-nums; }
.voice-rec button { margin-left: auto; background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 8px; padding: 4px 12px; cursor: pointer; font-size: 13px; }

/* ═══════════════════════════════════════════════════════════
   v4 — SCENES (fondos de conversación)
   ═══════════════════════════════════════════════════════════ */
.messages.scene-dusk   { background: linear-gradient(170deg, #EDE4D3, #E2D2BE); }
.messages.scene-mist   { background: linear-gradient(170deg, #E8E8E2, #DADAD0); }
.messages.scene-sand   { background: linear-gradient(170deg, #F0E6D2, #E6D5B8); }
.messages.scene-olive  { background: linear-gradient(170deg, #E8EADD, #D6DBC4); }
.messages.scene-ink    { background: linear-gradient(170deg, #E4E0DA, #CFC9BF); }
[data-theme="dark"] .messages.scene-dusk  { background: linear-gradient(170deg, #2A2017, #1F1812); }
[data-theme="dark"] .messages.scene-mist  { background: linear-gradient(170deg, #22231F, #1A1B18); }
[data-theme="dark"] .messages.scene-sand  { background: linear-gradient(170deg, #2A2418, #201C12); }
[data-theme="dark"] .messages.scene-olive { background: linear-gradient(170deg, #21251A, #181C12); }
[data-theme="dark"] .messages.scene-ink   { background: linear-gradient(170deg, #22201D, #181613); }

/* selector de scene/fuente en perfil */
.pref-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.scene-swatch {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent;
}
.scene-swatch.active { border-color: var(--ink-strong); }

/* flash al saltar a un mensaje citado */
.msg.flash .bubble { animation: flash-bubble 1.2s ease; }
@keyframes flash-bubble {
  0%,100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px var(--olive-soft); }
}
.emo[src] { object-fit: contain; }

/* ═══════════════════════════════════════════════════════════
   v6 — ESCRITORIO Y VENTANAS FLOTANTES (estilo MSN)
   ═══════════════════════════════════════════════════════════ */
.desktop {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh; overflow: hidden;
}
/* La lista de contactos es la ventana principal fija */
.desktop .sidebar {
  position: relative; z-index: 1;
  background: var(--paper);
  border-right: 1px solid var(--cream-deep);
}
/* El área donde flotan las ventanas */
.canvas {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 70% 0%, var(--paper), transparent 55%),
    var(--cream);
}
.canvas-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
  color: var(--gray-soft); pointer-events: none;
}
.canvas-hint .big {
  font-family: var(--font-display); font-size: 40px;
  letter-spacing: -0.02em; margin-bottom: 6px; color: var(--gray-soft);
}

/* Ventana flotante de conversación */
.chat-window {
  position: absolute;
  width: 480px; height: 520px;
  min-width: 340px; min-height: 320px;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  resize: both;
}
.chat-window.focused {
  box-shadow: 0 4px 12px rgba(20,19,18,.12), 0 16px 40px rgba(20,19,18,.16);
  border-color: var(--gray-soft);
}
.chat-window.minimized {
  height: auto !important; min-height: 0;
  resize: none;
}
.chat-window.minimized .cw-body,
.chat-window.minimized .cw-composer,
.chat-window.minimized .cw-typing,
.chat-window.minimized .cw-reply { display: none; }
.chat-window.nudging { animation: nudge 2.5s cubic-bezier(.36,.07,.19,.97); }

/* Barra de título (arrastrable) */
.cw-titlebar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-deep);
  cursor: move; user-select: none;
  flex-shrink: 0;
}
.cw-controls { align-self: flex-start; }
.cw-titlebar .contact-avatar { width: 56px; height: 56px; cursor: pointer; transition: width .18s ease, height .18s ease; }
.cw-titlebar .contact-avatar.enlarged { width: 112px; height: 112px; }
.cw-titlebar .contact-avatar.enlarged .avatar { width: 112px; height: 112px; font-size: 44px; }
.cw-titlebar .contact-avatar .avatar { width: 56px; height: 56px; font-size: 22px; border-radius: 14px; }
.cw-titlebar .contact-avatar .avatar img { border-radius: 14px; }
.cw-titlebar .contact-avatar .pip {
  width: 14px; height: 14px;
  border: 3px solid var(--cream);
}
.cw-title-info { flex: 1; min-width: 0; }
.cw-title-name { font-weight: 600; font-size: 16px; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-title-status { font-size: 12px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cw-controls { display: flex; gap: 2px; }
.cw-ctrl {
  width: 34px; height: 34px; border: none; background: transparent;
  cursor: pointer; border-radius: 8px; color: var(--gray);
  font-size: 19px; line-height: 1; display: grid; place-items: center;
  transition: background .1s, color .1s;
}
.cw-ctrl:hover { background: var(--cream-deep); color: var(--ink-strong); }
.cw-ctrl.close:hover { background: #FBEDE9; color: #8B2A22; }
.cw-ctrl.js-nudge { color: #D9A441; font-size: 21px; }
.cw-ctrl.js-nudge:hover { background: #FBF1DD; color: #B8860B; }

/* Cuerpo de la ventana */
.cw-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 3px; }
.cw-typing { padding: 0 14px 4px; height: 18px; }
.cw-reply { }
.cw-composer {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 12px; background: var(--paper);
  border-top: 1px solid var(--cream-deep); flex-shrink: 0;
}
.cw-composer .composer-tools { display: flex; gap: 4px; }
.cw-composer .tool-btn { width: 40px; height: 40px; font-size: 20px; }
.cw-composer .tool-btn svg { width: 22px; height: 22px; }
.cw-composer textarea {
  flex: 1; font-family: var(--font-ui); font-size: 13.5px;
  color: var(--ink-strong); background: var(--cream);
  border: 1px solid var(--cream-deep); border-radius: 10px;
  padding: 9px 12px; resize: none; max-height: 90px; line-height: 1.4;
  height: 38px; min-height: 38px; overflow-y: auto; box-sizing: border-box;
}
.cw-composer textarea::-webkit-scrollbar { width: 0; height: 0; }
.cw-composer textarea:focus { outline: none; border-color: var(--olive-soft); }
.cw-send {
  background: var(--ink-strong); color: var(--paper); border: none;
  border-radius: 10px; padding: 8px 14px; font-size: 13.5px; font-weight: 500;
  cursor: pointer;
}

/* Barra de tareas inferior (ventanas minimizadas) */
.taskbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 6px; padding: 6px 10px;
  pointer-events: none; flex-wrap: wrap;
}
.taskbar-item {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--cream-deep);
  border-radius: 9px; padding: 7px 12px; cursor: pointer;
  box-shadow: var(--shadow-soft); font-size: 13px;
  max-width: 200px;
}
.taskbar-item:hover { border-color: var(--gray-soft); }
.taskbar-item .pip { width: 7px; height: 7px; }
.taskbar-item .tb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.taskbar-item .tb-badge {
  background: var(--olive); color: var(--paper); font-size: 10px; font-weight: 600;
  min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px;
}

/* En móvil, las ventanas ocupan toda la pantalla (una a la vez) */
@media (max-width: 760px) {
  .desktop { grid-template-columns: 1fr; }
  .desktop.has-window .sidebar { display: none; }
  .chat-window {
    position: fixed !important; inset: 0 !important;
    width: 100% !important; height: 100% !important;
    border-radius: 0; resize: none;
  }
  .chat-window:not(.top-window) { display: none; }
  .taskbar { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   v6 — LOGIN CLÁSICO (evoca MSN, en paleta crema/gris/negro)
   ═══════════════════════════════════════════════════════════ */
.gate-classic {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px 24px;
  background:
    radial-gradient(140% 70% at 50% 0%, var(--paper), transparent 55%),
    radial-gradient(120% 60% at 50% 100%, var(--cream-deep), transparent 60%),
    var(--cream);
}
.gate-stack {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column;
  text-align: center;
}
.gate-logo-lg {
  font-size: 64px; line-height: 1;
  margin-bottom: 18px;
}
.gate-logo-lg .dot {
  width: 13px; height: 13px;
}

/* Retrato circular (el "avatar de la cuenta" del MSN) */
.gate-portrait { display: flex; justify-content: center; margin-bottom: 22px; }
.portrait-frame {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  box-shadow: var(--shadow-soft), inset 0 0 0 6px var(--cream);
  display: grid; place-items: center;
  position: relative;
}
.portrait-frame::after {
  content: ""; position: absolute; inset: -5px;
  border-radius: 50%; border: 1px solid var(--cream-deep);
  opacity: .6;
}
.portrait-initial {
  font-family: var(--font-display); font-weight: 600;
  font-size: 40px; color: var(--ink-strong);
}

.gate-classic .field { text-align: left; }
.gate-classic .field label {
  font-size: 12px; color: var(--gray); font-weight: 500;
}

.gate-status {
  background-image: none;
  cursor: pointer;
}

.gate-checks {
  text-align: left; margin: 4px 0 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.gate-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink); cursor: pointer;
}
.gate-check input {
  width: 15px; height: 15px; accent-color: var(--olive); cursor: pointer;
}

.gate-signin {
  margin-top: 4px; font-size: 15px; padding: 13px;
  letter-spacing: 0.01em;
}

.gate-foot {
  margin-top: 28px; font-size: 12px; color: var(--gray);
  letter-spacing: 0.02em;
}

@media (max-width: 420px) {
  .gate-logo-lg { font-size: 52px; }
  .portrait-frame { width: 84px; height: 84px; }
}
