:root {
  --bg-dark: #090a0f;
  --bg-panel: #11131c;
  --bg-card: #161925;
  --bg-card-hover: #1c2030;
  --bg-input: #1a1e2e;
  --bg-chat: #090a0f;
  --accent-primary: #3b82f6; /* Modern Sapphire Blue */
  --accent-primary-hover: #2563eb;
  --accent-secondary: #6366f1;
  --accent-green: #3b82f6;
  --accent-green-hover: #2563eb;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(59, 130, 246, 0.5);
  --border-color: rgba(255, 255, 255, 0.08);
  --msg-out: #2563eb;
  --msg-in: #1e2235;
  --danger: #ef4444;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  -webkit-tap-highlight-color: transparent;
}

body, html {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  letter-spacing: -0.01em;
}

.app-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Pantallas */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(0.96) translateY(8px) translateZ(0);
  will-change: transform, opacity;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0) translateZ(0);
  z-index: 10;
}

/* Pantalla de Auth - Minimalista y Elegante */
#auth-screen {
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
  background: radial-gradient(circle at 50% 0%, #1e2538 0%, #090a0f 75%);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border-radius: 20px;
  padding: 32px 26px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  transform: translateZ(0);
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.brand-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

.auth-tabs {
  display: flex;
  background: var(--bg-dark);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--bg-panel);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.input-group {
  margin-bottom: 18px;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.input-group input:focus {
  border-color: var(--accent-primary);
  background: #1e2438;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.primary-btn {
  width: 100%;
  padding: 13px;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: all 0.2s ease;
}

.primary-btn:hover {
  background: var(--accent-primary-hover);
}

.primary-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.secondary-btn {
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.secondary-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Header Principal */
.app-header {
  height: 64px;
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  border: 1px solid var(--border-subtle);
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.nick-text {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.status-online {
  font-size: 11px;
  color: #10b981;
  font-weight: 500;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

/* Tabs Navegación: Barra Inferior Nativa y Limpia */
.capsule-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
}

.capsule-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  max-width: 600px;
  height: 60px;
  padding: 0 4px;
  background: transparent;
}

/* Ocultar SVG complejo de arco para diseño limpio y profesional */
.arc-light-svg {
  display: none;
}

/* ── Items de Navegación ── */
.capsule-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 6px 0;
  -webkit-tap-highlight-color: transparent;
}

.capsule-item.active {
  color: var(--accent-primary);
}

.capsule-icon {
  width: 22px;
  height: 22px;
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.capsule-item.active .capsule-icon {
  stroke: var(--accent-primary);
  transform: scale(1.08);
}

.capsule-item span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.capsule-item.active span {
  font-weight: 600;
  color: var(--accent-primary);
}

.badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 8px;
}

/* Vistas de Pestañas */
.tab-view {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 72px 14px;
  opacity: 0;
  transform: scale(0.98) translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: transform, opacity;
}

.tab-view.active {
  display: block;
  opacity: 1;
  transform: scale(1) translateY(0);
}

.search-bar {
  margin-bottom: 14px;
}

.search-bar input {
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.search-bar input:focus {
  border-color: var(--accent-primary);
  background: #1c2030;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Tarjetas Profesionales Elegantes */
.chat-item, .friend-item, .settings-card, .status-my-card, .starred-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: 14px;
  gap: 12px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  transform: translateZ(0);
}

.chat-item:active, .friend-item:active, .starred-item:active {
  background: var(--bg-card-hover);
  transform: scale(0.985);
}

.chat-info {
  flex: 1;
  overflow: hidden;
}

.chat-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.chat-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.chat-time {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.chat-last-msg {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sala de Chat */
.chat-header {
  height: 64px;
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 10px;
}

.back-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.chat-user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-target-nick {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.chat-target-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-dark);
}

.message-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--shadow-sm);
  transform: translateZ(0);
}

.message-bubble.bubble-new {
  animation: bubblePopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bubblePopIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.message-bubble.out {
  align-self: flex-end;
  background: var(--msg-out);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.message-bubble.in {
  align-self: flex-start;
  background: var(--msg-in);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
}

.msg-time {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.65);
}

.message-bubble.in .msg-time {
  color: var(--text-muted);
}

.msg-menu-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
}

.message-bubble.in .msg-menu-btn {
  color: var(--text-muted);
}

.chat-footer {
  padding: 10px 14px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

#chat-form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

#chat-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

#chat-input:focus {
  border-color: var(--accent-primary);
  background: #1e2438;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.tool-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.tool-btn:hover {
  color: var(--accent-green);
  background: rgba(255,255,255,0.05);
}

.msg-image {
  max-width: 100%;
  max-height: 250px;
  border-radius: 8px;
  margin-top: 4px;
  cursor: pointer;
}

/* Reproductor Custom Estilo WhatsApp Nocturno */
.custom-voice-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 20px;
  min-width: 180px;
}

.voice-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-green);
  border: none;
  color: #0b141a;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.voice-waveform {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.voice-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent-green);
  transition: width 0.1s linear;
}

.voice-badge-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  opacity: 0.8;
}

/* Barra de Grabación de Nota de Voz en Vivo */
.recording-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  width: 100%;
}

.recording-cancel-btn {
  background: transparent;
  border: none;
  color: #f15c6d;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #f15c6d;
}

.rec-dot {
  animation: pulse-dot 1s infinite alternate;
}

@keyframes pulse-dot {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

#chat-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

#chat-input:focus {
  border-color: var(--accent-green);
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-primary);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.send-btn:active {
  transform: scale(0.95);
  background: var(--accent-primary-hover);
}

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-panel);
  border-radius: 18px;
  padding: 24px 22px;
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  transform: scale(1) translateY(0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  will-change: transform;
}

.modal-overlay.hidden .modal-card {
  transform: scale(0.92) translateY(12px);
  opacity: 0;
}

.modal-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.modal-card input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.modal-card input:focus {
  border-color: var(--accent-primary);
}
  color: var(--text-primary);
  margin-bottom: 14px;
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.danger-btn {
  padding: 10px 16px;
  background: #f15c6d;
  border: none;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.error-msg {
  color: var(--danger);
  font-size: 12px;
  margin-bottom: 10px;
}

.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
}

.section-block {
  margin-bottom: 20px;
}

.section-block h3 {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* Emoji / Stickers Picker Panel */
.emoji-picker {
  display: flex;
  flex-direction: column;
  max-height: 260px;
  background: var(--bg-panel);
  border-radius: 12px;
  margin-top: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.emoji-picker.hidden {
  display: none !important;
}

.picker-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.picker-tab-btn {
  flex: 1;
  padding: 8px 0;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.picker-tab-btn.active {
  color: var(--accent-green);
  border-bottom-color: var(--accent-green);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.emoji-item {
  font-size: 22px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  user-select: none;
  -webkit-user-select: none;
}

.emoji-item:active {
  background: rgba(0, 168, 132, 0.3);
}

.sticker-item {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  transition: transform 0.15s ease;
}

.sticker-item:active {
  transform: scale(0.9);
}

.create-sticker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px dashed var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.2s ease;
}

.create-sticker-btn:active {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

/* Profile Avatar Image */
.avatar-circle-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-green);
}

.user-profile-badge .avatar-circle-img {
  width: 36px;
  height: 36px;
}

/* Sticker Bubble */
.bubble-sticker {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 2px !important;
}

.sticker-msg-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.msg-sticker {
  max-width: 140px;
  max-height: 140px;
  object-fit: contain;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.msg-sticker:active {
  transform: scale(0.95);
}

.sticker-save-hint {
  font-size: 9px;
  color: var(--text-secondary);
  opacity: 0.6;
}

/* External Sticker URL Input */
.add-external-sticker-row {
  display: flex;
  gap: 4px;
  padding: 4px 8px 8px;
  border-top: 1px solid var(--border-color);
}

.add-external-sticker-row input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 11px;
  outline: none;
}

.add-external-sticker-row button {
  padding: 6px 10px;
  background: var(--accent-green);
  border: none;
  color: #0b141a;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* Modal: Fullscreen Photo Editor */
.editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(17, 27, 33, 0.95);
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
}

.editor-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-tool-btn {
  padding: 6px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.editor-tool-btn.active {
  background: var(--accent-green);
  color: #0b141a;
  border-color: var(--accent-green);
}

#draw-color-picker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: none;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.editor-send-btn {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 20px;
}

.editor-canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0b141a;
  touch-action: none;
}

#editor-canvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  touch-action: none;
}

/* In-Chat Search Bar */
.chat-search-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.chat-search-container input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.chat-search-container button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
}

/* Estados / Historias (24 horas) */
.status-my-card {
  padding: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.status-add-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.status-add-avatar {
  background: rgba(0, 168, 132, 0.2) !important;
  color: var(--accent-green) !important;
  border: 2px dashed var(--accent-green) !important;
  font-size: 18px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}

.status-circle-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-green);
  padding: 2px;
}

.status-circle-ring-letter {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(0, 168, 132, 0.1);
}

/* Visor de Estados */
.status-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.status-progress-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  overflow: hidden;
}

.status-progress-fill {
  height: 100%;
  background: #fff;
  width: 0%;
  transition: width 5s linear;
}

.status-viewer-header {
  position: absolute;
  top: 24px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.status-viewer-img {
  max-width: 100vw;
  max-height: 80vh;
  object-fit: contain;
}

/* Mensajes Destacados */
.starred-item {
  padding: 12px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  cursor: pointer;
}

/* Barra de Citar / Responder */
.reply-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #182229;
  border-left: 4px solid var(--accent-green);
  border-top: 1px solid var(--border-color);
}

.reply-preview-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reply-preview-user {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
}

.reply-preview-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-cancel-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
}

/* Caja de Cita dentro de la Burbuja */
.message-quote-box {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--accent-green);
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
}

.quote-user {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
}

.quote-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Barra de Reacciones Rápidas */
.reactions-quick-bar {
  display: flex;
  justify-content: space-around;
  background: var(--bg-panel);
  padding: 8px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.reaction-emoji-btn {
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s ease;
  user-select: none;
}

.reaction-emoji-btn:hover {
  transform: scale(1.3);
}

.reaction-emoji-btn:active {
  transform: scale(0.9);
}

/* Badge de Reacción en el Mensaje */
.msg-reaction-badge {
  position: absolute;
  bottom: -8px;
  right: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1px 6px;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Botón Velocidad Audio 1x, 1.5x, 2x */
.audio-speed-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  cursor: pointer;
}

/* Ajustes / Configuración */
.settings-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 16px;
}

.settings-row {
  display: flex;
  flex-direction: column;
}

.settings-btn-action {
  display: block;
  padding: 10px 12px;
  background: var(--bg-panel);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.settings-btn-action:active {
  border-color: var(--accent-green);
}

/* ════════════════════════════════════════════════════════════════════
   PANTALLA MODAL DE VERIFICACIÓN OTP FUTURISTA CON ÓRBITA DE PARTÍCULAS
   ════════════════════════════════════════════════════════════════════ */
.otp-modal-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 12, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  overflow: hidden;
}

.otp-modal-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Canvas interactivo de partículas / números en órbita */
.otp-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10005;
}

/* Tarjeta Central OTP Glassmorphism */
.otp-card {
  position: relative;
  z-index: 10001;
  width: 90%;
  max-width: 380px;
  background: rgba(18, 26, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 32px 24px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.otp-badge-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 168, 132, 0.25) 0%, rgba(0, 168, 132, 0.05) 70%);
  border: 1px solid rgba(0, 168, 132, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  box-shadow: 0 0 20px rgba(0, 168, 132, 0.3);
}

.otp-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.otp-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 28px;
}

.otp-highlight {
  color: var(--accent-green);
  font-weight: 600;
}

/* Casillas de entrada OTP (6 slots) */
.otp-slots-container {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.otp-slot {
  width: 44px;
  height: 54px;
  border-radius: 14px;
  background: rgba(11, 20, 26, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.otp-slot.filled {
  border-color: var(--accent-green);
  background: rgba(0, 168, 132, 0.12);
  color: var(--accent-green);
  box-shadow: 0 0 16px rgba(0, 168, 132, 0.4);
  transform: scale(1.06);
}

.otp-slot.glow-implode {
  animation: slotImplode 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slotImplode {
  0% { transform: scale(1.25); border-color: #ffda79; box-shadow: 0 0 25px rgba(255, 218, 121, 0.9); }
  50% { transform: scale(0.92); }
  100% { transform: scale(1.06); border-color: var(--accent-green); box-shadow: 0 0 16px rgba(0, 168, 132, 0.4); }
}

.otp-hidden-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.otp-resend-timer {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.otp-timer-highlight {
  color: #ffda79;
  font-weight: 600;
  cursor: pointer;
}

.otp-verify-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #00a884 0%, #008f70 100%);
  color: #0b141a;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 168, 132, 0.4);
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.otp-verify-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(0, 168, 132, 0.3);
}

.otp-cancel-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}

/* Toast / Notificación Flotante con Botón FILL */
.sms-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 10002;
  width: 90%;
  max-width: 380px;
  height: 64px;
  background: rgba(18, 26, 32, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 8px 12px 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 168, 132, 0.25);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  opacity: 1;
}

.sms-toast.hidden {
  transform: translateX(-50%) translateY(90px);
  opacity: 0;
  pointer-events: none;
}

.sms-icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #00a884;
  color: #0b141a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sms-toast-content {
  flex: 1;
  min-width: 0;
}

.sms-app-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-green);
  margin-bottom: 2px;
}

.sms-text {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sms-fill-btn {
  background: #ffda79;
  color: #0b141a;
  border: none;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 218, 121, 0.6);
  transition: transform 0.15s ease, filter 0.2s ease;
  flex-shrink: 0;
}

.sms-fill-btn:active {
  transform: scale(0.92);
}
