/* ═══════════════════════════════════════════════════════════════
   RASTREADOR DE HÁBITOS — Estilos
   Edita las variables CSS para cambiar colores globales.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --c-bg:         #0f0f0f;
  --c-surface:    #161616;
  --c-surface-2:  #1a1a1a;
  --c-input:      #0f0f0f;
  --c-elev:       #1e1e1e;
  --c-border:     #2a2a2a;
  --c-text:       #e8e8e8;
  --c-text-dim:   #aaa;
  --c-muted:      #666;
  --c-muted-2:    #444;
  --c-muted-3:    #333;

  --c-accent:     #e8673a;
  --c-marked:     #6b9e7a;
  --c-gold:       #c7b87a;
  --c-danger:     #c77a7a;

  --radius-sm: 5px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 14px;

  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--c-bg); color: var(--c-text); font-family: var(--font-sans); min-height: 100vh; padding-bottom: 80px;
  -webkit-text-size-adjust: 100%;      /* iOS no agranda texto en rotación */
  -webkit-tap-highlight-color: transparent;
}
html { touch-action: manipulation; }   /* evita doble-tap-zoom en móvil */
.serif { font-family: var(--font-serif); }
input, textarea { outline: none; font-family: inherit; }
button { font-family: inherit; }

/* ─── Scrollbars ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: var(--c-muted-3); border-radius: 4px; }

/* ─── Animaciones ────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .25s ease; }

.cell { transition: transform .12s, background .15s; cursor: pointer; }
.cell:hover  { transform: scale(1.12); }
.cell:active { transform: scale(0.9); }

.icon-btn { transition: background .15s, color .15s; }
.icon-btn:hover:not(:disabled) { background: #222; color: #fff; }
.icon-btn:disabled { cursor: default; color: var(--c-muted-3); }
.tab-btn { transition: background .15s, color .15s; }

/* ═══ NAV ════════════════════════════════════════════════════ */
.nav {
  background: #111;
  border-bottom: 1px solid var(--c-border);
  padding: 0 16px;
  position: sticky;
  top: 0; z-index: 50;
}
.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; gap: 12px;
}
.nav-title { font-size: 20px; font-weight: 700; flex-shrink: 0; }
.nav-tabs  { display: flex; gap: 4px; }
.tab-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  font-size: 13px; font-weight: 500;
  background: transparent; color: var(--c-muted);
}
.tab-btn.active { background: rgba(232,103,58,.13); color: var(--c-accent); }
.tab-btn svg { display: block; }
@media (max-width: 420px) { .tab-label { display: none; } }

/* ─── Layout ──────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 24px 20px; }

/* ═══ BOTONES BÁSICOS ════════════════════════════════════════ */
.btn-primary {
  background: var(--c-accent); color: #fff;
  border: none; padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.btn-secondary {
  background: transparent; color: #ccc;
  border: 1px solid var(--c-border);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.btn-gold {
  background: var(--c-gold); color: #111;
  border: none; padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  flex: 1;
}
.btn-danger {
  background: transparent; color: var(--c-danger);
  border: 1px solid rgba(199,122,122,.27);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 13px; cursor: pointer;
}

.icon-btn {
  background: transparent; border: none; color: var(--c-muted);
  padding: 6px; border-radius: var(--radius-sm);
  cursor: pointer; display: inline-flex;
}
.icon-btn.nav-arrow { border: 1px solid var(--c-border); padding: 6px 10px; border-radius: var(--radius); }

/* ═══ TRACKER ════════════════════════════════════════════════ */
.tracker-header { margin-bottom: 20px; }
.tracker-header-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.date-label { color: var(--c-muted); font-size: 14px; text-transform: capitalize; margin: 0; }

.status-card {
  padding: 12px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; gap: 10px;
}
.status-card.complete {
  background: linear-gradient(135deg, rgba(232,103,58,.13), rgba(232,103,58,.03));
  border-color: rgba(232,103,58,.33);
  color: var(--c-accent);
}
.status-card.complete svg { color: var(--c-accent); }
.status-card svg { color: var(--c-muted); }
.status-text          { font-size: 13px; color: var(--c-text-dim); }
.status-text strong   { color: #eee; }
.status-text-complete { font-size: 16px; font-weight: 600; color: var(--c-text); }

.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.month-title { font-size: 20px; font-weight: 600; }

.empty-state {
  padding: 60px 20px; text-align: center;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-lg);
}
.empty-emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 20px; margin: 0 0 8px; }
.empty-state p  { color: var(--c-muted); font-size: 13px; margin: 0; }

/* ─── Habit card ──────── */
.habit-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
}
.habit-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.habit-emoji-box {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.habit-info { flex: 1; min-width: 0; }
.habit-name {
  font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.habit-stats {
  font-size: 11px; color: var(--c-muted);
  margin-top: 2px;
  display: flex; align-items: center; gap: 10px;
}
.habit-stats .stat-streak, .habit-stats .stat-best {
  display: inline-flex; align-items: center; gap: 3px;
}
.habit-action { color: #555; }

.pct-high { color: var(--c-marked); font-weight: 600; }
.pct-mid  { color: var(--c-accent); font-weight: 600; }
.pct-low  { color: var(--c-muted);  font-weight: 600; }

/* ─── Grid de días ──────── */
.habit-grid { display: grid; gap: 4px; }
.habit-dow {
  text-align: center; font-size: 9px;
  color: #555; font-weight: 500;
}
.day-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 500;
  color: var(--c-muted);
  background: var(--c-elev);
  border: 1px solid transparent;
}
.day-cell-desktop { font-size: 10px; }
.day-cell-mobile  { font-size: 13px; }
.day-cell.checked { color: #fff; font-weight: 500; }
.day-cell.today   { border: 1.5px solid var(--c-accent); font-weight: 700; }
.day-cell.today.checked { border-color: #fff; }
.day-cell.future {
  color: var(--c-muted-3); background: transparent;
  opacity: .3; cursor: default;
}

.expand-btn { margin-top: 10px; width: 100%; padding: 8px; font-size: 12px; color: var(--c-muted); }

/* ═══ STATS ════════════════════════════════════════════════════ */
.stats-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.stats-title    { font-size: 28px; font-weight: 700; margin: 0 0 4px; }
.stats-subtitle { color: var(--c-muted); font-size: 13px; margin: 0; }

.year-picker {
  display: flex; align-items: center; gap: 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 4px;
}
.year-label { font-size: 16px; font-weight: 600; min-width: 48px; text-align: center; }

.stats-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.stats-card-title { font-size: 13px; color: var(--c-muted); margin-bottom: 16px; font-weight: 500; }

/* Gráfico medio mensual */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.chart-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 5px; height: 100%;
}
.chart-val { font-size: 10px; color: var(--c-text-dim); height: 14px; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.chart-bar {
  width: 100%;
  background: var(--c-accent);
  border-radius: 3px 3px 0 0;
  opacity: .85;
  transition: height .4s ease;
}
.chart-bar.empty { background: #222; height: 4%; }
.chart-label { font-size: 10px; color: var(--c-muted); }

/* Comparativa */
.compare-row { margin-bottom: 12px; }
.compare-row-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 5px; font-size: 14px;
}
.compare-bar-bg { height: 8px; background: #222; border-radius: 4px; overflow: hidden; }
.compare-bar-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }

/* Tabla */
.table-scroll { overflow-x: auto; margin: 0 -8px; }
.stats-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; min-width: 760px;
}
.stats-table th {
  color: var(--c-muted); text-align: center; padding: 6px 4px;
  font-weight: 500; min-width: 40px;
}
.stats-table th.sticky-col, .stats-table td.sticky-col {
  text-align: left; padding: 6px 8px;
  position: sticky; left: 0; background: var(--c-surface);
}
.stats-table tr { border-top: 1px solid var(--c-border); }
.stats-table td { text-align: center; padding: 6px 4px; }
.stats-table td.sticky-col { padding: 8px; white-space: nowrap; }
.row-emoji { margin-right: 6px; }
.col-streak { color: var(--c-accent); padding: 8px !important; }
.col-best   { color: var(--c-gold);   padding: 8px !important; }
.col-year   { color: var(--c-text-dim); padding: 8px !important; }

.table-pct {
  font-size: 11px; font-weight: 600;
  padding: 2px 5px; border-radius: 4px;
  display: inline-block; min-width: 30px;
}
.table-pct.pct-high { background: rgba(107,158,122,.2);  color: var(--c-marked); }
.table-pct.pct-mid  { background: rgba(232,103,58,.2);   color: var(--c-accent); }
.table-pct.pct-some { background: #222;                   color: #777; }
.table-pct.pct-zero { background: transparent;            color: var(--c-muted-2); }
.table-na { color: var(--c-muted-3); font-size: 11px; }

/* ═══ NOTAS ════════════════════════════════════════════════════ */
.notes-title    { font-size: 28px; font-weight: 700; margin: 0 0 6px; }
.notes-subtitle { color: var(--c-muted); font-size: 13px; margin: 0 0 24px; }

.notes-calendar {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.notes-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.notes-dow { text-align: center; font-size: 11px; color: #555; padding-bottom: 6px; }

.note-cell {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  background: var(--c-elev);
  border: 1px solid var(--c-border);
}
.note-cell.has-note { background: rgba(199,184,122,.13); border-color: rgba(199,184,122,.27); }
.note-cell.today { border: 1.5px solid var(--c-accent); }
.note-cell.future { background: transparent; border-color: transparent; opacity: .25; cursor: default; }
.note-cell-day { font-size: 12px; color: #777; }
.note-cell.has-note .note-cell-day { color: var(--c-gold); }
.note-cell.today .note-cell-day { color: var(--c-accent); font-weight: 700; }
.note-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--c-gold); }

.notes-empty { color: #555; font-size: 13px; text-align: center; padding: 20px 0; }
.notes-list { display: flex; flex-direction: column; gap: 10px; }
.note-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
}
.note-item-content {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.note-item-content > div:first-child { flex: 1; min-width: 0; }
.note-item-date { font-size: 12px; color: var(--c-gold); margin-bottom: 5px; font-weight: 600; text-transform: capitalize; }
.note-item-text { font-size: 13px; color: var(--c-text-dim); line-height: 1.5; white-space: pre-wrap; }
.note-item svg { color: #555; flex-shrink: 0; margin-top: 2px; }

/* ═══ MODALES ════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 200;
}
.modal {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%; max-width: 400px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 20px; font-weight: 600; margin: 0; }

.form-label { display: block; font-size: 12px; color: #777; margin: 16px 0 8px; }
.form-label:first-of-type { margin-top: 0; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 12px;
  background: var(--c-input);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: #eee;
  font-size: 16px;                     /* ≥16px → iOS no hace zoom al enfocar */
}
.form-input:focus { border-color: var(--c-accent); }
.form-textarea {
  width: 100%; height: 140px;
  padding: 12px;
  background: var(--c-input);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: #eee;
  font-size: 16px;
  resize: none; line-height: 1.6;
}

/* Campo de contraseña con ojito */
.form-input-wrap { position: relative; }
.form-input-wrap .form-input { padding-right: 42px; }
.password-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  background: transparent; border: none;
  color: var(--c-muted); cursor: pointer;
  padding: 8px;
  display: flex; align-items: center;
  border-radius: var(--radius-sm);
}
.password-toggle:hover { color: var(--c-text); }
.password-toggle:active { color: var(--c-accent); }
.form-textarea:focus { border-color: var(--c-gold); }

.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.emoji-btn {
  padding: 5px; font-size: 17px;
  cursor: pointer;
  background: var(--c-input);
  border: 1px solid var(--c-border);
  border-radius: 6px;
}
.emoji-btn.active { background: rgba(232,103,58,.2); border-color: var(--c-accent); }

.color-grid { display: flex; gap: 7px; flex-wrap: wrap; }
.color-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid transparent;
}
.color-btn.active { border-color: #fff; }

.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn-secondary, .modal-actions .btn-primary { flex: 1; padding: 9px; }

/* Modal nota */
.modal-note .note-tag { font-size: 11px; color: var(--c-gold); font-weight: 600; margin-bottom: 3px; }
.modal-note .modal-header h2 { font-size: 18px; text-transform: capitalize; }

/* Modal mes completo */
.modal-expanded { max-width: 380px; padding: 20px; }
.exp-title { display: flex; align-items: center; gap: 10px; }
.exp-emoji { font-size: 18px; }
.exp-title .serif { font-size: 16px; font-weight: 600; }
.exp-month { font-size: 11px; color: var(--c-muted); }
.exp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.exp-dow  { text-align: center; font-size: 10px; color: #555; padding-bottom: 4px; }
.exp-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  background: var(--c-elev);
  color: #777;
  border: 1px solid transparent;
}
.exp-cell.checked { color: #fff; }
.exp-cell.today   { border: 1.5px solid var(--c-accent); font-weight: 700; }
.exp-cell.today.checked { border-color: #fff; }
.exp-cell.future  { background: transparent; color: var(--c-muted-3); opacity: .3; cursor: default; }

/* ═══ PANTALLAS DE AUTH ═══════════════════════════════════════════ */
.auth-root {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center; justify-content: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  background: var(--c-bg);
  overflow-y: auto;          /* sólo hace scroll si el formulario no entra */
  z-index: 100;
}
.auth-screen { width: 100%; display: flex; align-items: center; justify-content: center; }
.auth-loading { color: var(--c-muted); font-size: 14px; }

.auth-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  width: 100%; max-width: 380px;
}
.auth-logo {
  text-align: center;
  font-size: 24px; font-weight: 700;
  color: var(--c-accent);
  margin-bottom: 24px;
}
.auth-title    { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.auth-subtitle { color: var(--c-muted); font-size: 13px; margin: 0 0 22px; }

.auth-form { display: flex; flex-direction: column; }
.auth-form .form-label  { margin: 14px 0 6px; }
.auth-form .form-label:first-child { margin-top: 0; }
.auth-submit { margin-top: 22px; padding: 11px; font-size: 14px; }
.auth-submit:disabled { opacity: .6; cursor: default; }

/* Checkbox "Recordar contraseña" */
.auth-remember {
  display: flex; align-items: center; gap: 9px;
  margin-top: 16px;
  font-size: 13px; color: var(--c-text-dim);
  cursor: pointer; user-select: none;
}
.auth-remember input {
  width: 16px; height: 16px;
  accent-color: var(--c-accent);
  cursor: pointer; flex-shrink: 0;
}

.auth-msg {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.auth-msg-err { background: rgba(199,122,122,.13); border: 1px solid rgba(199,122,122,.33); color: #e89999; }
.auth-msg-ok  { background: rgba(107,158,122,.13); border: 1px solid rgba(107,158,122,.33); color: var(--c-marked); }

.auth-links {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--c-muted);
}
.auth-links a {
  color: var(--c-accent);
  text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }
.auth-sep { margin: 0 6px; color: var(--c-muted-3); }

/* Google Sign-In */
.google-btn-wrap {
  display: flex; justify-content: center;
  margin-bottom: 18px;
}
.google-btn-wrap > div { max-width: 100% !important; }

.auth-divider {
  display: flex; align-items: center;
  text-align: center;
  color: var(--c-muted);
  font-size: 12px;
  margin: 4px 0 18px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--c-border);
}
.auth-divider span { padding: 0 12px; }

/* ─── Usuario en la nav ─── */
.tab-logout { color: var(--c-muted); margin-left: 4px; }
.tab-logout svg { display: block; }    /* icono siempre visible */
.tab-logout:hover { color: var(--c-danger); background: rgba(199,122,122,.1); }
.nav-user {
  font-size: 12px; color: var(--c-text-dim);
  max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 520px) { .nav-user { max-width: 80px; } }
@media (max-width: 420px) { .nav-user { display: none; } }

/* ═══ PWA ═════════════════════════════════════════════════════════ */

/* Safe area para iOS (notch / barra inferior) cuando se instala como app */
@supports (padding: env(safe-area-inset-top)) {
  .nav { padding-top: env(safe-area-inset-top); }
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* Botón flotante "Instalar app" (píldora: acción + ✕ para descartar) */
.install-btn {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  z-index: 100;
  display: flex; align-items: center;
  background: var(--c-accent);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(232,103,58,.4);
  animation: fadeIn .3s ease;
}
.install-btn-main {
  background: transparent; border: none;
  color: #fff;
  padding: 12px 8px 12px 18px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.install-btn-close {
  background: transparent; border: none;
  color: rgba(255,255,255,.7);
  padding: 12px 15px 12px 6px;
  font-size: 13px; line-height: 1;
  cursor: pointer;
}
.install-btn-main:active { transform: translateY(1px); }
.install-btn-close:hover  { color: #fff; }

/* Instrucciones de instalación en iOS (Safari no tiene diálogo nativo) */
.ios-install-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 400;
  animation: fadeIn .2s ease;
}
.ios-install-card {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%; max-width: 340px;
}
.ios-install-card h3 { font-size: 18px; font-weight: 600; margin: 0 0 10px; }
.ios-install-card p  { font-size: 13px; color: var(--c-text-dim); margin: 0 0 16px; line-height: 1.5; }
.ios-install-card ol { margin: 0 0 20px; padding-left: 20px; }
.ios-install-card li { font-size: 13px; color: var(--c-text); margin-bottom: 10px; line-height: 1.6; }
.ios-install-card strong { color: var(--c-accent); }
.ios-share {
  display: inline-flex; vertical-align: -4px;
  color: var(--c-accent);
}
.ios-install-close {
  width: 100%;
  background: var(--c-accent); color: #fff;
  border: none; padding: 11px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.ios-install-close:active { opacity: .85; }

/* Toast "Hay una nueva versión" */
.update-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 300;
  display: flex; align-items: center; gap: 10px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-accent);
  border-radius: 999px;
  padding: 8px 8px 8px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  animation: slideUp .3s ease;
  max-width: calc(100vw - 24px);
}
@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.update-toast-text {
  font-size: 13px;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.update-toast-btn {
  background: var(--c-accent); color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.update-toast-close {
  background: transparent; border: none;
  color: var(--c-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 999px;
}
.update-toast-close:hover { color: var(--c-text); }

@media (max-width: 480px) {
  .update-toast-text { font-size: 12px; }
  .update-toast { padding: 6px 6px 6px 14px; }
}
