:root {
  --bg: #0b0d17;
  --bg2: #111422;
  --card-solid: #161922;
  --border: rgba(255, 255, 255, 0.06);
  --purple: #8b5cf6;
  --purple-bright: #a78bfa;
  --purple-dim: rgba(139, 92, 246, 0.15);
  --text: #f1f5f9;
  --text2: #94a3b8;
  --muted: #64748b;
  --green: #34d399;
  --red: #f87171;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button, input, textarea, select { font: inherit; color: inherit; }

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  background: var(--bg);
}

.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: min(300px, 88vw);
  background: var(--bg2);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-top)) 12px calc(16px + var(--safe-bottom));
  transition: transform 0.25s ease;
}

.app-drawer { left: 0; transform: translateX(-105%); border-right: 1px solid var(--border); }
.app-drawer.open { transform: translateX(0); }

.conv-drawer { left: 0; width: min(320px, 92vw); transform: translateX(-105%); }
.conv-drawer.open { transform: translateX(0); }

.drawer-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 16px; }
.drawer-head strong { display: block; font-size: 16px; font-weight: 600; }
.drawer-head span { font-size: 12px; color: var(--muted); }
.drawer-logo { border-radius: 8px; }

.drawer-divider { height: 1px; background: var(--border); margin: 8px 0; flex-shrink: 0; }
.drawer-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  margin: 2px 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--text2);
  font-size: 16px;
}
.drawer-link svg { flex-shrink: 0; opacity: 0.75; }
.drawer-link.active { background: var(--purple-dim); color: var(--text); }
.drawer-link.active svg { color: var(--purple-bright); opacity: 1; }

.drawer-profile {
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(11, 13, 23, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}
.drawer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--purple-dim);
  color: var(--purple-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.drawer-profile-name { font-size: 16px; font-weight: 600; }
.drawer-profile-role { font-size: 12px; color: var(--purple-bright); }

.drawer-vps-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(11, 13, 23, 0.45);
}
.drawer-vps-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.drawer-vps-row span:first-child { font-size: 12px; color: var(--text2); }
.drawer-vps-row strong { color: var(--purple-bright); font-size: 16px; }
.drawer-vps-note { font-size: 11px; color: var(--muted); }

.topbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: calc(8px + var(--safe-top)) 8px 8px 4px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 56px;
}
.topbar-title { flex: 1; min-width: 0; padding-left: 4px; }
.topbar-title h1 { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.status-dot.offline { background: var(--red); }
.status-dot.thinking { background: var(--purple-bright); }
.topbar-actions { display: flex; align-items: center; }
.topbar-actions .icon-btn { color: var(--purple-bright); }

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--purple-bright);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.plain { color: var(--text); }

.main { flex: 1; overflow-y: auto; background: var(--bg); min-height: 0; }
.main.home-active,
.main:has(.inicio-screen) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.screen-shell { padding: 16px; }

.chat-screen { display: flex; flex-direction: column; min-height: calc(100dvh - 56px - var(--safe-top)); }
.chat-scroll { flex: 1; overflow-y: auto; }
.chat-footer { border-top: 1px solid rgba(255, 255, 255, 0.1); background: rgba(11, 13, 23, 0.35); padding: 12px 16px calc(14px + var(--safe-bottom)); }

.welcome-hero {
  margin: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  min-height: 280px;
}
.welcome-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.welcome-hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,13,23,.92), rgba(11,13,23,.45)); }
.welcome-hero-content { position: relative; padding: 16px; z-index: 1; }
.welcome-hero h2 { font-size: 28px; font-weight: 700; line-height: 1.15; margin-bottom: 4px; }
.welcome-hero p { color: var(--text2); font-size: 14px; }
.welcome-meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.welcome-meta.thinking { color: var(--purple-bright); }
.welcome-hub { width: 100%; height: 100px; object-fit: contain; margin-top: 12px; }
.mode-field { margin-top: 12px; }
.mode-field label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.mode-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(11, 13, 23, 0.6);
  color: var(--text);
}

.compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}
.compact-header .mode-label { color: var(--purple-bright); font-size: 12px; }
.compact-header .status-label { color: var(--muted); font-size: 12px; }
.compact-header .status-label.thinking { color: var(--purple-bright); }
.compact-header img { width: 48px; height: 48px; object-fit: contain; }

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
}

.msg-row { display: flex; padding: 0; }
.msg-row.user { justify-content: flex-end; }
.msg-row.assistant, .msg-row.error { justify-content: flex-start; }

.msg-bubble,
.msg-row .msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-row.user .msg-bubble,
.msg-row.user .msg {
  background: #8b5cf6;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-row.user .msg-action-btn {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.msg-row.user .msg-action-btn.danger {
  color: #fecaca;
}

.msg-row.user.editing .msg-bubble,
.msg-row.user.editing .msg {
  outline: 2px solid var(--purple-bright, #a78bfa);
  outline-offset: 2px;
}

.msg-row.assistant .msg-bubble,
.msg-row.assistant .msg {
  background: rgba(20, 24, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg-row.error .msg-bubble { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }

.chat-editing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 12px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.35);
  color: var(--purple-bright, #c4b5fd);
  font-size: 13px;
}
.chat-editing-cancel {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
}
.msg-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.msg-tag { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(15, 23, 42, 0.45); color: #c4b5fd; }

.msg-row.user .msg-actions { opacity: 1; }

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text2);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn:hover {
  border-color: var(--purple);
  color: var(--purple-bright);
  background: var(--purple-dim);
}

.attach-strip { padding-bottom: 8px; }
.attach-strip .error-text { color: var(--red); font-size: 12px; margin-bottom: 4px; }
.attach-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--purple-dim);
  color: var(--purple-bright);
}
.attach-chip button { border: none; background: transparent; color: inherit; cursor: pointer; }

.input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(20, 24, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-bar:focus-within {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-bar .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #a78bfa;
}

.input-bar .icon-btn:hover { background: rgba(139, 92, 246, 0.15); }
.input-bar .icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.input-bar .dictate-btn.active {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.input-bar textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 12px 0;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
}

.input-bar textarea::placeholder { color: var(--muted); }

.input-bar #btn-send {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #8b5cf6;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-bar #btn-send:hover { background: #7c3aed; }

.input-bar #btn-send svg { width: 18px; height: 18px; }

.input-bar .stop-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
  font-size: 14px;
  font-weight: 700;
  margin-left: 4px;
}

.conv-new-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.45);
  background: var(--purple-dim);
  color: var(--purple-bright);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.conv-search-wrap { position: relative; margin-bottom: 8px; }
.conv-search-wrap input {
  width: 100%;
  padding: 12px 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(11, 13, 23, 0.35);
  outline: none;
}
.conv-search-wrap .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.conv-search-wrap .clear-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.conv-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.conv-divider { height: 1px; background: var(--border); margin-bottom: 8px; }
.conv-group-label { font-size: 12px; color: var(--text2); padding: 12px 0 6px; }
.conv-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(11, 13, 23, 0.35);
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.conv-item.selected { background: var(--purple-dim); border-color: rgba(139, 92, 246, 0.5); }
.conv-item svg { flex-shrink: 0; margin-top: 2px; color: var(--muted); }
.conv-item.selected svg { color: var(--purple-bright); }
.conv-item-body { flex: 1; min-width: 0; }
.conv-item-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.msg-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 8px;
  opacity: 0.55;
  transition: opacity 0.15s;
}

.msg-bubble:hover .msg-actions,
.msg-bubble:focus-within .msg-actions,
.msg-row.user .msg-actions {
  opacity: 1;
}

.msg-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
}

.msg-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.msg-action-btn.danger { color: #f87171; }
.stop-btn { color: #f87171; font-size: 16px; font-weight: 700; }
.conv-item-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.conv-item-row .conv-item {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.conv-delete {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.conv-delete:hover,
.conv-delete:focus-visible {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}
.conv-drawer-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  margin: 12px 0 8px;
  opacity: 0.9;
}
.btn-clear-local-threads {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-clear-local-threads:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
}

.card { background: var(--card-solid); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.card h3 { font-size: 14px; margin-bottom: 6px; font-weight: 600; }
.card p { font-size: 13px; color: var(--text2); line-height: 1.45; }

.list-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-solid);
  cursor: pointer;
  color: inherit;
}
.list-item h4 { font-size: 14px; margin-bottom: 4px; }
.list-item p { font-size: 12px; color: var(--muted); }
.progress-bar { height: 4px; background: rgba(255,255,255,.08); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--purple); }

.code-layout { display: flex; flex-direction: column; gap: 10px; }
.code-files { display: flex; gap: 6px; overflow-x: auto; }
.code-tab { flex-shrink: 0; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-solid); font-size: 12px; cursor: pointer; color: var(--text2); }
.code-tab.active { border-color: var(--purple); color: var(--purple-bright); }
.code-editor { width: 100%; min-height: 240px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: #0d0f14; font-family: Consolas, monospace; font-size: 13px; color: var(--text); }

.task-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.task-item input { width: 18px; height: 18px; accent-color: var(--purple); }
.task-item.done span { text-decoration: line-through; color: var(--muted); }
.task-add { display: flex; gap: 8px; margin-top: 10px; }
.task-add input { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-solid); }

.btn-primary, .btn-outline, .btn-ghost, .btn-text, .btn-primary-sm, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 14px; border-radius: 10px; border: none; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--purple); color: #fff; width: 100%; }
.btn-primary-sm { background: var(--purple); color: #fff; padding: 8px 16px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text2); width: 100%; }
.btn-ghost { background: transparent; color: var(--purple-bright); border: 1px solid rgba(139,92,246,.35); width: 100%; }
.btn-text { background: transparent; color: var(--purple-bright); }
.btn-danger { background: var(--red); color: #fff; }

.version-banner { font-size: 11px; padding: 8px 10px; border-radius: 10px; margin: 8px 16px; border: 1px solid var(--border); background: rgba(139,92,246,.08); }
.version-banner.synced { border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.version-banner.outdated { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); padding: 16px; }
.modal-card { width: min(400px,100%); background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.modal-card h3 { margin-bottom: 8px; }
.modal-card p { font-size: 14px; color: var(--text2); margin-bottom: 14px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); transform: translateX(-50%);
  background: var(--card-solid); border: 1px solid var(--border); padding: 10px 16px; border-radius: 999px; font-size: 13px; z-index: 110;
}

.attach-sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; background: rgba(0,0,0,.55); }
.attach-sheet-card { width: 100%; background: var(--bg2); border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--safe-bottom)); border: 1px solid var(--border); }
.attach-sheet-sub { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.attach-sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.attach-sheet-close { margin-top: 12px; }

.ronin-voice-float {
  position: fixed;
  right: 16px;
  bottom: calc(88px + var(--safe-bottom));
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.45));
  transition: transform .2s ease, opacity .2s ease;
}
.ronin-voice-float img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(139,92,246,.55);
  background: rgba(18,12,32,.95);
  padding: 8px;
}
.ronin-voice-float-hint {
  font-size: 10px;
  color: #c4b5fd;
  background: rgba(10,10,20,.92);
  border: 1px solid rgba(139,92,246,.35);
  border-radius: 999px;
  padding: 2px 8px;
}
.ronin-voice-float.is-active img { border-color: #34d399; }
.ronin-voice-float.is-listening img { box-shadow: 0 0 0 4px rgba(139,92,246,.25); }
.ronin-voice-float.is-speaking img { border-color: #fbbf24; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  cursor: pointer;
  z-index: 15;
}
.screen-shell.with-fab { padding-bottom: 80px; }

.view-toggle { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.project-card { background: var(--bg2); border-radius: 16px; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--border); }
.project-card.compact { border: 1px solid var(--border); background: var(--bg2); border-radius: 14px; padding: 12px; text-align: left; cursor: pointer; color: inherit; width: 100%; }
.project-card-main { display: block; width: 100%; padding: 16px; border: none; background: transparent; text-align: left; color: inherit; cursor: pointer; }
.project-type { font-size: 11px; color: var(--purple-bright); margin-bottom: 4px; }
.project-card h4 { font-size: 15px; margin-bottom: 6px; }
.project-card p { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.project-pct { font-size: 12px; color: var(--text2); }
.project-slider { width: calc(100% - 32px); margin: 0 16px 8px; accent-color: var(--purple); }
.project-actions { display: flex; gap: 8px; padding: 0 16px 12px; }
.action-chip { border: none; background: var(--purple-dim); color: var(--purple-bright); padding: 6px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.action-chip.danger { color: var(--red); background: rgba(248,113,113,.12); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.section-label { font-size: 13px; color: var(--text2); margin: 16px 0 8px; }
.workspace-desc { color: var(--text2); margin-bottom: 8px; line-height: 1.45; }
.inline-dialog { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-top: 12px; }
.inline-dialog label { display: block; margin: 8px 0; font-size: 12px; color: var(--text2); }
.inline-dialog input, .inline-dialog select, .inline-dialog textarea { width: 100%; margin-top: 4px; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-solid); }
.inline-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.card label { display: block; margin: 8px 0; font-size: 12px; color: var(--text2); }
.card input, .card textarea { width: 100%; margin-top: 4px; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: rgba(11,13,23,.5); }
.bot-msgs { max-height: 120px; overflow-y: auto; margin: 8px 0; font-size: 12px; color: var(--text2); }
.bot-msg { margin-bottom: 4px; }

.tab-row { display: flex; gap: 4px; margin-bottom: 12px; background: var(--bg2); border-radius: 12px; padding: 4px; }
.tab-row-scroll { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
.tab-row-scroll .tab-btn { flex: 0 0 auto; white-space: nowrap; }
.hint-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--text2); }
.hint-list li { margin-bottom: 6px; }
.tab-btn { flex: 1; border: none; background: transparent; color: var(--text2); padding: 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.tab-btn.active { background: var(--purple-dim); color: var(--text); }
.hint-text { font-size: 12px; color: var(--muted); margin-top: 8px; }

.stat-card { background: var(--bg2); border-radius: 14px; padding: 14px; margin-bottom: 10px; border: 1px solid var(--border); }
.stat-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stat-card strong { font-size: 16px; }

.file-tree { background: var(--bg2); border-radius: 12px; padding: 8px; margin-bottom: 8px; border: 1px solid var(--border); max-height: 160px; overflow-y: auto; }
.tree-folder, .tree-file { display: block; width: 100%; text-align: left; border: none; background: transparent; color: var(--text2); padding: 6px 4px; cursor: pointer; font-size: 13px; }
.tree-file.active { color: var(--purple-bright); background: var(--purple-dim); border-radius: 6px; }
.code-active-label { color: var(--purple-bright); font-family: Consolas, monospace; font-size: 12px; margin-bottom: 4px; }
.inline-input { flex: 1; min-width: 100px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-solid); font-size: 12px; }
.terminal-panel { background: #0d0f14; border-radius: 10px; padding: 10px; margin: 8px 0; border: 1px solid var(--border); }
.terminal-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.terminal-panel pre { color: var(--green); font-size: 12px; font-family: Consolas, monospace; white-space: pre-wrap; margin: 0; }
.preview-panel { margin: 8px 0; }
.preview-label { color: var(--purple-bright); font-size: 12px; margin-bottom: 6px; }
.preview-box { background: var(--bg2); border-radius: 12px; padding: 16px; border: 1px solid var(--border); }
.preview-btn { display: inline-block; margin-top: 8px; padding: 6px 16px; border-radius: 8px; background: rgba(139,92,246,.3); color: var(--purple-bright); font-size: 13px; }
.task-del { padding: 4px 8px; min-width: auto; }
.task-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.task-item label { display: flex; align-items: center; gap: 10px; flex: 1; }

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

.msg-row.assistant .msg.msg-thinking {
  max-width: min(320px, 88vw);
  padding: 10px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  background: rgba(20, 24, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.msg-thinking .thinking-bubble {
  opacity: 0.85;
  font-style: italic;
  animation: thinking-pulse 1.4s ease-in-out infinite;
}

@keyframes thinking-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: var(--bg2);
}
.login-screen.hidden { display: none; }
.login-card {
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 32px 24px;
  padding-top: calc(32px + var(--safe-top));
  padding-bottom: calc(32px + var(--safe-bottom));
  border-radius: 0;
  border: none;
  background: var(--bg2);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-form {
  width: 100%;
  max-width: 420px;
}
.login-logo { display: block; margin: 0 auto 12px; }
.login-card h1 { text-align: center; font-size: 24px; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text2); font-size: 13px; margin-bottom: 16px; }
.login-form label { display: block; font-size: 12px; color: var(--text2); margin: 10px 0 4px; }
.login-form input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
}
.password-toggle:hover { color: var(--text); }
.password-toggle .icon-eye-closed { display: none; }
.password-toggle.is-visible .icon-eye-open { display: none; }
.password-toggle.is-visible .icon-eye-closed { display: block; }
.login-error { color: var(--red); font-size: 12px; margin-top: 10px; }
.login-error.hidden { display: none; }
.login-submit { width: 100%; margin-top: 16px; }
.login-submit.hidden { display: none; }
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
}
.login-remember input { width: auto; margin: 0; accent-color: var(--purple); }
.login-identity-summary {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.login-identity-summary p { margin: 0 0 6px; font-size: 13px; color: var(--text); }
.login-identity-summary.hidden,
#login-identity.hidden { display: none; }
.login-forgot-wrap { text-align: right; margin: 6px 0 0; }
.link-btn {
  background: none;
  border: none;
  color: var(--purple);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  text-decoration: underline;
}
.login-recovery { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.login-recovery.hidden { display: none; }
.login-hint { font-size: 11px; color: var(--text2); margin: 4px 0 8px; }
.login-recover-btn { width: 100%; margin-top: 12px; }
.login-back-btn { display: block; margin: 10px auto 0; }
.app.hidden { visibility: hidden; pointer-events: none; height: 0; overflow: hidden; }

/* ===== Pantalla Inicio — referencia pantalla inicio.png ===== */
.inicio-screen {
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.inicio-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.inicio-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 14px 12px;
  box-sizing: border-box;
}
.inicio-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 200px;
  border: 1px solid rgba(139, 92, 246, 0.18);
}
.inicio-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.inicio-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(8, 8, 16, 0.92) 0%, rgba(8, 8, 16, 0.55) 42%, rgba(8, 8, 16, 0.25) 100%);
}
.inicio-hero-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(12, 12, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.inicio-hero-badge strong { display: block; font-size: 10px; }
.inicio-hero-badge-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--green);
  font-weight: 600;
}
.inicio-hero-badge.offline .inicio-hero-badge-status { color: var(--red); }
.inicio-hero-body {
  position: relative;
  z-index: 1;
  padding: 22px 18px 24px;
}
.inicio-time { font-size: 14px; color: var(--purple-bright); margin: 0 0 4px; }
.inicio-name { font-size: 30px; font-weight: 700; color: #fff; margin: 0 0 8px; line-height: 1.1; }
.inicio-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 16px;
}
.inicio-wave { width: 26px; height: 12px; color: var(--purple-bright); flex-shrink: 0; }
.inicio-speak-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px 9px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 10, 18, 0.72);
  color: #fff;
  cursor: pointer;
  text-align: left;
}
.inicio-speak-mic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-bright), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.inicio-speak-text { display: flex; flex-direction: column; gap: 2px; }
.inicio-speak-text strong { font-size: 13px; }
.inicio-speak-text small { font-size: 10px; color: rgba(255, 255, 255, 0.55); }
.inicio-version-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.inicio-version-col { min-width: 0; }
.inicio-version-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 6px;
}
.inicio-version-head svg { width: 14px; height: 14px; color: var(--purple-bright); }
.inicio-version-value { font-size: 18px; font-weight: 700; margin-bottom: 4px; word-break: break-word; }
.inicio-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple-bright);
  font-size: 9px;
  font-weight: 600;
}
.inicio-version-note { font-size: 9px; color: var(--muted); margin: 6px 0 0; }
.inicio-version-divider { width: 1px; background: var(--border); min-height: 64px; }
.inicio-version-details {
  grid-column: 1 / -1;
  border: none;
  background: none;
  color: var(--purple-bright);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  padding: 0;
}
.inicio-section-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 600;
}
.inicio-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.inicio-quick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 100px;
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid rgba(139, 92, 246, 0.14);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.inicio-quick-chevron { position: absolute; top: 8px; right: 8px; color: var(--muted); font-size: 13px; }
.inicio-quick-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(139, 92, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.inicio-quick-card strong { font-size: 12px; }
.inicio-quick-card small { font-size: 9px; color: var(--muted); line-height: 1.3; }
.inicio-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 140px;
  align-items: stretch;
}
.inicio-panel {
  padding: 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.inicio-panel h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.inicio-vps-host { margin: -6px 0 12px; font-size: 11px; color: var(--text-muted); }
.inicio-activity-list, .inicio-status-list { list-style: none; margin: 0; padding: 0; }
.inicio-activity-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.inicio-activity-list li:last-child { border-bottom: none; }
.inicio-activity-label { display: block; font-size: 9px; color: var(--muted); }
.inicio-activity-list strong { font-size: 11px; color: var(--purple-bright); font-weight: 600; }
.inicio-activity-time { font-size: 9px; color: var(--muted); white-space: nowrap; }
.inicio-panel-link {
  margin-top: 8px;
  border: none;
  background: none;
  color: var(--purple-bright);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.inicio-status-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
  color: var(--text2);
}
.inicio-status-list li:last-child { border-bottom: none; }
.inicio-status-meta { text-align: right; }
.inicio-status-meta small { display: block; font-size: 9px; color: var(--muted); }
.inicio-ok { color: var(--green) !important; }
.inicio-warn { color: var(--red) !important; }
.inicio-check-btn {
  margin-top: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.08);
  color: var(--purple-bright);
  font-size: 11px;
  cursor: pointer;
}
.inicio-footer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  border-radius: 0;
  background: var(--card);
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  flex-shrink: 0;
}
.inicio-footer-bar span { flex: 1; }
@media (max-width: 720px) {
  .inicio-panels { grid-template-columns: 1fr; }
  .inicio-inner { padding: 8px 12px 10px; }
}

.inicio-footer-mic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--purple-bright), var(--purple));
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== Pantalla Código (estilo escritorio) ===== */
.codigo-page { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.codigo-editor-panel { background: #0a0c12; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.codigo-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 0; background: #0d0f16; border-bottom: 1px solid var(--border); }
.codigo-editor-tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.codigo-editor-tabs::-webkit-scrollbar { display: none; }
.codigo-file-tab { display: inline-flex; align-items: center; gap: 4px; padding: 8px 10px; border: none; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; cursor: pointer; border-radius: 8px 8px 0 0; }
.codigo-file-tab.active { background: #12151e; color: var(--text); border: 1px solid var(--border); border-bottom-color: #12151e; }
.codigo-file-tab-add { color: var(--purple-bright); font-size: 16px; }
.codigo-tab-brace { color: #f59e0b; font-weight: 700; }
.codigo-editor-toolbar { display: flex; gap: 4px; flex-shrink: 0; }
.codigo-tool-btn { width: 32px; height: 32px; border: none; border-radius: 8px; background: rgba(255,255,255,0.05); color: var(--text2); cursor: pointer; font-size: 14px; }
.codigo-editor-body { display: flex; min-height: 200px; }
.codigo-gutter { padding: 12px 8px; background: #080810; color: var(--muted); font-family: Consolas, monospace; font-size: 12px; line-height: 1.45; text-align: right; user-select: none; border-right: 1px solid var(--border); white-space: pre; }
.codigo-textarea { flex: 1; min-height: 200px; padding: 12px; border: none; background: #0d0f14; color: var(--text); font-family: Consolas, monospace; font-size: 13px; line-height: 1.45; resize: vertical; outline: none; }
.codigo-terminal-panel { background: #0a0c12; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.codigo-terminal-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #0d0f16; border-bottom: 1px solid var(--border); }
.codigo-terminal-tabs { display: flex; gap: 8px; }
.codigo-term-tab { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.codigo-term-tab.active { color: var(--purple-bright); }
.codigo-shell-path { font-size: 11px; color: var(--muted); font-family: Consolas, monospace; }
.codigo-terminal-output { margin: 0; padding: 10px 12px; min-height: 100px; max-height: 180px; overflow: auto; color: var(--green); font-family: Consolas, monospace; font-size: 12px; white-space: pre-wrap; background: #080810; }
.codigo-cmd-form { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--border); background: #0d0f16; }
.codigo-cmd-form input { flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: #080810; color: var(--text); font-size: 14px; }
.codigo-cmd-send { width: 40px; height: 40px; border: none; border-radius: 8px; background: var(--purple); color: #fff; font-size: 18px; cursor: pointer; flex-shrink: 0; }
.codigo-files-drawer { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--card); }
.codigo-files-drawer summary { cursor: pointer; color: var(--purple-bright); font-size: 13px; font-weight: 600; }
.codigo-ai-row { flex-wrap: wrap; }

.dictate-btn.active { color: var(--red) !important; background: rgba(239, 68, 68, 0.15) !important; }

/* ===== User profile (VPS) ===== */
.user-shell { gap: 12px; }
.user-hero { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.user-hero-avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, var(--purple)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; }
.user-hero-name { font-size: 18px; font-weight: 700; margin: 0; }
.user-hero-role { font-size: 12px; color: var(--text2); margin: 4px 0 0; }
.user-core-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.user-core-stat { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.user-core-stat span { display: block; font-size: 10px; color: var(--text2); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.user-core-stat strong { font-size: 15px; color: var(--text); }
.user-subtitle { font-size: 12px; color: var(--muted); margin: 0; }
.user-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.user-tool-btn { padding: 8px 12px; font-size: 12px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text2); }
.user-tool-btn.active, .user-tool-btn:hover { color: var(--text); border-color: rgba(139,92,246,0.35); background: rgba(139,92,246,0.12); }
.user-tool-btn.danger:hover { color: #fca5a5; border-color: rgba(239,68,68,0.35); }
.user-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.user-tab { padding: 7px 10px; font-size: 11px; border-radius: 8px; border: none; background: transparent; color: var(--muted); white-space: nowrap; }
.user-tab.active { background: rgba(139,92,246,0.18); color: var(--text); }
.user-field-label { display: block; margin: 10px 0 4px; font-size: 12px; color: var(--text2); }
.user-field { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 14px; }
.user-field:disabled { opacity: 0.85; }
.user-hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.user-mem-item { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); margin-bottom: 8px; font-size: 12px; }
.user-mem-actions { display: flex; gap: 6px; margin-top: 8px; }
.user-mem-btn { font-size: 11px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text2); }
.user-mem-btn.danger { color: #fca5a5; }
.user-save-row { margin-top: 12px; }
.user-save-row.hidden { display: none; }
.user-feedback { font-size: 12px; color: var(--green); margin-top: 6px; }
.user-panel.hidden { display: none; }

/* ===== Vida + UI páginas (portado escritorio) ===== */
.vida-subtitle,.vida-stat-label,.vida-stat-sub,.vida-timeline-when,.vida-timeline-item p,.vida-summary-label,.vida-highlight-item span,.vida-places-list strong { color: var(--text2); }
.vida-title,.vida-timeline-item h3,.vida-card-title,.vida-summary-value { color: var(--text); }
.vida-link-btn,.vida-btn-insights { color: var(--purple-bright); }
.vida-shell { position: relative; }
.main.vida-active { overflow: hidden; }
.ronin-page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:14px; }
.ronin-page-header-left { display:flex; gap:14px; align-items:flex-start; }
.ronin-page-icon { width:44px; height:44px; border-radius:50%; background:linear-gradient(135deg,rgba(139,92,246,.35),rgba(109,40,217,.2)); border:1px solid rgba(167,139,250,.35); display:flex; align-items:center; justify-content:center; color:#e9d5ff; flex-shrink:0; }
.ronin-page-icon svg { width:22px; height:22px; }
.ronin-page-title { font-size:22px; font-weight:700; margin:0; }
.ronin-page-subtitle { font-size:12px; color:var(--text2); margin:4px 0 0; line-height:1.45; }
.cfg-card { background:rgba(255,255,255,.03); border:1px solid var(--border); border-radius:14px; padding:16px; margin-bottom:12px; }
.cfg-card-wide { max-width:100%; }
.cfg-card-title { font-size:14px; font-weight:600; margin:0 0 12px; color:var(--text); }
.ronin-stat-card { padding:14px 16px; border-radius:14px; background:rgba(255,255,255,.03); border:1px solid var(--border); margin-bottom:10px; }
.ronin-stat-label { display:block; font-size:11px; color:var(--text2); }
.ronin-stat-value { display:block; font-size:20px; font-weight:700; margin-top:4px; }
.ronin-stat-sub { display:block; font-size:11px; color:var(--muted); margin-top:4px; }
.ronin-stat-bar { height:5px; border-radius:999px; background:rgba(255,255,255,.06); margin-top:8px; overflow:hidden; }
.ronin-stat-bar span { display:block; height:100%; background:linear-gradient(90deg,#7c3aed,#c084fc); border-radius:inherit; }
.ronin-stats-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.settings-scroll,.conn-scroll,.perf-scroll { display:flex; flex-direction:column; gap:0; }
/* ===== Vida â€” memoria inteligente (referencia) ===== */
.app-body.vida-mode .right-panel { display: none; }

.app-body.vida-mode .main-panel {
  padding: 0 16px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#view-vida.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vida-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  gap: 14px;
  padding: 2px 0 0;
  position: relative;
  overflow: hidden;
}

.vida-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 2px;
}

.vida-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* â€” Header â€” */
.vida-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 0 6px;
}

.vida-header-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.vida-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(109, 40, 217, 0.2));
  border: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e9d5ff;
}

.vida-header-icon svg {
  width: 22px;
  height: 22px;
}

.vida-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.vida-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
  max-width: 520px;
  line-height: 1.5;
}

.vida-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  transition: filter 0.15s;
}

.vida-btn-primary svg { width: 15px; height: 15px; }
.vida-btn-primary:hover { filter: brightness(1.1); }

/* â€” Stats row â€” */
.vida-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  flex-shrink: 0;
  padding: 0 2px;
}

.vida-stat-card {
  position: relative;
  padding: 16px 18px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.vida-stat-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  color: rgba(167, 139, 250, 0.55);
}

.vida-stat-icon svg {
  width: 100%;
  height: 100%;
}

.vida-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.vida-stat-value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.vida-stat-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* â€” Body grid â€” */
.vida-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 12px;
  align-items: start;
  padding-bottom: 8px;
}

.vida-main,
.vida-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: visible;
}

/* â€” Cards â€” */
.vida-card {
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px 18px;
}

.vida-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.vida-card-head h2,
.vida-card-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.vida-highlights-card .vida-card-title,
.vida-places-card .vida-card-title,
.vida-insights-card .vida-card-title {
  margin-bottom: 12px;
}

/* â€” Filters â€” */
.vida-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.vida-filter {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.vida-filter--text {
  padding: 6px 14px;
  border-radius: 8px;
}

.vida-filter--icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.vida-filter--icon svg {
  width: 15px;
  height: 15px;
}

.vida-filter.active {
  background: rgba(139, 92, 246, 0.22);
  color: #e9d5ff;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.25);
}

.vida-filter:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

/* â€” Timeline â€” */
.vida-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.vida-timeline-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 108px;
  gap: 12px;
  align-items: start;
  padding: 14px 4px 14px 0;
  position: relative;
}

.vida-timeline-rail {
  position: relative;
  display: flex;
  justify-content: center;
  height: 100%;
  min-height: 72px;
}

.vida-timeline-rail::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.5), rgba(139, 92, 246, 0.15));
}

.vida-timeline-item--last .vida-timeline-rail::before {
  bottom: 50%;
}

.vida-timeline-node {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(109, 40, 217, 0.2));
  border: 1px solid rgba(167, 139, 250, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ddd6fe;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.vida-timeline-node svg {
  width: 16px;
  height: 16px;
}

.vida-timeline-when {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.vida-timeline-item h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 5px;
  letter-spacing: -0.01em;
}

.vida-timeline-item p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  max-width: 420px;
}

.vida-thumb {
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vida-thumb--photo {
  width: 108px;
  min-width: 108px;
  height: 76px;
  align-self: center;
}

.vida-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.vida-link-btn {
  background: none;
  border: none;
  color: var(--purple-bright);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}

.vida-link-btn:hover { color: #c4b5fd; }

.vida-link-btn--inline {
  font-size: 12px;
  padding: 0;
}

.vida-link-btn--block {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  padding: 6px 0;
}

/* â€” Photos â€” */
.vida-photo-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.vida-photo-tile {
  width: 100%;
  min-width: 0;
  height: 92px;
}

.vida-photo-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 92px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px dashed rgba(139, 92, 246, 0.35);
  color: var(--purple-bright);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.vida-photo-more small {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

/* â€” Summary â€” */
.vida-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.vida-summary-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.vida-summary-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.vida-summary-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.vida-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.vida-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #c084fc);
}

.vida-period-select {
  padding: 6px 28px 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 8px center;
  color: var(--text-secondary);
  font-size: 12px;
  appearance: none;
  cursor: pointer;
}

.vida-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.12);
}

.vida-summary-banner-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.vida-summary-heart {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  color: rgba(167, 139, 250, 0.45);
}

.vida-summary-heart svg {
  width: 100%;
  height: 100%;
}

/* â€” Highlights â€” */
.vida-highlights {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vida-highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vida-highlight-thumb {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 8px;
}

.vida-highlight-item strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.vida-highlight-item span {
  font-size: 11px;
  color: var(--text-muted);
}

/* â€” Map & places â€” */
.vida-map-svg {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 10px;
  display: block;
}

.vida-places-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.vida-places-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 2px 0;
}

.vida-place-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vida-places-list strong {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* â€” Insights â€” */
.vida-insights {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.vida-insight-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.12);
}

.vida-insight-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vida-insight-icon svg {
  width: 16px;
  height: 16px;
}

.vida-insight-icon--chart {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.vida-insight-icon--flame {
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
}

.vida-insight-icon--sun {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.vida-insight-item p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.vida-btn-insights {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
  transition: filter 0.15s;
}

.vida-btn-insights:hover { filter: brightness(1.08); }

/* â€” Bottom nav â€” */
.vida-bottom-nav {
  display: flex;
  gap: 2px;
  padding: 6px 4px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: space-between;
}

.vida-bottom-nav::-webkit-scrollbar { display: none; }

.vida-bottom-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.vida-bottom-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.vida-bottom-icon svg {
  width: 18px;
  height: 18px;
}

.vida-bottom-label {
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.vida-bottom-btn.active {
  background: rgba(139, 92, 246, 0.14);
  color: var(--purple-bright);
}

.vida-bottom-btn.active .vida-bottom-icon {
  color: var(--purple-bright);
}

.vida-bottom-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

/* â€” Modal & toast â€” */
.vida-modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.vida-modal.hidden { display: none; }

.vida-modal-card {
  width: min(480px, 100%);
  padding: 22px;
  border-radius: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.vida-modal-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.vida-modal-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.vida-moment-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.vida-moment-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}

.vida-moment-type span { font-size: 20px; }
.vida-moment-type:hover { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.08); }

.vida-modal-close {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.vida-toast {
  position: absolute;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(20, 18, 35, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--text-primary);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
}

.vida-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.vida-card-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vida-mf-label {
  display: block;
  margin: 12px 0 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.vida-mf-input,
.vida-mf-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}

.vida-mf-textarea {
  min-height: 72px;
  resize: vertical;
}

.vida-mf-photo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  cursor: pointer;
}

.vida-mf-photo.hidden { display: none; }

.vida-mf-photo-btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(139, 92, 246, 0.45);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.vida-mf-photo-name {
  font-size: 11px;
  color: var(--text-muted);
}

.vida-mf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.vida-mf-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.vida-mf-actions .vida-btn-primary { flex: 1; }

.vida-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 55;
  padding: 16px;
}

.vida-overlay.hidden { display: none; }

.vida-overlay-card {
  width: min(560px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.vida-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.vida-overlay-head h3 {
  margin: 0;
  font-size: 16px;
}

.vida-overlay-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.vida-overlay-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.vida-analysis-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.vida-analysis-stat {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.vida-analysis-stat strong {
  display: block;
  font-size: 20px;
  margin-bottom: 2px;
}

.vida-analysis-stat span {
  font-size: 12px;
  color: var(--text-secondary);
}

.vida-analysis-stat small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.vida-analysis-insights p {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.08);
  font-size: 13px;
  color: var(--text-secondary);
}

.vida-analysis-project,
.vida-analysis-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.vida-album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.vida-album-item {
  aspect-ratio: 1;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.vida-album-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}

.vida-photo-strip--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.vida-highlight-item--overlay {
  margin-bottom: 10px;
}

.vida-places-list--overlay {
  margin-top: 12px;
}

.vida-map--overlay {
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .vida-body { grid-template-columns: 1fr; }
  .vida-sidebar { order: -1; }
  .vida-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vida-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vida-timeline-item { grid-template-columns: 36px minmax(0, 1fr) 88px; }
  .vida-thumb--photo { width: 88px; min-width: 88px; height: 64px; }
}

@media (max-width: 640px) {
  .vida-photo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vida-summary-grid { grid-template-columns: 1fr; }
  .vida-timeline-item { grid-template-columns: 32px 1fr; }
  .vida-thumb--photo { display: none; }
  .vida-bottom-nav { justify-content: flex-start; }
  .vida-bottom-btn { flex: 0 0 auto; min-width: 56px; }
}

/* ===== Projects page (escritorio) ===== */
.projects-scroll { padding-bottom: 24px; }
.projects-page { display: flex; flex-direction: column; gap: 16px; }
.projects-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.projects-header-left { display: flex; align-items: flex-start; gap: 14px; }
.projects-header-icon { width: 42px; height: 42px; border-radius: 10px; background: rgba(139,92,246,.15); border: 1px solid rgba(139,92,246,.25); display: flex; align-items: center; justify-content: center; color: var(--purple-bright); flex-shrink: 0; }
.projects-header-icon svg { width: 20px; height: 20px; }
.projects-title { font-size: 22px; font-weight: 700; margin: 0; color: var(--text); }
.projects-subtitle { font-size: 13px; color: var(--text2); margin: 4px 0 0; line-height: 1.45; }
.btn-new-project { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 10px 16px; font-size: 13px; }
.btn-new-project svg { width: 16px; height: 16px; }
.projects-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .projects-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 14px; }
.stat-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card-icon svg { width: 18px; height: 18px; }
.stat-card-icon.purple { background: rgba(139,92,246,.2); color: var(--purple-bright); }
.stat-card-icon.blue { background: rgba(59,130,246,.2); color: #60a5fa; }
.stat-card-icon.green { background: rgba(34,197,94,.2); color: var(--green); }
.stat-card-icon.orange { background: rgba(249,115,22,.2); color: #fb923c; }
.stat-card-label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 2px; }
.stat-card-value { font-size: 22px; font-weight: 700; color: var(--text); }
.projects-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; }
.search-box svg { width: 16px; height: 16px; color: var(--text2); flex-shrink: 0; }
.search-box input { flex: 1; font-size: 13px; color: var(--text); background: transparent; border: none; outline: none; min-width: 0; }
.toolbar-select { padding: 8px 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; font-size: 12px; color: var(--text2); }
.view-toggle { display: flex; gap: 4px; margin-left: auto; }
.view-toggle-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; color: var(--text2); background: transparent; cursor: pointer; }
.view-toggle-btn svg { width: 16px; height: 16px; }
.view-toggle-btn.active, .view-toggle-btn:hover { background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.3); color: var(--purple-bright); }
.projects-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .projects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.projects-grid.list-view { grid-template-columns: 1fr; }
.projects-grid .project-card { cursor: pointer; }
.project-card { background: rgba(16,18,28,.85); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 168px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.project-card:hover { border-color: rgba(139,92,246,.35); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.project-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.project-card-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.project-card-icon.purple { background: rgba(139,92,246,.15); color: var(--purple-bright); }
.project-card-icon.blue { background: rgba(59,130,246,.15); color: #60a5fa; }
.project-card-icon.green { background: rgba(34,197,94,.15); color: #4ade80; }
.project-card-icon.orange { background: rgba(249,115,22,.15); color: #fb923c; }
.project-card-icon.pink { background: rgba(236,72,153,.15); color: #f472b6; }
.project-card-icon.red { background: rgba(239,68,68,.15); color: #f87171; }
.project-card-icon.yellow { background: rgba(234,179,8,.15); color: #facc15; }
.project-card-icon.indigo { background: rgba(99,102,241,.15); color: #818cf8; }
.project-card-icon.cyan { background: rgba(6,182,212,.15); color: #22d3ee; }
.project-card-icon.gray { background: rgba(148,163,184,.15); color: #94a3b8; }
.project-card-emoji { font-size: 18px; line-height: 1; }
.project-card-bell { color: var(--text2); padding: 4px; border-radius: 6px; opacity: .5; background: none; border: none; cursor: pointer; }
.project-card:hover .project-card-bell { opacity: 1; }
.project-card-bell svg { width: 15px; height: 15px; }
.project-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.project-card-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 10px; width: fit-content; }
.project-card-badge.progress { background: rgba(139,92,246,.15); color: var(--purple-bright); }
.project-card-badge.active { background: rgba(34,197,94,.15); color: var(--green); }
.project-card-badge.paused { background: rgba(148,163,184,.15); color: var(--text2); }
.project-card-badge.done { background: rgba(59,130,246,.15); color: #60a5fa; }
.project-card-desc { font-size: 11px; color: var(--text2); line-height: 1.4; flex: 1; margin: 0; }
.project-card-progress { display: flex; align-items: center; gap: 8px; }
.project-card-progress .progress-bar { flex: 1; height: 4px; margin-top: 0; }
.progress-fill { height: 100%; border-radius: 2px; }
.progress-fill.purple { background: var(--purple); }
.project-card-progress span { font-size: 11px; color: var(--text2); min-width: 32px; text-align: right; }
.project-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--text2); padding-top: 4px; border-top: 1px solid var(--border); }
.project-card-time { display: inline-flex; align-items: center; gap: 5px; }
.project-card-time svg { width: 12px; height: 12px; flex-shrink: 0; }
.project-card-menu { color: var(--text2); padding: 4px; border-radius: 4px; opacity: .6; background: none; border: none; cursor: pointer; }
.project-card-menu svg { width: 16px; height: 16px; }
.project-card:hover .project-card-menu { opacity: 1; }
.projects-empty { text-align: center; padding: 48px 24px; background: rgba(255,255,255,.03); border: 1px dashed var(--border); border-radius: 14px; }
.projects-empty-icon { font-size: 40px; margin-bottom: 12px; }
.projects-empty h3 { font-size: 18px; margin: 0 0 6px; color: var(--text); }
.projects-empty p { font-size: 13px; color: var(--text2); margin: 0 0 16px; }
.projects-footer { display: flex; justify-content: center; padding: 8px 0 4px; }
.projects-see-all { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text2); padding: 8px 16px; border-radius: 8px; background: none; border: none; cursor: pointer; }
.projects-see-all svg { width: 16px; height: 16px; }
.projects-see-all:hover { color: var(--purple-bright); background: rgba(139,92,246,.08); }
.project-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 5000; padding: 24px; }
.project-modal { width: 100%; max-width: 480px; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }
.project-modal-title { font-size: 18px; margin: 0 0 16px; color: var(--text); }
.project-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }


.vida-header-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.vida-btn-outline { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.08); color: var(--purple-bright); font-size: 13px; font-weight: 600; white-space: nowrap; }
.vida-btn-outline svg { width: 15px; height: 15px; }
.vida-empty-inline { color: var(--text2); font-size: 13px; padding: 16px 0; }
.vida-examples-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vida-examples-banner.hidden { display: none !important; }
.vida-examples-banner span { color: var(--purple-bright); font-size: 13px; font-weight: 600; }
.vida-examples-banner small { color: var(--text2); font-size: 11px; }
.vida-np.hidden { display: none !important; }
#vida-create-view { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

/* ===== Nuevo proyecto de vida ===== */
.vnp-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #0a0a12; }
.vnp-header { display: flex; align-items: flex-start; gap: 14px; padding: 8px 6px 16px; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.vnp-back { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 4px; }
.vnp-back svg { width: 18px; height: 18px; }
.vnp-header-text { flex: 1; min-width: 0; }
.vnp-header-text h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.vnp-header-text p { font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }
.vnp-templates-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(139,92,246,.35); background: rgba(139,92,246,.08); color: var(--purple-bright); font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.vnp-templates-btn svg { width: 16px; height: 16px; }
.vnp-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 16px 6px; scrollbar-width: none; }
.vnp-body::-webkit-scrollbar { display: none; }
.vnp-main { display: flex; flex-direction: column; gap: 14px; }
.vnp-section { background: rgba(16,18,28,.9); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.vnp-section-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.vnp-section-head h2 { font-size: 16px; font-weight: 600; }
.vnp-section-head p { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.vnp-num { width: 28px; height: 28px; border-radius: 50%; background: var(--purple); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vnp-basic-grid { display: grid; grid-template-columns: 1fr 200px; gap: 16px; }
.vnp-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.vnp-input, .vnp-textarea, .vnp-select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-light); background: rgba(255,255,255,.03); color: var(--text-primary); font-size: 13px; margin-bottom: 12px; }
.vnp-textarea { min-height: 100px; resize: vertical; }
.vnp-char-count { display: block; text-align: right; font-size: 11px; color: var(--text-muted); margin-top: -8px; }
.vnp-hero-visual { position: relative; }
.vnp-hero-img { width: 100%; height: 160px; border-radius: 50%; background-size: cover; background-position: center; border: 3px solid rgba(139,92,246,.25); }
.vnp-hero-badge { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; border-radius: 50%; background: var(--purple); border: 2px solid #1a1030; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 0 16px rgba(139,92,246,.5); }
.vnp-hero-badge svg { width: 16px; height: 16px; }
.vnp-areas-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.vnp-area-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.02); color: var(--text-secondary); font-size: 11px; text-align: center; min-height: 88px; transition: all .15s; }
.vnp-area-card.selected { border-color: rgba(139,92,246,.5); background: rgba(139,92,246,.12); color: var(--purple-bright); }
.vnp-area-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(139,92,246,.12); display: flex; align-items: center; justify-content: center; color: var(--purple-bright); }
.vnp-area-icon svg { width: 18px; height: 18px; }
.vnp-hint { font-size: 11px; color: var(--text-muted); margin-top: 10px; }
.vnp-objective-row { display: grid; grid-template-columns: 28px 1fr 130px; gap: 8px; align-items: center; margin-bottom: 8px; }
.vnp-objective-icon { color: var(--purple-bright); display: flex; }
.vnp-objective-icon svg { width: 18px; height: 18px; }
.vnp-objective-input { margin-bottom: 0; }
.vnp-add-obj { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 12px; border-radius: 8px; border: 1px dashed rgba(139,92,246,.4); color: var(--purple-bright); font-size: 12px; background: transparent; }
.vnp-values { display: flex; flex-wrap: wrap; gap: 8px; }
.vnp-value-pill { padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text-secondary); font-size: 12px; }
.vnp-value-pill.selected { border-color: rgba(139,92,246,.45); background: rgba(139,92,246,.15); color: var(--purple-bright); }
.vnp-custom-value { display: flex; gap: 8px; margin-top: 12px; }
.vnp-custom-value .vnp-input { margin-bottom: 0; flex: 1; }
.vnp-value-add { width: 40px; border-radius: 10px; border: 1px solid var(--border); background: rgba(139,92,246,.12); color: var(--purple-bright); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vnp-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.vnp-photo-slot { width: 100px; height: 100px; border-radius: 12px; border: 1px dashed var(--border-light); overflow: hidden; position: relative; }
.vnp-photo-upload { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-muted); font-size: 10px; text-align: center; padding: 8px; cursor: pointer; }
.vnp-photo-upload svg { width: 20px; height: 20px; color: var(--purple-bright); }
.vnp-photo-filled img { width: 100%; height: 100%; object-fit: cover; }
.vnp-photo-remove { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; border: none; font-size: 14px; line-height: 1; }
.vnp-sidebar { display: flex; flex-direction: column; gap: 12px; }
.vnp-card { background: rgba(16,18,28,.9); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.vnp-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.vnp-summary-hero { height: 80px; border-radius: 10px; background-size: cover; background-position: center; margin-bottom: 12px; }
.vnp-summary-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.vnp-summary-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.vnp-summary-list span { color: var(--text-muted); }
.vnp-summary-list strong { color: var(--text-primary); font-weight: 600; }
.vnp-dot { color: var(--purple-bright) !important; }
.vnp-dot::before { content: '● '; font-size: 10px; }
.vnp-ronin-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.vnp-ronin-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.vnp-ronin-list svg { width: 16px; height: 16px; color: var(--purple-bright); flex-shrink: 0; margin-top: 1px; }
.vnp-examples { display: flex; flex-direction: column; gap: 8px; }
.vnp-example-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: rgba(255,255,255,.02); text-align: left; color: inherit; }
.vnp-example-card:hover { border-color: var(--border); }
.vnp-example-thumb { width: 44px; height: 44px; border-radius: 8px; background-size: cover; background-position: center; flex-shrink: 0; }
.vnp-example-card strong { display: block; font-size: 12px; }
.vnp-example-card p { font-size: 10px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }
.vnp-link { font-size: 12px; color: var(--purple-bright); margin-top: 10px; background: none; border: none; }
.vnp-footer { display: flex; justify-content: space-between; align-items: center; padding: 14px 6px; border-top: 1px solid var(--border); flex-shrink: 0; }
.vnp-btn-cancel { padding: 12px 20px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text-secondary); font-size: 13px; }
.vnp-btn-create { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; font-size: 13px; font-weight: 600; border: none; box-shadow: 0 4px 20px rgba(124,58,237,.35); }
.vnp-btn-create svg { width: 16px; height: 16px; }
.vnp-templates-modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 6000; padding: 24px; }
.vnp-templates-modal.hidden { display: none !important; }
.vnp-templates-card { background: #12151f; border: 1px solid var(--border-light); border-radius: 14px; padding: 20px; max-width: 520px; width: 100%; }
.vnp-templates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.vnp-template-card { padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.03); text-align: left; color: inherit; }
.vnp-template-emoji { font-size: 24px; display: block; margin-bottom: 6px; }
.vnp-template-card strong { font-size: 13px; display: block; }
.vnp-template-card p { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }
.vnp-modal-close { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 12px; }
.app-body.vida-mode .main-panel:has(#vida-create-view:not(.hidden)) { padding: 0 12px; }
@media (max-width: 1100px) {
  .vnp-body { grid-template-columns: 1fr; }
  .vnp-sidebar { order: -1; }
  .vnp-areas-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vnp-basic-grid { grid-template-columns: 1fr; }
  .vnp-hero-visual { display: none; }
}
@media (max-width: 640px) {
  .vnp-areas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vnp-objective-row { grid-template-columns: 24px 1fr; }
  .vnp-objective-term { grid-column: 2; }
  .vnp-header { flex-wrap: wrap; }
  .vnp-templates-btn { width: 100%; justify-content: center; }
}


