/* ============================================================
   Veltor Agenda — Sistema de diseño completo
   Mobile-first. Paleta cálida. Tipografía Inter.
   ============================================================ */

/* --- Variables --- */
:root {
  --bg:            #f5f3ef;
  --bg-white:      #ffffff;
  --surface:       #fefefe;
  --surface-hover: #f0ede6;

  --border:        #e6e2d9;
  --border-light:  #f0ede6;

  --text:          #1a1917;
  --text-soft:     #575350;
  --text-muted:    #575350;

  --accent:        #2a6049;
  --accent-dark:   #1e4535;
  --accent-light:  #e8f4ef;
  --accent-mid:    #4a8a6f;

  --type-tarea:       #2a6049;
  --type-nota:        #3b6fbf;
  --type-idea:        #c47a1a;
  --type-record:      #7c4daa;
  --type-nota-light:  #dbeafe;
  --type-idea-light:  #fef9c3;
  --type-record-light:#ede9fe;

  --done-bg:       #f0fdf4;
  --done-text:     #166534;
  --pin-bg:        #fefce8;
  --pin-border:    #fde68a;
  --drag-bg:       #fff7ed;
  --drag-border:   #fed7aa;

  --danger:        #dc2626;
  --danger-light:  #fef2f2;
  --success:       #16a34a;
  --success-light: #f0fdf4;
  --warning:       #d97706;

  --radius-sm:  4px;
  --radius:     8px;
  --radius-md:  10px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  /* Escala tipográfica (rem, respeta el tamaño de letra del navegador).
     Las vistas aún fijan el font-size a mano caso por caso; estos tokens
     son el punto de partida para ir consolidando esos valores. */
  --text-xs:   .75rem;
  --text-sm:   .875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow:    0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);

  /* Alias de compatibilidad: varios componentes (calendario, búsqueda,
     atajos de teclado) referencian estos nombres, que no llegaron a
     definirse cuando se migró a --text/--surface-hover/--surface. */
  --text-main: var(--text);
  --bg-hover:  var(--surface-hover);
  --bg-soft:   var(--surface);

  --nav-width:     220px;
  --nav-collapsed: 64px;
  --header-h:      56px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --scroll-track:        #e4dfd5;
  --scroll-thumb:        #bfb8ae;
  --scroll-thumb-hover:  #2a6049;
}

/* --- Reset mínimo --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select {
  font-family: var(--font);
  font-size: 1rem;
  border: none;
  outline: none;
  background: none;
}
/* ============================================================
   SCROLLBARS — Estilo personalizado (solo dispositivos con puntero fino)
   ============================================================ */
@media (pointer: fine) {
  ::-webkit-scrollbar              { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track        { background: var(--scroll-track); border-radius: 3px; }
  ::-webkit-scrollbar-thumb        { background: var(--scroll-thumb); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover  { background: var(--scroll-thumb-hover); }
  ::-webkit-scrollbar-corner       { background: var(--scroll-track); }
  *                                 { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
}

/* WCAG AA: indicadores de foco visibles para navegación por teclado */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
/* Skip link: solo visible al recibir foco (teclado) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top .15s;
}
.skip-link:focus {
  top: 0;
}
/* Clase utilitaria para ocultar visualmente pero mantener para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
button { cursor: pointer; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* --- Tipografía --- */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { line-height: 1.65; }

/* ============================================================
   LAYOUT — Sidebar + main
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100dvh;
}

/* Sidebar */
.sidebar {
  width: var(--nav-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  z-index: 100;
  transition: transform .25s ease, width .25s ease;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
}
.sidebar-brand-link { flex: 1; min-width: 0; }
.sidebar-logo {
  height: 32px;
  width: auto;
  display: block;
}
img.logo-dark { display: none !important; }
html.dark img.logo-light { display: none !important; }
html.dark img.logo-dark { display: block !important; }

/* Favicon para sidebar colapsado */
.sidebar-favicon { display: none !important; }

/* Botón flotante de colapsar sidebar */
.sidebar-collapse-btn {
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,.10);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 102;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  transition: color .15s, background .15s, border-color .15s, opacity .2s;
}
.sidebar:hover .sidebar-collapse-btn,
html.sidebar-collapsed .sidebar-collapse-btn { opacity: 1; }
.sidebar-collapse-btn:hover {
  color: var(--accent);
  background: var(--accent-light);
  border-color: var(--accent);
}
.sidebar-collapse-btn i { font-size: 13px; transition: transform .25s ease; }

.sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: 12px 10px;
  overflow-y: auto;
}
.nav-group {
  margin-bottom: 20px;
}
.nav-group-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 0 8px;
  margin-bottom: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item i, .nav-item .ti { font-size: 18px; flex-shrink: 0; line-height: 1; }
button.nav-item { width: 100%; background: none; border: none; text-align: left; font-size: .9rem; font-family: inherit; color: var(--text-soft); }

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border-light);
}
.streak-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--pin-bg);
  border: 1px solid var(--pin-border);
  border-radius: var(--radius);
  font-size: .82rem;
  color: var(--warning);
  font-weight: 600;
  margin-bottom: 10px;
}
.streak-badge svg { width: 16px; }

/* Main content */
.main-content {
  flex: 1;
  margin-left: var(--nav-width);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}

/* Top header (dentro de main) */
.page-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header .page-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}
.page-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Contenido de página */
.page-body {
  flex: 1;
  padding: 28px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}
.page-body.wide {
  max-width: 1100px;
}

/* ============================================================
   COMPONENTES COMUNES
   ============================================================ */

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, opacity .15s, transform .1s;
  cursor: pointer;
  line-height: 1.4;
}
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost    { color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger   { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm       { padding: 5px 10px; font-size: .8rem; }
.btn-icon     { padding: 6px; border-radius: var(--radius-sm); }
.btn svg      { width: 16px; height: 16px; }
.btn-icon svg { width: 16px; height: 16px; }

/* Formularios */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .83rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,96,73,.12);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }
.pw-field { position: relative; }
.pw-field .form-control { padding-right: 42px; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; display: flex; align-items: center; line-height: 1; }
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: .75;
  filter: invert(27%) sepia(30%) saturate(800%) hue-rotate(110deg) brightness(85%);
}
html.dark input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(65%) sepia(25%) saturate(500%) hue-rotate(100deg) brightness(95%);
}

/* Alertas */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-error   { background: var(--danger-light); border-color: #fca5a5; color: var(--danger); }
.alert-success { background: var(--success-light); border-color: #86efac; color: var(--success); }
.alert-info    { background: var(--accent-light); border-color: #6ee7b7; color: var(--accent); }

.streak-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid;
}
.streak-status i { font-size: 18px; flex-shrink: 0; }
.streak-status.is-safe { background: var(--success-light); border-color: #86efac; color: var(--success); }
.streak-status.is-risk { background: var(--warning-light, #fef3e2); border-color: #fcd34d; color: var(--warning); }
html.dark .streak-status.is-risk { background: rgba(217,119,6,.12); }

/* Cards */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-title {
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Dividers */
.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 20px 0;
}

/* ============================================================
   VISTA DE DÍA — AGENDA
   ============================================================ */

/* Navegación de día */
.day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.day-nav-center {
  text-align: center;
  flex: 1;
}
.day-nav-date {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.day-nav-sub {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.day-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-soft);
  transition: background .15s;
  flex-shrink: 0;
}
.day-nav-btn:hover { background: var(--surface-hover); color: var(--text); }
.day-nav-btn svg { width: 20px; height: 20px; }
.day-nav-btn i, .day-nav-btn .ti { font-size: 20px; line-height: 1; }

/* Foco de ayer */
.yesterday-focus {
  padding: 12px 16px;
  background: var(--pin-bg);
  border: 1px solid var(--pin-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .875rem;
  line-height: 1.5;
}
.yesterday-focus-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.yesterday-focus-text {
  color: var(--text-soft);
  font-style: italic;
}

/* Intención del día */
.day-intention {
  padding: 14px 18px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
  font-size: .9rem;
  color: var(--accent-dark);
  line-height: 1.55;
}
.day-intention-label {
  font-size: .73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent-mid);
  margin-bottom: 4px;
}

/* Entrada rápida */
.entry-composer {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 8px 6px 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
}
.entry-composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,96,73,.1);
}
.entry-composer-type {
  flex-shrink: 0;
  position: relative;
}
.entry-input {
  flex: 1;
  padding: 10px 8px;
  font-size: .95rem;
  color: var(--text);
  background: transparent;
  resize: none;
  line-height: 1.5;
  min-height: 42px;
  max-height: 160px;
  overflow-y: auto;
  border: none !important;
  outline: none !important;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none !important;
  border-radius: 8px;
}
.entry-input::placeholder { color: var(--text-muted); }
.entry-composer-submit {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, opacity .15s;
  opacity: 0;
  pointer-events: none;
}
.entry-composer:focus-within .entry-composer-submit,
.entry-composer:hover .entry-composer-submit {
  opacity: 1;
  pointer-events: all;
}
.entry-composer-submit:hover { background: var(--accent-dark); }
.entry-composer-submit svg { width: 16px; height: 16px; }

/* Icono sort-ascending (Tabler Icons, importado desde yesicon.app) */
.icon-sort-asc {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url('../img/sort-asc.svg') no-repeat center / contain;
  mask: url('../img/sort-asc.svg') no-repeat center / contain;
}

/* Fila compositor + botón de ordenar */
.composer-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.composer-row .entry-composer {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.sort-entries-btn {
  flex-shrink: 0;
  width: 38px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
}
.sort-entries-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* Lista de entradas */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.entries-empty {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: .9rem;
}
.entries-empty span { display: block; font-size: 1rem; margin-bottom: 10px; color: var(--accent-mid); }
.entries-empty span i { font-size: 2rem !important; }

/* Entrada individual */
.entry-item {
  display: flex;
  flex-wrap: wrap; /* permite que el panel de subtareas ocupe su propia línea */
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: background .1s, border-color .1s, box-shadow .15s;
  position: relative;
  cursor: default;
  user-select: none;
}
.entry-item:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.entry-item.is-pinned {
  background: var(--pin-bg);
  border-color: var(--pin-border);
}
.entry-item.is-done {
  background: var(--done-bg);
  border-color: #d1fae5;
  opacity: .75;
}
.entry-item.type-nota.is-done,
.entry-item.type-idea.is-done {
  background: var(--surface);
  border-color: var(--border);
}
.entry-item.entry-loading {
  opacity: .55;
  pointer-events: none;
}
.entry-item.dragging {
  opacity: .5;
  box-shadow: var(--shadow-md);
}
.entry-item.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* Drag handle */
.entry-drag {
  flex-shrink: 0;
  color: var(--text-muted);
  cursor: grab;
  padding: 2px;
  opacity: 0;
  transition: opacity .15s;
  margin-top: 2px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.entry-item:hover .entry-drag { opacity: 1; }
@media (hover: none) { .entry-drag { opacity: 1; } }
.entry-drag:active { cursor: grabbing; }
.entry-drag svg { width: 14px; height: 14px; }
.entry-drag i, .entry-drag .ti { font-size: 14px; line-height: 1; }
.entry-item.touch-over { box-shadow: 0 -3px 0 var(--accent); }

/* Tipo indicador + checkbox */
.entry-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  margin-top: 2px;
  position: relative;
}
/* Área de toque real ampliada a 28x28 (WCAG 2.5.8) sin agrandar el círculo visible */
.entry-check::after { content: ''; position: absolute; inset: -4px; }
.entry-item.type-tarea         .entry-check { border-color: var(--type-tarea);  }
.entry-item.type-nota          .entry-check { border-color: var(--type-nota);   }
.entry-item.type-idea          .entry-check { border-color: var(--type-idea);   }
.entry-item.type-recordatorio  .entry-check { border-color: var(--type-record); }
@media (hover: hover) and (pointer: fine) {
  .entry-item.type-tarea:hover         .entry-check { background: var(--accent-light); }
  .entry-item.type-nota:hover          .entry-check { background: #dbeafe; }
  .entry-item.type-idea:hover          .entry-check { background: #fef9c3; }
  .entry-item.type-recordatorio:hover  .entry-check { background: #ede9fe; }
}
@media (hover: hover) and (pointer: fine) {
  html.dark .entry-item.type-nota:hover          .entry-check { background: #182035; }
  html.dark .entry-item.type-idea:hover          .entry-check { background: #2a2010; }
  html.dark .entry-item.type-recordatorio:hover  .entry-check { background: #221828; }
}
.entry-item.type-tarea.is-done         .entry-check { background: var(--type-tarea);  border-color: var(--type-tarea);  }
.entry-item.type-nota.is-done          .entry-check { background: var(--type-nota);   border-color: var(--type-nota);   }
.entry-item.type-idea.is-done          .entry-check { background: var(--type-idea);   border-color: var(--type-idea);   }
.entry-item.type-recordatorio.is-done  .entry-check { background: var(--type-record); border-color: var(--type-record); }
@media (hover: hover) and (pointer: fine) {
  .entry-item.is-done .entry-check:hover {
    background: var(--danger);
    border-color: var(--danger);
  }
}
.entry-check svg { width: 11px; height: 11px; color: #fff; display: none; }
.entry-item.is-done .entry-check svg { display: block; }
.entry-check i { font-size: 11px; color: #fff; display: none; line-height: 1; }
.entry-item.is-done .entry-check i { display: block; }

/* Borde izquierdo por tipo */
.entry-item.type-tarea        { border-left: 3px solid var(--type-tarea); }
.entry-item.type-nota         { border-left: 3px solid var(--type-nota); }
.entry-item.type-idea         { border-left: 3px solid var(--type-idea); }
.entry-item.type-recordatorio { border-left: 3px solid var(--type-record); }
/* Preservar el borde izquierdo cuando la entrada está completada o fijada */
.entry-item.type-tarea.is-done,
.entry-item.type-tarea.is-pinned        { border-left-color: var(--type-tarea); }
.entry-item.type-nota.is-done,
.entry-item.type-nota.is-pinned         { border-left-color: var(--type-nota); }
.entry-item.type-idea.is-done,
.entry-item.type-idea.is-pinned         { border-left-color: var(--type-idea); }
.entry-item.type-recordatorio.is-done,
.entry-item.type-recordatorio.is-pinned { border-left-color: var(--type-record); }

/* Indicador clickable nota/idea (punto sin icono) */
.entry-indicator {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 2px;
  position: relative;
}
/* Área de toque real ampliada a 28x28 (WCAG 2.5.8) sin agrandar el punto visible */
.entry-indicator::after { content: ''; position: absolute; inset: -4px; }
.entry-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: transform .15s, opacity .15s;
}
.entry-item.type-nota .entry-indicator::before { background: var(--type-nota); }
.entry-item.type-idea .entry-indicator::before { background: var(--type-idea); }
@media (hover: hover) and (pointer: fine) {
  .entry-indicator:hover::before { transform: scale(1.5); }
}
.entry-indicator.done::before { opacity: .35; }

/* Contenido de entrada */
.entry-content {
  flex: 1;
  min-width: 0;
}
.entry-text {
  font-size: .925rem;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  cursor: text;
  touch-action: manipulation;
}
.entry-item.is-done .entry-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.entry-text-edit {
  width: 100%;
  font-size: .925rem;
  color: var(--text);
  line-height: 1.5;
  background: transparent;
  border-bottom: 1px solid var(--accent);
  padding: 1px 0;
  resize: none;
  overflow: hidden;
}
.entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.entry-tag {
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 500;
}
.tag-tarea       { background: var(--accent-light); color: var(--accent); }
.tag-nota        { background: #dbeafe; color: #1d4ed8; }
.tag-idea        { background: #fef3c7; color: #92400e; }
.tag-recordatorio{ background: #ede9fe; color: #6d28d9; }
html.dark .tag-nota        { background: #182035; color: #6a9fe0; }
html.dark .tag-idea        { background: #2a2010; color: #c8902a; }
html.dark .tag-recordatorio{ background: #221828; color: #9a68d0; }
.tag-arrastrada  { background: var(--drag-bg); color: var(--warning); }
.tag-pinned      { background: var(--pin-bg); color: var(--warning); }

.entry-objective-link {
  font-size: .72rem;
  color: var(--accent-mid);
  display: flex;
  align-items: center;
  gap: 3px;
}
.entry-objective-link svg { width: 11px; height: 11px; }

/* Acciones de entrada */
.entry-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
}
.entry-item:hover .entry-actions { opacity: 1; }
.entry-item.is-pinned .entry-actions { opacity: 1; }
.entry-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background .15s, color .15s;
  cursor: pointer;
}
.entry-action-btn:hover { background: var(--surface-hover); color: var(--text); }
.entry-action-btn.danger:hover { background: var(--danger-light); color: var(--danger); }
.entry-action-btn svg { width: 14px; height: 14px; }
.entry-action-btn i, .entry-action-btn .ti { font-size: 14px; line-height: 1; }
.entry-action-btn.pinned { color: var(--accent); }

/* ============================================================
   SECCIÓN DE OBJETIVOS SEMANALES (sidebar derecho o panel)
   ============================================================ */
.objectives-panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}
.objectives-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.objectives-panel-title {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.objective-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .875rem;
}
.objective-item:last-child { border-bottom: none; }
.objective-check {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  position: relative;
}
/* Área de toque real ampliada a 24x24 (mínimo WCAG 2.5.8) sin agrandar la casilla visible */
.objective-check::after { content: ''; position: absolute; inset: -4px; }
.objective-check.done {
  background: var(--accent);
  border-color: var(--accent);
}
.objective-check svg { width: 10px; color: #fff; display: none; }
.objective-check.done svg { display: block; }
.objective-check i, .objective-check .ti { font-size: 10px; color: #fff; display: none; line-height: 1; }
.objective-check.done i, .objective-check.done .ti { display: block; }
.objective-text {
  flex: 1;
  line-height: 1.4;
  color: var(--text);
}
.objective-check.done + .objective-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.objective-progress {
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.objectives-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  color: var(--text-muted);
  font-size: .83rem;
  cursor: pointer;
  margin-top: 6px;
  transition: color .15s;
}
.objectives-add:hover { color: var(--accent); }
.objectives-add svg { width: 14px; }
.objectives-add-input {
  flex: 1;
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
  padding: 2px 0;
}

/* ============================================================
   RITUALS — Apertura y Cierre
   ============================================================ */
.ritual-page {
  max-width: 580px;
  margin: 0 auto;
}
.ritual-header {
  text-align: center;
  margin-bottom: 32px;
}
.ritual-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  color: var(--accent);
}
.ritual-title {
  font-size: 1.5rem;
  font-weight: 700;
}
.ritual-subtitle {
  color: var(--text-soft);
  font-size: .95rem;
  margin-top: 6px;
}
.ritual-date-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 10px;
}
.ritual-form {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
}
.ritual-question {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.ritual-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  resize: vertical;
  min-height: 100px;
  line-height: 1.65;
  transition: border-color .15s;
}
.ritual-textarea:focus { border-color: var(--accent); outline: none; }
.ritual-section + .ritual-section { margin-top: 24px; }
.ritual-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Mood selector */
.mood-selector {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.mood-btn {
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
  transition: transform .15s, background .15s;
  opacity: .6;
  border: 2px solid transparent;
}
.mood-btn:hover { transform: scale(1.2); opacity: 1; }
.mood-btn.selected {
  opacity: 1;
  background: var(--surface-hover);
  border-color: var(--border);
  transform: scale(1.1);
}

/* ============================================================
   REVISIÓN SEMANAL
   ============================================================ */
.review-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.review-stat {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}
.review-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.review-stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Progress bar */
.progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .5s ease;
}

/* Objectives status */
.obj-status-list { display: flex; flex-direction: column; gap: 8px; }
.obj-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
}
.obj-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.obj-status-dot.activo    { background: var(--warning); }
.obj-status-dot.completado{ background: var(--success); }
.obj-status-dot.abandonado{ background: var(--text-muted); }

/* ============================================================
   ESTADÍSTICAS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.stat-card-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-card-label {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.stat-card-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Activity heatmap */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  gap: 3px;
  margin-top: 12px;
}
.activity-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--border-light);
  transition: transform .1s;
  cursor: default;
  position: relative;
}
.activity-cell:hover { transform: scale(1.2); }
.activity-cell.level-1 { background: #bbf7d0; }
.activity-cell.level-2 { background: #4ade80; }
.activity-cell.level-3 { background: #16a34a; }
.activity-cell.level-4 { background: #14532d; }

/* ============================================================
   SEMANA
   ============================================================ */
.week-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 8px;
  min-width: 700px;
}
.week-day {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 10px;
  min-height: 120px;
}
.week-day.is-today {
  border-color: var(--accent);
  background: var(--accent-light);
}
.week-day-header {
  margin-bottom: 8px;
}
.week-day-name {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .4px;
}
.week-day-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-top: 2px;
}
.week-day.is-today .week-day-num { color: var(--accent); }
.week-entry-count {
  font-size: .75rem;
  color: var(--text-muted);
}
.week-entry-pill {
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.week-entry-pill.done {
  background: var(--done-bg);
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ============================================================
   TOUR GUIADO
   ============================================================ */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  transition: background .25s;
}
.tour-overlay.tour-overlay-dim {
  background: rgba(0, 0, 0, 0.55);
}

/* El elemento destacado flota sobre el overlay con efecto spotlight */
.tour-hl {
  position: relative !important;
  z-index: 9001 !important;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.55), 0 0 0 3px var(--accent) !important;
  border-radius: var(--radius) !important;
}
/* Anillo pulsante: en un ::after aparte porque las animaciones CSS no
   pueden sobreescribir el box-shadow !important de arriba */
.tour-hl::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--accent);
  pointer-events: none;
  animation: tourPulse 1.6s ease-in-out infinite;
}
@keyframes tourPulse {
  0%, 100% { opacity: .6;  transform: scale(1); }
  50%      { opacity: 0;   transform: scale(1.06); }
}

.tour-tooltip {
  position: fixed;
  z-index: 9002;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  pointer-events: all;
  animation: tourIn .22s ease;
}
@keyframes tourIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
.tour-tooltip-center {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 380px !important;
}
.tour-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.tour-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-light, rgba(42,96,73,.12));
  color: var(--accent);
  font-size: 14px;
}
.tour-num {
  flex: 1;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tour-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: background .15s, color .15s;
}
.tour-close:hover { background: var(--surface-hover); color: var(--text); }
.tour-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.3;
}
.tour-text {
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 0 18px;
  line-height: 1.6;
}
.tour-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tour-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  transition: background .2s, width .2s;
}
.tour-dot.active {
  background: var(--accent);
  width: 20px;
}
.tour-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tour-btn-prev {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-soft);
  font-weight: 500;
  transition: background .15s;
}
.tour-btn-prev:hover { background: var(--surface-hover); }
.tour-btn-next {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.tour-btn-next:hover { background: var(--accent-dark); }

/* Dark mode */
html.dark .tour-hl {
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.65), 0 0 0 3px var(--accent-mid) !important;
}

@media (max-width: 767px) {
  .tour-tooltip {
    width: calc(100vw - 32px) !important;
    left: 16px !important;
    right: 16px !important;
    padding: 16px;
    box-sizing: border-box;
  }
  .tour-tooltip-center {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: calc(100vw - 32px) !important;
  }
  .tour-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .tour-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .tour-btn-prev, .tour-btn-next {
    padding: 8px 16px;
    font-size: 14px;
  }
}

/* ============================================================
   ARRASTRE DE TAREAS PENDIENTES
   ============================================================ */
.draggable-banner {
  background: var(--drag-bg);
  border: 1px solid var(--drag-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.draggable-info {
  font-size: .875rem;
  color: var(--warning);
  font-weight: 500;
}
.draggable-info span { font-weight: 700; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.settings-section-title {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.toggle-row:last-child { border-bottom: none; }

.toggle-label { font-size: .9rem; font-weight: 500; }
.toggle-desc  { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-body {
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
}
.landing-nav {
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.landing-brand { display: flex; align-items: center; }
.landing-logo {
  height: 28px;
  width: auto;
  display: block;
}
.landing-nav-links { display: flex; gap: 10px; }

.landing-hero {
  margin: 0 auto;
  padding: 88px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 120%;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, var(--accent-light) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.landing-hero > * { position: relative; z-index: 1; }
.landing-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 20px;
}
.landing-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -.5px;
}
.landing-hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.landing-hero-desc {
  font-size: 1.1rem;
  color: var(--text-soft);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 32px;
}
.landing-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* El boton de compra directa va dentro de un formulario, para poder llevar el
   token CSRF. Sin esto el formulario rompe la fila de botones. */
.landing-cta-premium { display: inline-flex; margin: 0; }

/* Landing de campaña: precio y resumen de Premium en el primer pantallazo.
   El precio va antes que el boton a proposito: quien llega desde un anuncio
   decide con el precio delante, no despues de pulsar. */
.hero-precio {
  margin: 18px 0 14px;
  text-align: center;
  line-height: 1.35;
}
.hero-precio strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text, #1a1a1a);
}
.hero-precio span {
  display: block;
  margin-top: 2px;
  font-size: .9rem;
  opacity: .7;
}

.hero-incluye {
  list-style: none;
  margin: 22px auto 0;
  padding: 0;
  max-width: 620px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  font-size: .92rem;
  opacity: .88;
}
.hero-incluye li { display: inline-flex; align-items: center; gap: 7px; }
.hero-incluye i { opacity: .75; }

@media (max-width: 600px) {
  .hero-incluye { flex-direction: column; align-items: flex-start; max-width: 320px; gap: 7px; }
  .hero-precio strong { font-size: 1.35rem; }
}

.landing-cta-premium > button { width: auto; }

.landing-preview {
  max-width: 720px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
.landing-preview-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.landing-preview-date {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: .5px;
}
.landing-preview-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.landing-preview-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .9rem;
  color: var(--text);
}
.landing-preview-entry:last-child { border-bottom: none; }
.landing-preview-entry .circle {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.landing-preview-entry .circle.done {
  background: var(--accent); border-color: var(--accent);
}
.landing-preview-entry .circle.done::after {
  content: '✓'; font-size: 10px; color: #fff; font-weight: 700;
}
.landing-preview-entry.done-entry span { text-decoration: line-through; color: var(--text-muted); }

.landing-features {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 70px 24px;
}
.features-grid {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature-icon {
  width: 44px; height: 44px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 1.3rem;
  color: var(--accent);
}
.feature-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.feature-desc  { font-size: .875rem; color: var(--text-soft); line-height: 1.6; }

/* Landing — How it works */
.landing-how {
  padding: 56px 24px 48px;
  max-width: 640px;
  margin: 0 auto;
}
.landing-section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 40px;
  letter-spacing: -.2px;
}
.landing-how-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.landing-how-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  position: relative;
}
/* Línea vertical conectando pasos */
.landing-how-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 21px;
  top: 44px;
  width: 2px;
  height: 36px;
  background: var(--border);
}
.landing-how-step + .landing-how-step {
  margin-top: 36px;
}
.landing-how-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}
.landing-how-step-title {
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  color: var(--text);
}
.landing-how-step-title i {
  color: var(--accent);
  font-size: 1.1rem;
}
.landing-how-step-text {
  font-size: .875rem;
  color: var(--text-soft);
  line-height: 1.65;
}
/* Landing — callout */
.landing-callout {
  max-width: 640px;
  margin: 0 auto 48px;
  padding: 20px 28px;
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
  border-radius: 0 12px 12px 0;
}
.landing-callout-text {
  font-size: .95rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin: 0;
  font-style: italic;
}
.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.landing-footer {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .83rem;
  border-top: 1px solid var(--border);
}
.landing-footer-author {
  margin-top: 6px;
  font-size: .76rem;
  color: var(--text-muted);
  opacity: .75;
}
.landing-footer-author a { color: inherit; text-decoration: none; }
.landing-footer-author a:hover { color: var(--accent); opacity: 1; }

/* Landing — trust strip con icono */
.landing-trust-strip {
  margin-top: 14px;
  font-size: .8rem;
  color: var(--text-muted);
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.landing-trust-strip i { font-size: .85rem; color: var(--accent); }

/* Landing — stats strip */
.landing-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 12px 24px 36px;
  flex-wrap: wrap;
}
.landing-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-soft);
}
.landing-stat i { color: var(--accent); font-size: 1.05rem; }
.ti-lock-open:before,
.ti-device-mobile:before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  vertical-align: -0.125em;
}
.ti-lock-open:before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M5 11m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z'/%3E%3Cpath d='M12 16m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0'/%3E%3Cpath d='M8 11v-4a4 4 0 0 1 8 0'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M5 11m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z'/%3E%3Cpath d='M12 16m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0'/%3E%3Cpath d='M8 11v-4a4 4 0 0 1 8 0'/%3E%3C/svg%3E");
}
.ti-device-mobile:before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14z'/%3E%3Cpath d='M11 4h2'/%3E%3Cpath d='M12 17v.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14z'/%3E%3Cpath d='M11 4h2'/%3E%3Cpath d='M12 17v.01'/%3E%3C/svg%3E");
}
.landing-stat-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

/* Landing — preview ritual badges */
.landing-preview-ritual {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.ritual-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(42,96,73,.15);
}
.ritual-badge-done {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(22,163,74,.15);
}

/* Landing — features section title */
.landing-features .landing-section-title { padding-top: 0; }

/* Landing — Why Veltor */
.landing-why {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px;
}
.landing-why-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.landing-why h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -.3px;
}
.landing-why-desc {
  font-size: .975rem;
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.landing-why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 28px;
  list-style: none;
  text-align: left;
}
.landing-why-grid li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: .875rem;
  color: var(--text-soft);
  line-height: 1.5;
}
.landing-why-grid li i {
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Landing — FAQ */
.landing-faq {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px;
}
.landing-faq .landing-section-title { margin-bottom: 32px; }
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-item {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .18s;
}
.faq-item[open] { border-color: var(--accent); }
.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 300;
  flex-shrink: 0;
  line-height: 1;
  transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: var(--surface-hover); }
.faq-answer {
  padding: 0 20px 16px 20px;
  font-size: .9rem;
  color: var(--text-soft);
  line-height: 1.75;
}

/* ============================================================
   LANDING DE CAMPAÑA (/es/agenda) — captura real en el hero,
   bloque "el problema" y grid de 3 capturas de producto
   ============================================================ */
.landing-hero-shot { max-width: 260px; margin: 8px auto 0; }
.landing-hero-shot img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
@media (max-width: 480px) {
  .landing-hero-shot { max-width: 210px; }
}

.landing-problem { max-width: 640px; margin: 0 auto; padding: 56px 24px; text-align: center; }
.landing-problem-list {
  list-style: none; padding: 0; margin: 24px 0;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.landing-problem-list li {
  font-size: .95rem; color: var(--text-soft);
  padding: 10px 18px; background: var(--surface);
  border-radius: 20px; border: 1px solid var(--border);
}
.landing-problem-close { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-top: 20px; }

.landing-shots-wrap { padding-bottom: 70px; }
.landing-shots {
  max-width: 900px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center;
}
.landing-shot img {
  width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto 14px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.landing-shot-caption { font-size: .95rem; font-weight: 600; color: var(--text); }
@media (max-width: 720px) {
  .landing-shots { grid-template-columns: 1fr; max-width: 320px; }
}

/* Landing — CTA final mejorado */
.landing-cta-final {
  padding: 0 24px 56px;
  margin: 0;
  background: none;
  border-radius: 0;
}
.landing-cta-final-inner {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: var(--radius-xl);
  padding: 56px 32px;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}
.landing-cta-final h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #fff;
}
.landing-cta-final-desc {
  font-size: .975rem;
  color: rgba(255,255,255,.82);
  line-height: 1.65;
  max-width: 440px;
  margin: 0 auto 28px;
}
.landing-cta-final .landing-trust-strip {
  color: rgba(255,255,255,.65);
  justify-content: center;
}
.landing-cta-final .landing-trust-strip i { color: rgba(255,255,255,.8); }
.btn-xl {
  padding: 16px 40px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn-xl:hover {
  background: #f0fdf4;
  color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
}

/* ============================================================
   AUTH FORMS
   ============================================================ */
.auth-body {
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-box {
  width: 100%;
  max-width: 400px;
}
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo {
  height: 40px;
  width: auto;
  display: inline-block;
}
.auth-brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.3px;
}
.auth-brand-sub {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.auth-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
}
.auth-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: .875rem;
  color: var(--text-soft);
  margin-bottom: 24px;
}
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: .85rem;
  color: var(--text-soft);
}
.auth-footer a { color: var(--accent); font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* ============================================================
   MODAL / POPOVER
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  animation: slideUp .2s ease;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Context menu */
.ctx-menu {
  position: absolute;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 150;
  min-width: 180px;
  padding: 4px;
  animation: fadeIn .1s ease;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}
.ctx-item:hover { background: var(--surface-hover); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: var(--danger-light); }
.ctx-item svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.ctx-item.danger svg { color: var(--danger); }
.ctx-divider { border-top: 1px solid var(--border-light); margin: 4px 0; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  max-width: 300px;
  box-shadow: var(--shadow-md);
  animation: slideUp .2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { background: var(--accent); }
.toast.error   { background: var(--danger); }
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Pill de tipo en composer */
.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}

/* ============================================================
   RESPONSIVE — Mobile first
   ============================================================ */

/* Mobile: ocultar sidebar, mostrar bottom nav */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding-bottom: 70px;
  }
  .page-body { padding: 16px; }
  .page-header { padding: 0 16px; }

  /* Entry-composer: type-picker compacto, botón enviar oculto (se usa el
     botón de ordenar disfrazado de "enviar" mientras el compositor tiene
     foco — ver _bindComposer en agenda.js). */
  #typePickerBtn span { display: none; }
  .type-picker-btn { padding: 6px 8px; gap: 3px; }
  .entry-composer-submit { display: none !important; }

  /* Formulario de objetivos en columna */
  #addObjForm > div {
    flex-direction: column;
    align-items: stretch;
  }
  #addObjForm .btn { width: 100%; justify-content: center; }

  /* Tarjetas de objetivos: menos padding en móvil, el desktop (20px) sobra */
  #objectivesList .card { padding: 12px 14px; }

  /* Acciones de entrada siempre visibles en mobile (sin hover) */
  .entry-actions { opacity: 1 !important; pointer-events: all !important; }

  .week-scroll { min-width: 0; }
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: unset; }
  .features-grid { grid-template-columns: 1fr; }
  .review-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr; }
  .landing-hero { max-width: 720px; }
  .landing-hero h1 { font-size: 2.1rem; }
  .landing-why-grid { grid-template-columns: 1fr; }
  .landing-stat-sep { display: none; }
  .landing-stats { gap: 14px; }
  .landing-cta-final-inner { padding: 40px 20px; }
  .landing-cta-final h2 { font-size: 1.4rem; }
  .activity-grid { grid-template-columns: repeat(14, 1fr); }
}

/* Bottom nav mobile */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  z-index: 100;
  height: 60px;
  padding: 0 8px;
}
.bottom-nav-items {
  display: flex;
  height: 100%;
  align-items: stretch;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 500;
  transition: color .15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item i, .bottom-nav-item .ti { font-size: 22px; line-height: 1; }

/* Hamburger */
.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 99;
}

@media (max-width: 768px) {
  .bottom-nav    { display: block; }
  .mobile-menu-btn { display: flex; }
  .sidebar-overlay.visible { display: block; }
  .sidebar { height: calc(100vh - 60px); }
  .toast-container { bottom: 76px; right: 16px; }
  .sidebar-collapse-btn { display: none !important; }
  .sidebar-user-actions {
    display: flex;
    gap: 4px;
  }
  .sidebar-user-actions .nav-item {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Tablet / medium */
@media (min-width: 769px) and (max-width: 1100px) {
  .week-grid { grid-template-columns: repeat(4, minmax(110px, 1fr)); }
  :root { --nav-width: 200px; }
}

/* ============================================================
   SIDEBAR COLAPSADO (solo desktop/tablet)
   ============================================================ */
@media (min-width: 769px) {
  html.sidebar-collapsed .sidebar { width: var(--nav-collapsed); }
  html.sidebar-collapsed .main-content { margin-left: var(--nav-collapsed); }

  /* Brand: oculta logo completo, muestra favicon centrado */
  html.sidebar-collapsed .sidebar-brand {
    padding: 14px 8px;
    justify-content: center;
  }
  /* Especificidad aumentada para ganar a html.dark img.logo-dark (0,2,2) */
  html.sidebar-collapsed .sidebar-brand .sidebar-logo { display: none !important; }
  /* Muestra solo el favicon correcto según modo */
  html.sidebar-collapsed:not(.dark) .sidebar-favicon.favicon-light { display: block !important; }
  html.dark.sidebar-collapsed        .sidebar-favicon.favicon-dark  { display: block !important; }

  /* Nav: oculta etiquetas y títulos de grupo, centra icono */
  html.sidebar-collapsed .nav-group-label { display: none; }
  html.sidebar-collapsed .nav-group { margin-bottom: 8px; }
  html.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 9px 8px;
    gap: 0;
  }
  html.sidebar-collapsed .nav-item span { display: none; }

  /* Footer: centra elementos, oculta textos */
  html.sidebar-collapsed .sidebar-footer { padding: 10px 8px; }
  html.sidebar-collapsed .streak-badge {
    justify-content: center;
    padding: 8px;
  }
  html.sidebar-collapsed .streak-badge span { display: none; }
  html.sidebar-collapsed .sidebar-user-actions { flex-direction: column; gap: 2px; }
  html.sidebar-collapsed .sidebar-user-actions .nav-item {
    flex: none;
    overflow: visible;
  }
  /* Submenú de espacios: solo se oculta al colapsar en desktop/tablet;
     en móvil (bloque fuera de este @media) siempre debe poder verse. */
  html.sidebar-collapsed .nav-sub,
  html.sidebar-collapsed .nav-sub-toggle { display: none !important; }

  /* Icono del botón de colapso se gira cuando está colapsado */
  html.sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.font-medium { font-weight: 500; }
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.w-full { width: 100%; }

/* ============================================================
   SELECTOR DE TIPO — Type Picker profesional
   ============================================================ */
.type-picker { position: relative; flex-shrink: 0; }
.type-picker-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.type-picker-btn:hover { background: var(--border); color: var(--text); }
.type-picker-icon { font-size: 15px; }
.type-picker-dropdown {
  position: fixed;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 500;
  min-width: 175px;
  overflow: hidden;
  padding: 4px 0;
}
.type-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: .875rem;
  color: var(--text);
  transition: background .1s;
}
.type-picker-option:hover { background: var(--surface-hover); }
.type-picker-option i { font-size: 16px; flex-shrink: 0; }

/* Dark toggle */
.dark-toggle-btn {
  width: 100%;
  text-align: left;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.dark-toggle-btn:hover { color: var(--text); background: var(--surface-hover); }

/* ============================================================
   MODO OSCURO — html.dark
   ============================================================ */
html.dark {
  --bg:            #1a1815;
  --bg-white:      #231f1c;
  --surface:       #2a2520;
  --surface-hover: #332e28;
  --border:        #3d3730;
  --border-light:  #302b26;
  --text:          #f0ede8;
  --text-soft:     #b0a89e;
  --text-muted:    #9e9690;
  --accent:        #4a9070;
  --accent-dark:   #3a7560;
  --accent-light:  #1a2e24;
  --accent-mid:    #5aa080;
  --done-bg:       #141e18;
  --done-text:     #4ade80;
  --pin-bg:        #231e08;
  --pin-border:    #403510;
  --drag-bg:       #251e12;
  --drag-border:   #4a3020;
  --type-nota:        #4a80c8;
  --type-idea:        #b07020;
  --type-record:      #7a50b8;
  --type-nota-light:  #182035;
  --type-idea-light:  #2a2010;
  --type-record-light:#221828;
  --danger-light:  #2a1010;
  --success-light: #101a14;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.3);
  --shadow:        0 2px 8px rgba(0,0,0,.35);
  --shadow-md:     0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.5);

  --scroll-track:        #1c1916;
  --scroll-thumb:        #433e38;
  --scroll-thumb-hover:  #4a9070;
}
html.dark body { background: var(--bg); color: var(--text); }
html.dark .page-header { background: var(--bg-white); border-bottom-color: var(--border); }
html.dark .modal { background: var(--surface); }
html.dark .ctx-menu { background: var(--surface); }
html.dark .type-picker-dropdown { background: var(--surface); }
html.dark .bottom-nav { background: var(--bg-white); border-top-color: var(--border); }
html.dark input, html.dark textarea, html.dark select {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
html.dark .form-control { background: var(--surface); color: var(--text); }
html.dark .entry-composer { background: var(--bg-white); border-color: var(--border); }
html.dark .sort-entries-btn { background: var(--bg-white); border-color: var(--border); }
html.dark .card { background: var(--surface); border-color: var(--border); }
html.dark .auth-card { background: var(--surface); }
html.dark .alert-info { background: var(--accent-light); border-color: var(--accent); color: var(--text-soft); }
html.dark .lang-dropdown { background: var(--surface); border-color: var(--border); }
html.dark .lang-picker-btn { border-color: var(--border); color: var(--text-soft); }

/* ============================================================
   SELECTOR DE IDIOMA — Lang Picker
   ============================================================ */
.lang-picker { position: relative; display: flex; align-items: stretch; }
.lang-picker-btn {
  height: 100%;
  border: 1px solid var(--border);
  font-weight: 600;
}
.lang-picker-btn:hover { border-color: var(--accent-mid); }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-width: 140px;
  z-index: 300;
  overflow: hidden;
  padding: 4px 0;
}
.lang-option {
  display: block;
  padding: 8px 16px;
  font-size: .83rem;
  color: var(--text);
  transition: background .1s;
}
.lang-option:hover { background: var(--surface-hover); }
.lang-option.active { font-weight: 700; color: var(--accent); }

/* Selector de idioma en páginas auth (bajo el logo) */
.auth-lang-bar {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
}
.auth-lang-code {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--text-muted);
  padding: 3px 7px;
  border-radius: 4px;
  transition: background .12s, color .12s;
}
.auth-lang-code:hover { background: var(--surface-hover); color: var(--text); }
.auth-lang-code.active { color: var(--accent); background: var(--accent-light); }

/* Centrado horizontal en botones */
.btn { justify-content: center; }

/* Landing nav compacto en móvil */
@media (max-width: 480px) {
  .landing-nav { padding: 14px 16px; }
  .landing-nav-links { gap: 6px; }
  .landing-nav-links a.btn-ghost { display: none; }
}

/* ── Páginas legales ──────────────────────────────── */
.legal-wrap { min-height: 100dvh; display: flex; flex-direction: column; }
.legal-topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 100;
}
.legal-topnav-logo img { height: 26px; }
.legal-content {
  flex: 1; max-width: 800px; width: 100%;
  margin: 0 auto; padding: 40px 24px 64px;
}
.legal-content h1 { font-size: 1.65rem; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.legal-updated { font-size: .8rem; color: var(--text-muted); margin-bottom: 36px; display: block; }
.legal-content h2 {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.legal-content h3 { font-size: .92rem; font-weight: 600; color: var(--text); margin: 16px 0 6px; }
.legal-content p { font-size: .88rem; line-height: 1.75; color: var(--text-muted); margin-bottom: 10px; }
.legal-content ul { list-style: disc; padding-left: 22px; margin-bottom: 10px; }
.legal-content ul li { font-size: .88rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 3px; }
.legal-content a { color: var(--accent); }
.legal-content a:hover { text-decoration: underline; }
.legal-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: .83rem; }
.legal-content th,
.legal-content td { padding: 8px 12px; text-align: left; border: 1px solid var(--border); color: var(--text-muted); }
.legal-content th { background: var(--surface); font-weight: 600; color: var(--text); }
.legal-bottom-nav {
  border-top: 1px solid var(--border); padding: 18px 24px;
  text-align: center; font-size: .78rem; color: var(--text-muted);
}
.legal-bottom-nav-links { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.legal-bottom-nav-links a { color: var(--text-muted); font-size: .8rem; }
.legal-bottom-nav-links a:hover { color: var(--accent); }
.landing-footer-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.landing-footer-links a { color: var(--text-muted); font-size: .78rem; }
.landing-footer-links a:hover { color: var(--accent); }
@media (max-width: 600px) {
  .legal-content { padding: 24px 16px 48px; }
  .legal-topnav { padding: 12px 16px; }
}

/* ── Cookie consent popup ─────────────────────────── */
.cookie-consent {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,.13);
  z-index: 9998;
  animation: ccSlideIn .28s ease;
}
@keyframes ccSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cookie-consent.hidden { display: none; }
.cookie-consent-title { font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.cookie-consent-body { font-size: .8rem; line-height: 1.6; color: var(--text-muted); margin-bottom: 12px; }
.cookie-consent-body a { color: var(--accent); }
.cookie-consent-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 480px) {
  .cookie-consent { left: 12px; right: 12px; max-width: none; bottom: 12px; }
}

/* ============================================================
   ICONO LÁPIZ — SVG local con mask, hereda currentColor (claro + oscuro)
   Fuente: yesicon.app/tabler/pencil
   ============================================================ */
.icon-pencil {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16z'/%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13.5 6.5l4 4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16z'/%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13.5 6.5l4 4'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

/* ============================================================
   UTILIDADES DE TEXTO — reemplaza los inline styles más comunes
   ============================================================ */
.text-caption        { font-size: .78rem; color: var(--text-muted); }
.text-caption-accent { font-size: .78rem; font-weight: 600; color: var(--accent); }
.text-stat-label     { font-size: .75rem; color: var(--text-muted); }
.text-hint           { font-size: .82rem; color: var(--text-muted); }
.link-caption        { font-size: .78rem; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; }

/* ============================================================
   CALENDARIO PERSONALIZADO (VeltorCalendar)
   ============================================================ */
.vcal {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 252px;
  user-select: none;
  font-family: inherit;
  animation: fadeIn .12s ease;
}
.vcal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 6px;
  border-bottom: 1px solid var(--border-light);
}
.vcal-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  text-align: center;
}
.vcal-nav {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color .12s, background .12s;
}
.vcal-nav:hover { color: var(--text-main); background: var(--bg-hover); }
.vcal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 6px 6px 2px;
  gap: 1px;
}
.vcal-dh {
  text-align: center;
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 0 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.vcal-empty { height: 30px; }
.vcal-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--text-soft);
  cursor: pointer;
  border: none;
  background: none;
  transition: background .1s, color .1s;
  font-family: inherit;
}
.vcal-cell:hover { background: var(--bg-hover); color: var(--text-main); }
.vcal-cell.vcal-today {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}
.vcal-cell.vcal-sel {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.vcal-cell.vcal-sel:hover { background: var(--accent-dark); }
.vcal-foot {
  padding: 4px 8px 8px;
  text-align: center;
  border-top: 1px solid var(--border-light);
  margin-top: 2px;
}
.vcal-btn-today {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .78rem;
  color: var(--accent);
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: background .12s;
}
.vcal-btn-today:hover { background: var(--accent-light); }

/* Trigger de calendar en modal de mover */
.vcal-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-main);
}
.vcal-trigger:hover { border-color: var(--accent); }

/* ============================================================
   BÚSQUEDA GLOBAL (Search)
   ============================================================ */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.42);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  animation: fadeIn .15s ease;
}
.search-modal-inner {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
}
.search-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}
.search-modal-icon {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.search-modal-input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 1rem;
  color: var(--text-main);
  font-family: inherit;
}
.search-modal-input::placeholder { color: var(--text-muted); }
.search-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .95rem;
  padding: 4px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color .15s;
}
.search-modal-close:hover { color: var(--text-main); }
.search-type-filter {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  scrollbar-width: none;
}
.search-type-filter::-webkit-scrollbar { display: none; }
.search-type-btn {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  font-size: .8rem;
  font-family: inherit;
  color: var(--text-soft);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.search-type-btn:hover { background: var(--surface-hover); color: var(--text); }
.search-type-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.search-type-btn.type-tarea.active  { background: var(--type-tarea);  border-color: var(--type-tarea); }
.search-type-btn.type-nota.active   { background: var(--type-nota);   border-color: var(--type-nota); }
.search-type-btn.type-idea.active   { background: var(--type-idea);   border-color: var(--type-idea); color: #444; }
.search-type-btn.type-record.active { background: var(--type-record); border-color: var(--type-record); }
.search-modal-results {
  max-height: 52vh;
  overflow-y: auto;
  padding: 6px 0;
}
.search-empty {
  padding: 24px 20px;
  text-align: center;
  font-size: .88rem;
  color: var(--text-muted);
}
.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--text-main);
  transition: background .12s;
}
.search-result-item:hover { background: var(--bg-soft); }
.search-result-icon {
  font-size: 1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}
.search-result-body { flex: 1; min-width: 0; }
.search-result-text {
  font-size: .9rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-done .search-result-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.search-result-date {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   ACCESIBILIDAD — Sin movimiento para usuarios que lo prefieren
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   DATE PICKER — botón en navegación del día
   ============================================================ */
.day-nav-date-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  font-family: inherit;
}
.day-nav-date-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.day-nav-date-picker {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* ============================================================
   INTENCIÓN DESTACADA — vista de día (estilo agenda verde)
   ============================================================ */
.day-intention-featured {
  padding: 13px 18px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
}
.day-intention-featured-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.day-intention-featured-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent);
}
.day-intention-featured-text {
  font-size: .93rem;
  color: var(--accent-dark);
  line-height: 1.55;
  word-break: break-word;
}
.day-intention-featured-edit {
  color: var(--accent);
  opacity: .55;
  text-decoration: none;
  font-size: .95rem;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: opacity .15s, background .15s;
}
.day-intention-featured-edit:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* ============================================================
   PROGRESO AL 100% — animación minimalista
   ============================================================ */
@keyframes progressComplete {
  0%   { filter: brightness(1); }
  40%  { filter: brightness(1.25); }
  100% { filter: brightness(1); }
}
@keyframes progressPctPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); }
  80%  { transform: scale(.97); }
  100% { transform: scale(1); }
}
.progress-fill-complete {
  animation: progressComplete 1.1s ease-out forwards;
}
.progress-pct-complete {
  animation: progressPctPop .8s cubic-bezier(.34,1.56,.64,1) forwards;
  display: inline-block;
}
@keyframes entryHighlight {
  0%   { box-shadow: 0 0 0 2px var(--accent); }
  60%  { box-shadow: 0 0 0 2px var(--accent); }
  100% { box-shadow: none; }
}
.entry-highlight { animation: entryHighlight 1.6s ease-out forwards; }

/* ============================================================
   MODAL DE ATAJOS DE TECLADO
   ============================================================ */
.shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  padding: 16px;
  animation: fadeIn .15s ease;
}
.shortcuts-modal-inner {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  padding: 24px;
}
.shortcuts-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.shortcuts-modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}
.shortcuts-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.shortcuts-modal-close:hover { color: var(--text-main); }
.shortcuts-list { display: flex; flex-direction: column; gap: 10px; }
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .88rem;
  color: var(--text-soft);
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-main);
  min-width: 28px;
  white-space: nowrap;
}

/* ============================================================
   BOTTOM NAV — botón ritual central destacado
   ============================================================ */
.bottom-nav-ritual {
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 50% !important;
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: -12px;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .15s, box-shadow .15s;
}
.bottom-nav-ritual:hover,
.bottom-nav-ritual:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 50%, transparent);
}
.bottom-nav-ritual .bottom-nav-label {
  font-size: .6rem;
  margin-top: 2px;
}

/* ============================================================
   HISTORIAL DE MOOD — gráfico de barras
   ============================================================ */
.mood-history-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding: 0 4px;
}
.mood-history-point {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}
.mood-history-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  opacity: .7;
  transition: opacity .15s;
  min-height: 4px;
}
.mood-history-point:hover .mood-history-bar { opacity: 1; }
.mood-history-emoji {
  font-size: .7rem;
  margin-top: 3px;
  line-height: 1;
}
.mood-level-1 .mood-history-bar { height: 20%; background: var(--danger, #ef4444); }
.mood-level-2 .mood-history-bar { height: 40%; background: var(--warning, #f59e0b); }
.mood-level-3 .mood-history-bar { height: 60%; background: var(--text-muted); }
.mood-level-4 .mood-history-bar { height: 80%; background: var(--accent); }
.mood-level-5 .mood-history-bar { height: 100%; background: var(--success, #22c55e); }

/* ============================================================
   DIARIO — lista de entradas journal
   ============================================================ */
.journal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.journal-item {
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}
.journal-date {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.journal-text {
  font-size: .88rem;
  color: var(--text-soft);
  line-height: 1.45;
}
.journal-mood {
  font-size: .85rem;
  margin-top: 4px;
}

/* ============================================================
   CIERRE — ¿Cumpliste la intención?
   ============================================================ */
.intention-fulfilled-box {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.intention-fulfilled-text {
  font-size: .9rem;
  color: var(--text-soft);
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.45;
}
.intention-fulfilled-btns {
  display: flex;
  gap: 8px;
}
.intention-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-white);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.intention-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.intention-btn.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   OBJETIVOS — banner "llevar pendientes"
   ============================================================ */
.carry-banner {
  background: var(--bg-soft);
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.carry-banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}
.carry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.carry-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: .88rem;
  color: var(--text-soft);
  line-height: 1.4;
}
.carry-check { margin-top: 2px; accent-color: var(--accent); }
.carry-item-text { flex: 1; }
.carry-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


/* ============================================================
   PREMIUM - etiquetas, subtareas, recurrencia, espacios
   ============================================================ */

/* Chips de etiquetas en entradas */
.vp-meta { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.vp-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .65rem; font-weight: 600; line-height: 1;
  padding: 3px 8px; border-radius: 10px;
  background: var(--vp-c, var(--accent)); color: #fff;
  white-space: nowrap;
}
.vp-subcount i, .vp-repeat i { font-size: 11px; margin-right: 2px; }
.vp-nav-lock { margin-left: auto; font-size: 12px; color: var(--text-muted); }

/* Modal de detalles */
.vp-modal { max-width: 480px; width: 100%; max-height: 85vh; overflow-y: auto; }
.vp-section { margin-bottom: 18px; }
.vp-section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); margin-bottom: 8px;
}
.vp-note { font-size: .82rem; color: var(--text-muted); padding: 4px 0; }

/* Pills (recurrencia y rangos de estadisticas) */
.vp-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.vp-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .78rem; padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg-white);
  color: var(--text-soft); cursor: pointer; text-decoration: none;
  transition: all .12s ease;
}
.vp-pill:hover { border-color: var(--accent); color: var(--accent); }
.vp-pill.active {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}
.vp-pill.locked { opacity: .65; }

/* Etiquetas dentro del modal */
.vp-label-list { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.vp-chip-toggle { cursor: pointer; opacity: .45; transition: opacity .12s ease; }
.vp-chip-toggle.on { opacity: 1; }
.vp-chip-toggle:hover { opacity: .85; }
.vp-chip-x {
  background: none; border: 0; color: inherit; opacity: .7;
  font-size: .85rem; line-height: 1; cursor: pointer; padding: 0 0 0 2px;
}
.vp-chip-x:hover { opacity: 1; }
.vp-subtask .vp-chip-x { color: var(--text-muted); font-size: 1rem; }

/* Fila de anadir (etiqueta, subtarea, item de espacio) */
.vp-add-row { display: flex; gap: 8px; align-items: center; }
.vp-add-row .form-control { flex: 1; min-width: 0; }
.vp-color {
  width: 34px; height: 34px; padding: 2px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-white); cursor: pointer; flex-shrink: 0;
}

/* Subtareas e items de espacios */
.vp-subtask-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.vp-subtask {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border-light);
}
.vp-subtask-check {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: transparent; transition: all .12s ease;
  position: relative;
}
/* Área de toque real ampliada a 24x24 (mínimo WCAG 2.5.8) sin agrandar la casilla visible */
.vp-subtask-check::after { content: ''; position: absolute; inset: -3px; }
.vp-subtask-check i { font-size: 12px; }
.vp-subtask-check:hover { border-color: var(--accent); }
.vp-subtask.done .vp-subtask-check {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.vp-subtask-text {
  flex: 1;
  font-size: .85rem;
  word-break: break-word;
  /* Respetar los saltos de línea que escriba la persona */
  white-space: pre-wrap;
  /* La tarea es arrastrable, y eso bloquea la selección en su interior */
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

/* Edición en línea de una subtarea, mismo aspecto que el texto que sustituye */
.vp-subtask-edit {
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  resize: none;
  overflow: hidden;
  outline: none;
}

/* Con varias líneas, la casilla y la equis quedan mejor arriba */
.vp-subtask { align-items: flex-start; }
.vp-subtask .vp-subtask-check,
.vp-subtask .vp-chip-x { margin-top: 1px; }

/* La caja de añadir es ahora un textarea: que crezca sin barra de scroll */
.vp-add-row textarea.form-control {
  resize: none;
  overflow: hidden;
  min-height: 34px;
  line-height: 1.45;
}

/* El panel entero admite selección de texto */
.vp-subpanel {
  -webkit-user-select: text;
  user-select: text;
}
.vp-subtask.done .vp-subtask-text { color: var(--text-muted); text-decoration: line-through; }

/* Espacios */
.sp-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.sp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.sp-card {
  display: block; padding: 16px; border-radius: 12px;
  background: var(--bg-white); border: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: border-color .12s ease, transform .12s ease;
}
.sp-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.sp-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sp-card-icon { font-size: 20px; color: var(--accent); }
.sp-card-name { font-weight: 600; font-size: .95rem; word-break: break-word; }
.sp-card-dates {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; color: var(--text-muted); margin-top: 6px;
}
.sp-card-count { font-size: .72rem; color: var(--text-muted); margin-top: 4px; text-align: right; }
.sp-detail { max-width: 640px; margin: 0 auto; }
.sp-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.sp-detail-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sp-detail-title h1 { word-break: break-word; }
.sp-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }

@media (max-width: 560px) {
  .sp-grid { grid-template-columns: 1fr 1fr; }
  .vp-modal { max-width: calc(100vw - 32px); }
}


/* ============================================================
   SIDEBAR - CTA Hazte Premium (solo plan gratuito)
   ============================================================ */
.nav-premium-cta {
  margin-top: 8px;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.nav-premium-cta i { color: var(--accent); }
.nav-premium-cta:hover,
.nav-premium-cta.active {
  background: var(--accent);
  color: #fff;
}
.nav-premium-cta:hover i,
.nav-premium-cta.active i { color: #fff; }

/* ============================================================
   LANDING - comparativa gratis vs premium + demo interactiva
   ============================================================ */
.landing-premium { max-width: 960px; margin: 0 auto; padding: 64px 20px; }
.lp-sub {
  text-align: center; color: var(--text-muted); font-size: .95rem;
  max-width: 560px; margin: -12px auto 36px; line-height: 1.55;
}
.lp-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  align-items: stretch; margin-bottom: 40px;
}
.lp-plan {
  position: relative; padding: 26px 24px; border-radius: 16px;
  background: var(--bg-white); border: 1px solid var(--border);
}
.lp-plan-premium { border: 2px solid var(--accent); }

/* Modalidad actual y cambio programado dentro de /premium */
.plan-current {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.plan-current-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.plan-current-name { font-size: .9rem; font-weight: 650; color: var(--text); }
.plan-current-price { font-size: .9rem; font-weight: 700; color: var(--text-muted); }
.plan-pending {
  padding: 12px 14px; border-radius: 12px;
  background: var(--bg-soft, rgba(0,0,0,.03));
  border: 1px dashed var(--border);
}
.plan-pending-title {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); margin-bottom: 6px;
}
.plan-pending-line { font-size: .88rem; color: var(--text-soft); line-height: 1.5; }
.plan-blocked {
  font-size: .85rem; color: var(--text-muted); line-height: 1.5;
  margin: 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border);
}
.plan-switch > summary {
  display: inline-flex; cursor: pointer; list-style: none;
}
.plan-switch > summary::-webkit-details-marker { display: none; }
.plan-switch-body {
  margin-top: 12px; padding: 14px;
  border: 1px solid var(--border); border-radius: 12px;
}
.plan-switch-text { font-size: .88rem; color: var(--text-soft); line-height: 1.55; margin: 0 0 8px; }
.plan-switch-note { font-size: .8rem; color: var(--text-muted); margin: 0 0 12px; }

/* Elección de modalidad dentro de /premium */
.plan-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan-choice-item {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 20px 18px 18px; border-radius: 14px;
  background: var(--bg-white); border: 1px solid var(--border);
}
.plan-choice-item.is-recommended { border: 2px solid var(--accent); }
.plan-choice-badge {
  position: absolute; top: -11px; left: 18px;
  background: var(--accent); color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .03em;
  padding: 3px 10px; border-radius: 20px;
}
.plan-choice-badge.is-soft {
  background: var(--bg-white); color: var(--text-muted); border: 1px solid var(--border);
}
.plan-choice-name {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
}
.plan-choice-price { font-size: 1.45rem; font-weight: 800; color: var(--text); }
.plan-choice-note { font-size: .78rem; color: var(--text-muted); margin-bottom: 12px; }
.plan-choice-item .btn { margin-top: auto; }

@media (max-width: 560px) {
  .plan-choice { grid-template-columns: 1fr; gap: 18px; }
}

/* Tres modalidades: anual (destacada), mensual y gratis. El anual conserva
   todo su protagonismo; el mensual solo tiene que verse disponible. */
.lp-compare-3 { grid-template-columns: repeat(3, 1fr); }
.lp-compare-2 { grid-template-columns: 1fr 1fr; max-width: 760px; margin-left: auto; margin-right: auto; }

/* ── Selector de modalidad Premium ──────────────────────────────────────
   Las dos opciones tienen el mismo tamaño a propósito: el anual se acentúa
   con el borde y el badge, nunca encogiendo el mensual. */
.lp-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}
.lp-duo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 22px 18px 18px;
  border-radius: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
}
.lp-duo-card.is-destacada { border: 2px solid var(--accent); }
.lp-duo-badge {
  position: absolute;
  top: -11px;
  left: 18px;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.lp-duo-badge.is-soft {
  background: var(--bg-white);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.lp-duo-name {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.lp-duo-price { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1.15; }
.lp-duo-price small { font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.lp-duo-note { font-size: .8rem; color: var(--text-muted); line-height: 1.45; }
.lp-duo-extra {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
}
.lp-duo-extra strong { color: var(--text); font-weight: 700; }
/* El botón siempre abajo, para que las dos tarjetas queden alineadas */
.lp-duo-card .landing-cta-premium { margin-top: auto; padding-top: 14px; }

/* Par de botones compacto para rematar una sección */
.lp-duo-botones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.lp-duo-botones .landing-cta-premium { margin: 0; }

.lp-incluido {
  text-align: center;
  font-size: .9rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 26px auto 18px;
  line-height: 1.55;
}
.lp-demo-cierre { padding-top: 0; }

/* Caminos de entrada en la home: son alternativas, no una secuencia, así que
   el número da paso a un icono. */
.lp-paths .lp-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}
.lp-plan-mensual { border: 1px solid var(--border); }
.lp-badge-soft {
  background: var(--bg-white);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
/* La ventaja exclusiva del anual, separada del resto de la lista */
.lp-list-exclusive {
  margin-top: 4px; padding-top: 11px;
  border-top: 1px dashed var(--border);
}
.lp-list-exclusive strong { color: var(--text); font-weight: 700; }
.lp-badge {
  position: absolute; top: -13px; left: 22px;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: 4px 12px; border-radius: 20px;
}
.lp-plan-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.lp-plan-name { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.lp-plan-price { font-size: 1.7rem; font-weight: 800; color: var(--text); }
.lp-plan-price small { font-size: .85rem; font-weight: 500; color: var(--text-muted); }
.lp-plan-note { font-size: .78rem; color: var(--text-muted); }
.lp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.lp-list li { display: flex; align-items: flex-start; gap: 9px; font-size: .88rem; color: var(--text-soft); }
.lp-list li i { color: var(--accent); font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.lp-plan-footnote { font-size: .74rem; color: var(--text-muted); text-align: center; margin-top: 10px; }

/* Demo interactiva */
.lp-demo {
  padding: 24px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
}
.lp-demo-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.lp-demo-title { font-weight: 700; font-size: 1rem; }
.lp-demo-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 600; color: var(--accent);
  background: var(--accent-light); border-radius: 20px; padding: 4px 10px;
}
.lp-tabs { margin-bottom: 16px; }
.lp-panel { min-height: 170px; }
.lp-task {
  display: flex; gap: 12px; align-items: center;
  padding: 14px; border-radius: 12px;
  background: var(--bg-white); border: 1px solid var(--border);
  max-width: 480px;
}
.lp-task-check {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.lp-task-body { min-width: 0; }
.lp-task-text { font-size: .9rem; color: var(--text); }
.lp-space {
  padding: 16px; border-radius: 12px;
  background: var(--bg-white); border: 1px solid var(--border);
  max-width: 480px;
}
.lp-space-head { display: flex; align-items: center; gap: 10px; }
.lp-hint {
  margin-top: 12px; font-size: .78rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.lp-hint::before { content: "\2192"; color: var(--accent); }

@media (max-width: 980px) {
  /* Antes de apilarlo del todo: anual y mensual juntos, gratis debajo */
  .lp-compare-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  /* Las dos modalidades, una detrás de otra, sin navegar a otra sección */
  .lp-duo { grid-template-columns: 1fr; gap: 18px; }
  .lp-duo-botones { flex-direction: column; align-items: stretch; }
  .lp-duo-botones .landing-cta-premium .btn { width: 100%; justify-content: center; }
}

@media (max-width: 720px) {
  .lp-compare,
  .lp-compare-2,
  .lp-compare-3 { grid-template-columns: 1fr; }
  .landing-premium { padding: 48px 16px; }
  .lp-demo { padding: 16px; }
}


/* ============================================================
   ICONOS SVG PROPIOS (vicon) - el subset de Tabler no incluye
   estos glifos; se dibujan con mask + currentColor
   ============================================================ */
.vicon {
  display: inline-block;
  width: 1em; height: 1em;
  flex-shrink: 0;
  background-color: currentColor;
  vertical-align: -0.125em;
  -webkit-mask: no-repeat center / contain;
  mask: no-repeat center / contain;
}
.vicon-details {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 5h8'/%3E%3Cpath d='M13 9h5'/%3E%3Cpath d='M13 15h8'/%3E%3Cpath d='M13 19h5'/%3E%3Crect x='3' y='4' width='6' height='6' rx='1'/%3E%3Crect x='3' y='14' width='6' height='6' rx='1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 5h8'/%3E%3Cpath d='M13 9h5'/%3E%3Cpath d='M13 15h8'/%3E%3Cpath d='M13 19h5'/%3E%3Crect x='3' y='4' width='6' height='6' rx='1'/%3E%3Crect x='3' y='14' width='6' height='6' rx='1'/%3E%3C/svg%3E");
}
.vicon-diamond {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 5h12l3 5l-8.5 9.5a.7 .7 0 0 1 -1 0l-8.5 -9.5l3 -5z'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M12 5l-2 5l2 9l2 -9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 5h12l3 5l-8.5 9.5a.7 .7 0 0 1 -1 0l-8.5 -9.5l3 -5z'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M12 5l-2 5l2 9l2 -9z'/%3E%3C/svg%3E");
}
.vicon-tag {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7v3.9c0 .5 .2 1 .6 1.4l8.1 8.1a2 2 0 0 0 2.9 0l4.8 -4.8a2 2 0 0 0 0 -2.9l-8.1 -8.1a2 2 0 0 0 -1.4 -.6h-3.9a3 3 0 0 0 -3 3z'/%3E%3Ccircle cx='8.5' cy='8.5' r='1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7v3.9c0 .5 .2 1 .6 1.4l8.1 8.1a2 2 0 0 0 2.9 0l4.8 -4.8a2 2 0 0 0 0 -2.9l-8.1 -8.1a2 2 0 0 0 -1.4 -.6h-3.9a3 3 0 0 0 -3 3z'/%3E%3Ccircle cx='8.5' cy='8.5' r='1'/%3E%3C/svg%3E");
}
.vicon-grid {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='6' height='6' rx='1'/%3E%3Crect x='14' y='4' width='6' height='6' rx='1'/%3E%3Crect x='4' y='14' width='6' height='6' rx='1'/%3E%3Crect x='14' y='14' width='6' height='6' rx='1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='6' height='6' rx='1'/%3E%3Crect x='14' y='4' width='6' height='6' rx='1'/%3E%3Crect x='4' y='14' width='6' height='6' rx='1'/%3E%3Crect x='14' y='14' width='6' height='6' rx='1'/%3E%3C/svg%3E");
}
.vicon-lock {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11v-4a4 4 0 0 1 8 0v4'/%3E%3Ccircle cx='12' cy='16' r='1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11v-4a4 4 0 0 1 8 0v4'/%3E%3Ccircle cx='12' cy='16' r='1'/%3E%3C/svg%3E");
}
.vicon-mail {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6l9 -6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6l9 -6'/%3E%3C/svg%3E");
}
.vicon-download {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2'/%3E%3Cpath d='M7 11l5 5l5 -5'/%3E%3Cpath d='M12 4v12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2'/%3E%3Cpath d='M7 11l5 5l5 -5'/%3E%3Cpath d='M12 4v12'/%3E%3C/svg%3E");
}
.vicon-mobile {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E");
}
/* No están en el subset de Tabler (ti-arrow-up/ti-arrow-down): mover entrada arriba/abajo por teclado */
.vicon-arrow-up {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5l0 14'/%3E%3Cpath d='M18 11l-6 -6'/%3E%3Cpath d='M6 11l6 -6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5l0 14'/%3E%3Cpath d='M18 11l-6 -6'/%3E%3Cpath d='M6 11l6 -6'/%3E%3C/svg%3E");
}
.vicon-arrow-down {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5l0 14'/%3E%3Cpath d='M18 13l-6 6'/%3E%3Cpath d='M6 13l6 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5l0 14'/%3E%3Cpath d='M18 13l-6 6'/%3E%3Cpath d='M6 13l6 6'/%3E%3C/svg%3E");
}

/* ============================================================
   AJUSTES PREMIUM (2a ronda)
   ============================================================ */

/* CTA Hazte Premium: texto centrado */
.nav-premium-cta { justify-content: center; }

/* Chips de etiqueta en el modal y la demo: estado off con contorno,
   estado on relleno - la diferencia se ve de un vistazo */
.vp-chip-toggle {
  background: transparent;
  color: var(--vp-c, var(--accent));
  box-shadow: inset 0 0 0 1.5px var(--vp-c, var(--accent));
  opacity: 1;
}
.vp-chip-toggle:hover { opacity: .75; }
.vp-chip-toggle.on {
  background: var(--vp-c, var(--accent));
  color: #fff;
  box-shadow: none;
  opacity: 1;
}

/* Chip de subtareas clicable */
.vp-subcount[role="button"] { cursor: pointer; }
.vp-subcount[role="button"]:hover { color: var(--accent); border-color: var(--accent); }
.vp-sub-zero { opacity: .5; }
.entry-item:hover .vp-sub-zero, .vp-sub-zero:hover { opacity: 1; }

/* Panel de subtareas inline (sin abrir el detalle) */
.vp-subpanel {
  width: 100%;
  flex-basis: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-light);
}
.vp-subpanel .vp-subtask { background: var(--bg-white); }
.vp-subpanel .vp-add-row { margin-top: 8px; }
.vp-subpanel .form-control { padding: 6px 10px; font-size: .85rem; }


/* ============================================================
   ESPACIOS v2 - submenu del sidebar y bloques por tipo
   ============================================================ */

/* Submenu de espacios en la barra lateral */
.nav-sub-toggle {
  margin-left: auto;
  background: none;
  border: 0;
  padding: 2px 4px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}
.nav-sub-toggle:hover { color: var(--accent); background: var(--surface-hover); }
.nav-sub-toggle i { font-size: 13px; transition: transform .15s ease; }
.nav-sub-toggle.open i { transform: rotate(180deg); }

.nav-sub {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 6px 16px;
  padding-left: 10px;
  border-left: 1px solid var(--border-light);
}
.nav-sub.open { display: flex; }
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-soft);
  text-decoration: none;
  min-width: 0;
}
.nav-sub-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-sub-item i { font-size: 14px; flex-shrink: 0; color: var(--text-muted); }
.nav-sub-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-sub-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.nav-sub-item.active i { color: var(--accent); }
.nav-sub-more { color: var(--text-muted); font-size: .78rem; }

/* Fila "Espacios": <a> de navegación + botón de despliegue como hermanos
   (nunca un <button> anidado dentro de <a>, eso rompía el tap en móvil) */
.nav-item-expandable { padding: 0; gap: 0; }
.nav-item-expandable .nav-item-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  color: inherit;
  text-decoration: none;
}
.nav-item-expandable .nav-item-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item-expandable .vp-nav-lock,
.nav-item-expandable .nav-sub-toggle { margin-right: 8px; flex-shrink: 0; align-self: center; }

/* Descripcion del tipo en el modal de creacion */
.sp-type-desc {
  margin-top: 6px;
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Bloques del detalle (dia de viaje / fase de proyecto / lista) */
.sp-block {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
}
.sp-block-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sp-block-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.sp-block-sub {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
}
.sp-block-del {
  background: none;
  border: 0;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.sp-block-del:hover { color: var(--danger, #c0392b); background: var(--surface-hover); }
.sp-block-del i { font-size: 15px; }
.sp-block .vp-add-row { margin-top: 8px; }
.sp-block .form-control { padding: 7px 10px; font-size: .85rem; }
.sp-block .vp-subtask { background: var(--surface); }

/* Editor de fechas del viaje: dos campos gemelos con calendario propio */
.sp-dates-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.sp-date-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.sp-dates-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.sp-date-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  cursor: pointer;
  text-align: left;
  font-size: .85rem;
  padding: 7px 10px;
  color: var(--text);
}
.sp-date-btn i { color: var(--accent); flex-shrink: 0; font-size: 15px; }
.sp-date-placeholder { color: var(--text-muted); }

@media (max-width: 480px) {
  .sp-dates-row { grid-template-columns: 1fr; }
}


/* ============================================================
   ESPACIO GIMNASIO + mejoras landing (pasos, a11y)
   ============================================================ */

/* Icono barra de pesas (no existe en el subset de Tabler) */
.vicon-barbell {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='1' y='11' width='22' height='2' rx='1'/%3E%3Crect x='3' y='8' width='2' height='8' rx='1'/%3E%3Crect x='19' y='8' width='2' height='8' rx='1'/%3E%3Crect x='0' y='6' width='4' height='12' rx='1.5'/%3E%3Crect x='20' y='6' width='4' height='12' rx='1.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='1' y='11' width='22' height='2' rx='1'/%3E%3Crect x='3' y='8' width='2' height='8' rx='1'/%3E%3Crect x='19' y='8' width='2' height='8' rx='1'/%3E%3Crect x='0' y='6' width='4' height='12' rx='1.5'/%3E%3Crect x='20' y='6' width='4' height='12' rx='1.5'/%3E%3C/svg%3E");
}

/* Composer del gym: ejercicio arriba, series/reps/peso + anadir debajo */
.sp-gym-composer {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  gap: 8px;
}
.sp-gym-composer .sp-block-input { grid-column: 1 / -1; }
.sp-gym-composer input[type="number"] { min-width: 0; }

/* Chip de series x reps y peso en cada ejercicio */
.sp-meta-chip {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color .12s ease, color .12s ease;
}
.sp-meta-chip:hover { border-color: var(--accent); color: var(--accent); }

/* Boton "Nueva sesion" en la cabecera de cada rutina */
.sp-block-btns { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.sp-block-reset {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  padding: 3px 10px;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease;
}
.sp-block-reset:hover { border-color: var(--accent); color: var(--accent); }
.sp-block-reset i { font-size: 13px; }

/* Grid del modal series/reps/peso */
.sp-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.sp-meta-grid .form-group { margin-bottom: 0; }

/* ============================================================
   ESPACIO SUSCRIPCIONES
   ============================================================ */

/* Icono de tarjeta de pago (no existe en el subset de Tabler) */
.vicon-creditcard {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z'/%3E%3Cpath d='M3 10l18 0'/%3E%3Cpath d='M7 15l.01 0'/%3E%3Cpath d='M11 15l2 0'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z'/%3E%3Cpath d='M3 10l18 0'/%3E%3Cpath d='M7 15l.01 0'/%3E%3Cpath d='M11 15l2 0'/%3E%3C/svg%3E");
}

.tag-paused { background: var(--surface); color: var(--text-muted); }

/* Resumen de gasto mensual/anual equivalente */
.sp-sub-summary { display: flex; gap: 12px; margin-bottom: 18px; }
.sp-sub-stat {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.sp-sub-stat-value { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.sp-sub-stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* Fila de suscripción: casilla (pausar) + nombre/categoría + importe + fecha + acciones */
.sp-sub-item { flex-wrap: wrap; row-gap: 8px; }
.sp-sub-item.done { opacity: .6; }
.sp-sub-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 140px; }
.sp-sub-name { font-size: .85rem; word-break: break-word; }
.sp-sub-meta {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-size: .78rem; color: var(--text-muted); margin-left: auto;
}
.sp-sub-amount { font-weight: 600; color: var(--text); white-space: nowrap; }
.sp-sub-next { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.sp-sub-next i { font-size: 12px; }
.sp-sub-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Formulario de nueva suscripción: todos los controles a la misma altura */
.sp-sub-composer {
  display: grid;
  grid-template-columns: 1.4fr .8fr 1fr minmax(148px, 1fr) auto;
  gap: 8px;
}
.sp-sub-composer .form-control,
.sp-sub-composer > button {
  height: 40px;
  padding: 0 10px;
  font-size: .85rem;
  line-height: 38px;
}
.sp-sub-composer > button { padding: 0 14px; line-height: normal; }
.sp-sub-category-row { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.sp-sub-category-row select.form-control { flex: 1; }

/* Mini-formulario inline para crear una categoría nueva (sustituye al <select> mientras está abierto) */
.sp-sub-new-category { display: flex; gap: 6px; flex: 1; align-items: center; }
.sp-sub-new-category input { flex: 1; height: 40px; }
.sp-sub-new-category .btn-primary { height: 40px; width: 40px; padding: 0; justify-content: center; flex-shrink: 0; }
.sp-sub-new-category-cancel { font-size: 1.1rem; flex-shrink: 0; }

@media (max-width: 560px) {
  .sp-sub-summary { flex-direction: column; }
  .sp-sub-meta { margin-left: 0; }
  .sp-sub-composer { grid-template-columns: 1fr 1fr; }
  .sp-sub-composer .sp-sub-name-input { grid-column: 1 / -1; }
}

/* Los chips de la demo ahora son <button>: quitar estilos nativos */
button.vp-chip { border: 0; font-family: inherit; }

/* Pasos "Como conseguir Premium" en la landing */
.lp-steps {
  margin-top: 36px;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.lp-steps-title {
  text-align: center;
  font-size: 1.05rem;
  margin-bottom: 20px;
}
.lp-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.lp-step { display: flex; gap: 12px; align-items: flex-start; }
.lp-step-num {
  width: 28px; height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
}
.lp-step-t { font-weight: 700; font-size: .9rem; margin-bottom: 3px; }
.lp-step-d { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }

@media (max-width: 720px) {
  .lp-steps-list { grid-template-columns: 1fr; }
  .sp-gym-composer { grid-template-columns: 1fr 1fr 1.2fr auto; }
}
@media (max-width: 420px) {
  .sp-meta-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SAFE AREAS (app nativa Android/iOS y PWA en iOS)
   Capacitor inyecta --safe-area-inset-* inline con valores reales
   cuando la web se dibuja bajo las barras del sistema; env() cubre
   iOS. En navegadores de escritorio todo vale 0 y no afecta.
   ============================================================ */
:root {
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
}
body { padding-top: var(--safe-area-inset-top); }
.sidebar { padding-top: var(--safe-area-inset-top); }
.bottom-nav { padding-bottom: var(--safe-area-inset-bottom); }
.toast-container { bottom: calc(24px + var(--safe-area-inset-bottom)); }
.cookie-consent { bottom: calc(20px + var(--safe-area-inset-bottom)); }

/* ============================================================
   SINCRONIZACIÓN OFFLINE (Premium)
   ============================================================ */
/* Insignia flotante: a diferencia de la barra ancha anterior, no empuja
   el contenido ni tapa el menú/sidebar. Esquina opuesta al contenedor de
   toasts (que vive en la esquina inferior derecha) para no solaparse, y
   elevada lo mismo que él sobre el menú inferior en móvil. */
#offlineBannerContainer {
  position: fixed;
  left: 16px;
  bottom: calc(20px + var(--safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
}
@media (max-width: 768px) {
  #offlineBannerContainer { bottom: calc(76px + var(--safe-area-inset-bottom, 0px)); }
}
.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  box-shadow: var(--shadow-md);
  max-width: min(220px, calc(100vw - 32px));
}
.offline-badge i { font-size: 15px; flex-shrink: 0; }
.offline-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offline-badge-conflict, .offline-badge-expired { cursor: pointer; }
.offline-badge-conflict { background: var(--danger, #c0392b); color: #fff; }
.offline-badge-expired  { background: #b9790a; color: #fff; }
.offline-badge-pending  { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }

.oc-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}
.oc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.oc-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.oc-content { font-size: .9rem; color: var(--text); margin-bottom: 6px; word-break: break-word; }
.oc-status { font-size: .78rem; color: var(--text-muted); }
.oc-vs { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); font-size: .78rem; }
.oc-counter { font-size: .78rem; color: var(--text-muted); text-align: center; margin: 0; }

@media (max-width: 640px) {
  .oc-grid { grid-template-columns: 1fr; }
  .oc-vs { padding: 4px 0; }
}

/* ============================================================
   COSMÉTICO DE TEMPORADA — Costa 2026 (verano, exclusivo y permanente)
   Disponible del 21/06 al 30/09/2026. Una vez desbloqueado queda en la
   colección del usuario para siempre — por eso la clase lleva el año:
   un cosmético de verano distinto en 2027 sería .theme-<nombre>-2027,
   nunca reutiliza ni redefine este selector.
   Icono base: "wave" (recorte del icono "beach" de Tabler Icons, vía
   yesicon.app), mismo trazo 24x24 / stroke-width 2 que el resto de vicon-*.
   Solo cambia fondo y acento — nada de texturas ni fondos en las tarjetas,
   para no perjudicar la legibilidad.
   Aún sin mecanismo de desbloqueo/selector — listo para conectarse cuando
   se construya el apartado de Apariencia.
   ============================================================ */
.theme-costa-2026 {
  --bg:            #f7f3ea;
  --bg-white:      #fffdf8;
  --surface:       #fffdf8;
  --surface-hover: #f0e9da;
  --accent:        #2a9d8f;
  --accent-dark:   #1f7a70;
  --accent-light:  #e3f4f2;
  --accent-mid:    #4ab3a3;
  --border:        #d8e4de;
  --border-light:  #e6efe9;
  --type-tarea:    #2a9d8f;
  --pin-bg:        #fbf1de;
  --pin-border:    #f0d9a8;
}
/* Textura de olas de fondo, muy sutil, cubriendo toda la página (como en
   el primer intento) pero con opacidad real vía stroke-opacity del SVG en
   vez de "adivinar" un color parecido al fondo — así se ve igual de tenue
   pase lo que pase con el color de --bg. Fondo normal (sin
   background-attachment:fixed, que era la causa del reparto poco fiable
   entre navegadores de la versión anterior). */
.theme-costa-2026 body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M3 19.25a2.4 2.4 0 0 1 1 -.25a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 1 .25' fill='none' stroke='%232a9d8f' stroke-opacity='0.01' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: repeat;
}
html.dark.theme-costa-2026 {
  --bg:            #142523;
  --bg-white:      #1c3330;
  --surface:       #1f3936;
  --surface-hover: #254541;
  --accent:        #4fb8a9;
  --accent-dark:   #3a9285;
  --accent-light:  #16302c;
  --accent-mid:    #5cc4b5;
  --border:        #2a4642;
  --border-light:  #213a36;
  --type-tarea:    #4fb8a9;
  --pin-bg:        #2e2510;
  --pin-border:    #4a3a18;
}
html.dark.theme-costa-2026 body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M3 19.25a2.4 2.4 0 0 1 1 -.25a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 1 .25' fill='none' stroke='%234fb8a9' stroke-opacity='0.01' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Icono de ola — reutilizable (mismo patrón mask+currentColor que el resto
   de vicon-*). Aún no insertado en ninguna vista; lo usará el selector de
   Apariencia como insignia junto al nombre del usuario. */
.vicon-wave {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 19.25a2.4 2.4 0 0 1 1 -.25a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 1 .25'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 19.25a2.4 2.4 0 0 1 1 -.25a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 2 1a2.4 2.4 0 0 0 2 1a2.4 2.4 0 0 0 2 -1a2.4 2.4 0 0 1 2 -1a2.4 2.4 0 0 1 1 .25'/%3E%3C/svg%3E");
}
.vicon-palette {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25'/%3E%3Cpath d='M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0'/%3E%3Cpath d='M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0'/%3E%3Cpath d='M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25'/%3E%3Cpath d='M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0'/%3E%3Cpath d='M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0'/%3E%3Cpath d='M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0'/%3E%3C/svg%3E");
}
.cosmetic-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  flex-shrink: 0;
}
.cosmetic-badge .vicon { width: 12px; height: 12px; }

/* Indicador de "novedad" en el nav-item de Apariencia */
.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: auto;
  flex-shrink: 0;
}

/* ============================================================
   APARIENCIA — selector de cosméticos de temporada
   ============================================================ */
.appearance-subtitle {
  font-size: .9rem;
  color: var(--text-soft);
  margin-bottom: 20px;
  max-width: 560px;
}
.appearance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.appearance-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  transition: border-color .15s ease;
}
.appearance-card.is-active { border-color: var(--accent); }
.appearance-card.is-locked { opacity: .8; }
.appearance-swatch {
  height: 88px;
  background: var(--sw-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
}
.appearance-swatch.is-locked-swatch { align-items: center; justify-content: center; }
.appearance-swatch .vicon { width: 20px; height: 20px; color: rgba(0,0,0,.35); }
.appearance-mock-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.6);
  border-left: 3px solid var(--sw-accent);
  border-radius: 6px;
  padding: 7px 9px;
}
.appearance-mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--sw-accent);
  flex-shrink: 0;
}
.appearance-mock-line {
  height: 6px;
  border-radius: 3px;
  background: rgba(0,0,0,.16);
  flex: 1;
}
.appearance-mock-line.is-short { flex: 0 0 32%; }
.appearance-mock-btn {
  align-self: flex-end;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sw-accent);
}
.appearance-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.appearance-card-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.appearance-card-desc  { font-size: .8rem; color: var(--text-muted); line-height: 1.4; flex: 1; }
.appearance-badge {
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
.appearance-badge.is-equipped { background: var(--success-light); color: var(--success); }
.appearance-progress { font-size: .78rem; color: var(--text-muted); }
.appearance-until    { font-size: .72rem; color: var(--text-muted); opacity: .8; }
.appearance-card .btn { align-self: flex-start; }

.campaign-intro-modal { max-width: 340px; text-align: center; }
.campaign-intro-modal .appearance-swatch {
  border-radius: var(--radius-lg);
  border-bottom: none;
  margin-bottom: 16px;
}
.campaign-intro-desc { font-size: .875rem; color: var(--text-soft); margin-bottom: 10px; }
.campaign-intro-requirement { font-size: .8rem; color: var(--text-muted); margin-bottom: 20px; }
.campaign-intro-modal .modal-actions { justify-content: center; }

.reward-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.reward-progress-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reward-progress-card.is-earned { border-color: var(--success); }
.reward-progress-percent { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.reward-progress-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.4; flex: 1; }

/* ── Landing de campaña orientada a Premium ─────────────────────────────────
   Añadidos para /es/agenda. No tocan ningún componente existente: todas las
   clases son nuevas salvo .hero-precio, que ya se usaba solo aquí. */

.hero-gratis {
  margin: 14px 0 0;
  text-align: center;
  font-size: .92rem;
  color: var(--text-muted);
}
.hero-gratis a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero-gratis a:hover { color: var(--text); }

/* Beneficios Premium, para escanear de un vistazo */
.lp-benefits {
  list-style: none;
  margin: 26px auto 0;
  padding: 0;
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 26px;
  text-align: left;
}
.lp-benefits li { display: flex; align-items: flex-start; gap: 10px; }
.lp-benefits i { margin-top: 3px; opacity: .8; flex: none; }
.lp-benefits span { display: block; font-size: .9rem; line-height: 1.55; color: var(--text-muted); }
.lp-benefits strong {
  display: block;
  font-size: .95rem;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 2px;
}
.lp-benefits-cta { margin-top: 30px; text-align: center; }

/* Los pasos de "qué pasa después de pagar" reutilizan .lp-steps */
.lp-steps-pago { max-width: 620px; margin-left: auto; margin-right: auto; }

/* CTA fijo en móvil. Va por debajo del aviso de cookies (z-index 9998) a
   propósito, y además el JS lo oculta mientras ese aviso esté abierto. */
.lp-sticky { display: none; }

@media (max-width: 860px) {
  .lp-sticky {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    padding: 10px 14px calc(10px + var(--safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, .12);
  }
  .lp-sticky[hidden] { display: none; }
  .lp-sticky .landing-cta-premium { display: flex; margin: 0; flex: 1 1 0; min-width: 0; }
  .lp-sticky .landing-cta-premium .btn { width: 100%; justify-content: center; white-space: nowrap; }
  /* Las dos modalidades accesibles desde la barra fija, sin volver arriba */
  .lp-sticky-acciones {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .lp-sticky-price {
    font-size: .88rem;
    font-weight: 650;
    color: var(--text);
    line-height: 1.25;
    flex: none;
  }
  /* En pantallas estrechas la etiqueta sobra: los botones ya dicen qué son */
  @media (max-width: 400px) {
    .lp-sticky { gap: 8px; padding-left: 10px; padding-right: 10px; }
    .lp-sticky-price { display: none; }
    .lp-sticky .btn { font-size: .82rem; padding-left: 10px; padding-right: 10px; }
  }
  /* Que la barra no tape el final de la página */
  body.has-sticky-cta { padding-bottom: 68px; }
}

