/* ── IDÉNTICO AL PWA.html ACTUAL — no cambia nada ── */
  @import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500;600&display=swap');

  :root {
    --bg:       #0f1117;
    --bg2:      #161820;
    --bg3:      #1e2028;
    --border:   rgba(255,255,255,0.07);
    --border2:  rgba(255,255,255,0.12);
    --text:     #e8e8e6;
    --text2:    #9a9893;
    --text3:    #5c5b59;
    --accent:   #c8f05a;
    --accent2:  #a8d442;
    --red:      #f05a5a;
    --amber:    #f0a85a;
    --blue:     #5ab4f0;
    --radius:   14px;
    --nav-h:    68px;
    --mono:     'DM Mono', monospace;
    --sans:     'DM Sans', sans-serif;
  }

  /* ── TEMA CLARO ── */
  [data-theme="light"] {
    --bg:       #f5f5f0;
    --bg2:      #eeeee8;
    --bg3:      #e5e5de;
    --border:   rgba(0,0,0,0.07);
    --border2:  rgba(0,0,0,0.12);
    --text:     #1a1a18;
    --text2:    #5c5b59;
    --text3:    #9a9893;
    --accent:   #5a9e0f;
    --accent2:  #4a8a0a;
    --red:      #cc2222;
    --amber:    #b86800;
    --blue:     #1a6fa8;
  }

  [data-theme="light"] #nav {
    background: rgba(238,238,232,0.92);
  }

  [data-theme="light"] .modal-sheet {
    background: var(--bg2);
  }

  [data-theme="light"] .ctx-menu {
    background: var(--bg2);
  }

  [data-theme="light"] #fab {
    box-shadow: 0 4px 24px rgba(90,158,15,0.3);
  }

  [data-theme="light"] #toast {
    background: var(--bg2);
  }

  /* ── BOTÓN FLOTANTE TEMA ── */
  #btn-tema-flotante {
    position: fixed;
    top: 16px;
    right: calc(50% - 215px + 16px);
    width: 38px;
    height: 38px;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    color: var(--text2);
    font-size: 1.133rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  #btn-tema-flotante:active { transform: scale(0.93); opacity: 0.8; }

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

  html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--base-size, 15px);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
  }

  #app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    position: relative;
  }

  #scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px calc(var(--nav-h) + 16px);
    scroll-behavior: smooth;
  }

  #nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--nav-h);
  background: rgba(22, 24, 32, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;   /* ← cambiado */
  overflow-x: auto;              /* ← nuevo */
  overflow-y: hidden;            /* ← nuevo */
  scrollbar-width: none;         /* ← nuevo */
  -ms-overflow-style: none;      /* ← nuevo */
  padding: 0 0 env(safe-area-inset-bottom, 0px); /* ← quitamos el padding lateral */
  gap: 0;
  z-index: 100;
  }

  #nav::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex-shrink: 0;   /* ← agregar esta línea */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--text3);
    font-family: var(--sans);
    font-size: 0.667rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
  }

  .nav-btn svg { width: 22px; height: 22px; stroke-width: 1.5; }
  .nav-btn.active { color: var(--accent); }
  .nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 2px 2px;
  }

  .view { display: none; animation: fadeIn 0.2s ease; }
  .view.active { display: block; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

  .page-title { font-size: 1.467rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 4px; }
  .page-sub   { font-size: 0.867rem; color: var(--text2); margin-bottom: 20px; }
  .section-label {
    font-family: var(--mono);
    font-size: 0.667rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 10px;
  }

  .card    { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
  .card-sm { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }

  input, select, textarea {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--sans);
    font-size: 1rem;
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
  }
  input:focus, select:focus { border-color: var(--accent); }
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9893' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
  }
  select option { background: var(--bg2); }

  label.field-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text2); margin-bottom: 6px; letter-spacing: 0.01em; }
  .field { margin-bottom: 14px; }

  .btn {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; width: 100%; padding: 14px; border: none;
    border-radius: var(--radius); font-family: var(--sans);
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: all 0.15s; -webkit-tap-highlight-color: transparent;
  }
  .btn-primary { background: var(--accent); color: #0f1117; }
  .btn-primary:active { background: var(--accent2); transform: scale(0.98); }
  .btn-ghost { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }
  .btn-ghost:active { opacity: 0.7; transform: scale(0.98); }
  .btn-danger { background: rgba(240,90,90,0.12); color: var(--red); border: 1px solid rgba(240,90,90,0.2); }

  .macro-bars { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
  .macro-bar-item { background: var(--bg3); border-radius: 10px; padding: 12px 10px; text-align: center; }
  .macro-val { font-family: var(--mono); font-size: 1.2rem; font-weight: 500; }
  .macro-name { font-size: 0.733rem; color: var(--text2); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.06em; }
  .macro-prog { height: 3px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
  .macro-prog-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }

  .kcal-big { text-align: center; padding: 4px 0 16px; }
  .kcal-num { font-family: var(--mono); font-size: 3.467rem; font-weight: 500; line-height: 1; color: var(--accent); }
  .kcal-label { font-size: 0.8rem; color: var(--text2); margin-top: 4px; letter-spacing: 0.06em; text-transform: uppercase; }
  .kcal-of { font-size: 0.867rem; color: var(--text3); margin-top: 2px; }

  .micros-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .micro-item { background: var(--bg3); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
  .micro-label { font-size: 0.733rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; }
  .micro-val { font-family: var(--mono); font-size: 1rem; font-weight: 500; color: var(--text); }
  .micro-unit { font-size: 0.667rem; color: var(--text3); }

  .registro-group { margin-bottom: 18px; }
  .grupo-header {
    font-family: var(--mono); font-size: 0.667rem; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text3); padding: 0 2px;
    margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
  }
  .grupo-header::after { content: ''; flex: 1; height: 1px; background: var(--border); }

  .registro-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: var(--bg3);
    border-radius: 10px; margin-bottom: 6px;
  }
  .reg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .reg-info { flex: 1; min-width: 0; }
  .reg-nombre { font-size: 0.933rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .reg-detalle { font-family: var(--mono); font-size: 0.733rem; color: var(--text2); margin-top: 1px; }
  .reg-kcal { font-family: var(--mono); font-size: 0.867rem; color: var(--text2); flex-shrink: 0; }

  #fab {
    position: fixed;
    bottom: calc(var(--nav-h) + 16px);
    right: calc(50% - 215px + 16px);
    width: 52px; height: 52px;
    background: var(--accent); border: none; border-radius: 16px;
    color: #0f1117; font-size: 1.733rem; display: flex;
    align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 24px rgba(200,240,90,0.35);
    z-index: 90; transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  #fab:active { transform: scale(0.93); box-shadow: 0 2px 12px rgba(200,240,90,0.25); }

  .modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px); z-index: 200;
    display: flex; align-items: flex-end;
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
  }
  .modal-overlay.open { opacity: 1; pointer-events: all; }
  .modal-sheet {
    width: 100%; max-width: 430px; margin: 0 auto;
    background: var(--bg2); border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--border2); padding: 12px 16px 32px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
    max-height: 92dvh; overflow-y: auto;
  }
  .modal-overlay.open .modal-sheet { transform: translateY(0); }
  .modal-handle { width: 36px; height: 4px; background: var(--border2); border-radius: 2px; margin: 0 auto 16px; }
  .modal-title { font-size: 1.133rem; font-weight: 600; margin-bottom: 18px; letter-spacing: -0.01em; }

  .search-wrap { position: relative; margin-bottom: 14px; }
  .search-wrap input { padding-left: 40px; }
  .search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }

  .alimento-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: var(--bg3);
    border-radius: 10px; margin-bottom: 6px; cursor: pointer;
    border: 1px solid transparent; transition: border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .alimento-item:active, .alimento-item.selected { border-color: var(--accent); }
  .ali-info { flex: 1; min-width: 0; }
  .ali-nombre { font-size: 0.933rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ali-meta { font-family: var(--mono); font-size: 0.733rem; color: var(--text2); margin-top: 2px; }
  .ali-kcal { font-family: var(--mono); font-size: 0.867rem; color: var(--text2); flex-shrink: 0; text-align: right; }

  .tdee-result { background: var(--bg3); border-radius: 12px; padding: 16px; margin-top: 16px; display: none; }
  .tdee-result.show { display: block; animation: fadeIn 0.3s ease; }
  .tdee-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .tdee-row:last-child { border-bottom: none; }
  .tdee-key { font-size: 0.933rem; color: var(--text2); }
  .tdee-val { font-family: var(--mono); font-size: 1rem; font-weight: 500; }
  .tdee-val.big { font-size: 1.467rem; color: var(--accent); }

  .empty-state { text-align: center; padding: 40px 20px; color: var(--text3); }
  .empty-icon  { font-size: 2.4rem; margin-bottom: 12px; opacity: 0.5; }
  .empty-text  { font-size: 0.933rem; }

  .chip-group { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
  .chip {
    padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border2);
    background: var(--bg3); color: var(--text2); font-size: 0.867rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent;
  }
  .chip.selected { background: rgba(200,240,90,0.12); border-color: var(--accent); color: var(--accent); }

  #toast {
    position: fixed; bottom: calc(var(--nav-h) + 80px);
    left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--bg3); border: 1px solid var(--border2);
    border-radius: 100px; padding: 10px 20px; font-size: 0.867rem;
    font-weight: 500; color: var(--text); z-index: 999;
    opacity: 0; transition: all 0.3s cubic-bezier(0.32,0.72,0,1);
    white-space: nowrap; pointer-events: none;
  }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  .spinner {
    width: 18px; height: 18px; border: 2px solid var(--border2);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .loading-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px; color: var(--text3); font-size: 0.933rem; }

  .dot-desayuno { background: #f0a85a; }
  .dot-almuerzo { background: #5ab4f0; }
  .dot-cena     { background: #c8f05a; }
  .dot-snack    { background: #9a7ef0; }

  .gramos-badge {
    display: inline-block; background: rgba(200,240,90,0.1);
    border: 1px solid rgba(200,240,90,0.2); color: var(--accent);
    border-radius: 6px; padding: 2px 8px;
    font-family: var(--mono); font-size: 0.8rem;
  }

  .menu-seccion-label {
    font-family: var(--mono); font-size: 0.667rem; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text3); margin: 18px 0 8px;
    display: flex; align-items: center; gap: 8px;
  }
  .menu-seccion-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
  .menu-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
  .menu-card.favorito { border-color: rgba(200,240,90,0.3); }
  .menu-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
  .menu-nombre { flex: 1; font-size: 1rem; font-weight: 600; line-height: 1.3; }
  .menu-tipo-badge { font-size: 0.667rem; padding: 3px 8px; border-radius: 20px; border: 1px solid var(--border2); color: var(--text3); white-space: nowrap; flex-shrink: 0; }
  .fav-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0 2px; -webkit-tap-highlight-color: transparent; transition: transform 0.15s; flex-shrink: 0; }
  .fav-btn:active { transform: scale(1.3); }
  .menu-items-preview { font-size: 0.8rem; color: var(--text2); margin-bottom: 12px; line-height: 1.6; }
  .menu-dias-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
  .dia-chip { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border2); background: var(--bg3); color: var(--text2); font-size: 0.8rem; cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent; text-transform: capitalize; }
  .dia-chip.selected { background: rgba(200,240,90,0.12); border-color: var(--accent); color: var(--accent); }
  .btn-aplicar { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 11px; border: none; border-radius: 10px; background: var(--accent); color: #0f1117; font-family: var(--sans); font-size: 0.933rem; font-weight: 600; cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent; }
  .btn-aplicar:active { background: var(--accent2); transform: scale(0.98); }
  .btn-aplicar:disabled { opacity: 0.5; pointer-events: none; }

  .peso-hoy-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
  .peso-hoy-info { flex: 1; }
  .peso-hoy-label { font-size: 0.733rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
  .peso-hoy-val { font-family: var(--mono); font-size: 1.733rem; font-weight: 500; color: var(--accent); }
  .peso-hoy-val.vacio { color: var(--text3); font-size: 1.2rem; }
  .btn-peso { background: var(--bg3); border: 1px solid var(--border2); border-radius: 10px; color: var(--text); font-family: var(--sans); font-size: 0.867rem; font-weight: 500; padding: 8px 14px; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; transition: all 0.15s; }
  .btn-peso:active { opacity: 0.7; transform: scale(0.97); }

  .item-menu-wrap { position: relative; flex-shrink: 0; }
  .btn-tres-puntos { background: none; border: none; color: var(--text3); font-size: 1.2rem; line-height: 1; padding: 4px 6px; cursor: pointer; border-radius: 6px; -webkit-tap-highlight-color: transparent; transition: background 0.15s; }
  .btn-tres-puntos:active { background: var(--border); }
  .ctx-menu { position: absolute; right: 0; top: 28px; background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px; overflow: hidden; z-index: 150; min-width: 160px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); display: none; }
  .ctx-menu.open { display: block; animation: fadeIn 0.15s ease; }
  .ctx-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 0.933rem; cursor: pointer; transition: background 0.1s; -webkit-tap-highlight-color: transparent; }
  .ctx-item:active { background: var(--bg3); }
  .ctx-item.danger { color: var(--red); }
  .ctx-item + .ctx-item { border-top: 1px solid var(--border); }

  .grafica-wrap { margin-top: 14px; background: var(--bg3); border-radius: 12px; padding: 14px 10px 10px; overflow: hidden; }
  .grafica-titulo { font-family: var(--mono); font-size: 0.667rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3); margin-bottom: 12px; padding-left: 4px; }
  .grafica-svg { width: 100%; display: block; }

  /* ── MODAL ALIMENTO MANUAL ── */
  .manual-section-title {
    font-family: var(--mono);
    font-size: 0.667rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    margin: 18px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .manual-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }
  .manual-section-title .toggle-icon {
    font-size: 0.733rem;
    color: var(--text3);
    transition: transform 0.2s;
    flex-shrink: 0;
  }
  .manual-section-title.open .toggle-icon {
    transform: rotate(180deg);
  }
  .manual-micros-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
  }
  .manual-micros-grid .field {
    margin-bottom: 0;
  }
  .manual-micros-grid label.field-label {
    font-size: 0.733rem;
  }
  .campo-requerido {
    color: var(--accent);
  }
  .manual-tipo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* ── AJUSTES / NOTIFICACIONES ── */
.ajuste-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.ajuste-row:last-child { border-bottom: none; }

.ajuste-info { flex: 1; }
.ajuste-label { font-size: 0.933rem; font-weight: 500; }
.ajuste-sub   { font-size: 0.8rem; color: var(--text3); margin-top: 2px; }

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: var(--text3);
  border-radius: 50%;
  transition: all 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(200,240,90,0.2);
  border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  background: var(--accent);
  transform: translateX(18px);
}

/* Tiempo notif card */
.notif-tiempo-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.notif-tiempo-card.inactivo { opacity: 0.45; }
.notif-tiempo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.notif-tiempo-emoji { font-size: 1.2rem; }
.notif-tiempo-nombre {
  flex: 1;
  font-size: 0.933rem;
  font-weight: 500;
  text-transform: capitalize;
}
.notif-tiempo-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.notif-tiempo-body .field { margin-bottom: 0; }
.notif-tiempo-body label.field-label { font-size: 0.733rem; }
.notif-tiempo-body select,
.notif-tiempo-body input[type="time"] {
  font-size: 0.867rem;
  padding: 8px 10px;
}

.permiso-banner {
  background: rgba(240,168,90,0.1);
  border: 1px solid rgba(240,168,90,0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.867rem;
  color: var(--amber);
  display: none;
}
.permiso-banner.show { display: block; }

/* ══ AJUSTES v2 — Fuentes + Color personalizado ══════════════════ */

/* Fuentes adicionales */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=Nunito:wght@400;500;600&family=Jost:wght@300;400;500;600&family=Lora:wght@400;600&display=swap');

/* Variables de fuente aplicadas */
[data-font="moderna"]    { --sans: 'DM Sans', sans-serif; }
[data-font="editorial"]  { --sans: 'Playfair Display', serif; }
[data-font="codigo"]     { --sans: 'DM Mono', monospace; }
[data-font="redondeada"] { --sans: 'Nunito', sans-serif; }
[data-font="geometrica"] { --sans: 'Jost', sans-serif; }
[data-font="clasica"]    { --sans: 'Lora', serif; }

/* Variable de tamaño base */
/* Tamaño controlado por --base-size via JS sizeAplicar() */

/* ── AJUSTE ROW ── */
.ajuste-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.ajuste-row:last-child { border-bottom: none; }
.ajuste-info { flex: 1; }
.ajuste-label { font-size: 0.933rem; font-weight: 500; }
.ajuste-sub   { font-size: 0.8rem; color: var(--text3); margin-top: 2px; }

/* ── TOGGLE SWITCH ── */
.toggle-switch {
  position: relative; width: 44px; height: 26px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 13px; cursor: pointer; transition: all 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: var(--text3); border-radius: 50%; transition: all 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(200,240,90,0.2); border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  background: var(--accent); transform: translateX(18px);
}

/* ── FONT CARDS ── */
.font-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.font-card {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.font-card:active { transform: scale(0.96); }
.font-card.selected {
  border-color: var(--accent);
  background: rgba(200,240,90,0.08);
}
.font-card-preview {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 4px;
}
.font-card-name {
  font-size: 0.667rem;
  color: var(--text3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── COLOR PICKER ── */
.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.color-row:last-child { border-bottom: none; }
.color-label {
  font-size: 0.867rem;
  color: var(--text2);
}
.color-swatch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.color-swatch input[type="color"] {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
  opacity: 0;
}
.color-hex {
  font-family: var(--mono);
  font-size: 0.733rem;
  color: var(--text3);
  width: 56px;
}
.btn-reset-color {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.733rem;
  cursor: pointer;
  font-family: var(--sans);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.btn-reset-color:active { opacity: 0.6; }

/* ── MI TEMA — panel colapsable ── */
.mi-tema-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s cubic-bezier(0.32,0.72,0,1), opacity 0.25s;
  opacity: 0;
}
.mi-tema-panel.open {
  max-height: 600px;
  opacity: 1;
}

/* ── PREVIEW DE FUENTE ── */
.font-preview-bar {
  background: var(--bg3);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.933rem;
  color: var(--text2);
  line-height: 1.5;
  border: 1px solid var(--border);
  transition: font-family 0.2s;
}

/* ── NOTIFICACIONES — colapsable ── */
.notif-tiempos-wrap {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s cubic-bezier(0.32,0.72,0,1), opacity 0.25s;
  opacity: 0;
}
.notif-tiempos-wrap.visible {
  max-height: 1200px;
  opacity: 1;
}

.notif-tiempo-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
  transition: border-color 0.2s;
}
.notif-tiempo-card.inactivo { opacity: 0.45; }
.notif-tiempo-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.notif-tiempo-emoji { font-size: 1.2rem; }
.notif-tiempo-nombre { flex: 1; font-size: 0.933rem; font-weight: 500; text-transform: capitalize; }
.notif-tiempo-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.notif-tiempo-body .field { margin-bottom: 0; }
.notif-tiempo-body label.field-label { font-size: 0.733rem; }
.notif-tiempo-body select,
.notif-tiempo-body input[type="time"] { font-size: 0.867rem; padding: 8px 10px; }

.permiso-banner {
  background: rgba(240,168,90,0.1); border: 1px solid rgba(240,168,90,0.3);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  font-size: 0.867rem; color: var(--amber); display: none;
}
.permiso-banner.show { display: block; }

/* ── SIZE CHIPS ── */
.size-chips {
  display: flex; gap: 8px; margin-bottom: 0;
}

/* ══ AJUSTES v3 ═══════════════════════════════════════════════════ */

/* Fuentes adicionales */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=Nunito:wght@400;500;600&family=Lora:wght@400;600&display=swap');

/* Aplicar fuente seleccionada */
[data-font="moderna"]    { --sans: 'DM Sans', sans-serif; }
[data-font="editorial"]  { --sans: 'Playfair Display', serif; }
[data-font="codigo"]     { --sans: 'DM Mono', monospace; }
[data-font="redondeada"] { --sans: 'Nunito', sans-serif; }
[data-font="clasica"]    { --sans: 'Lora', serif; }

/* Tamaño base — usando rem correctamente */
/* Tamaño controlado por --base-size via JS sizeAplicar() */

/* Color acento personalizado se inyecta via JS en --accent */

/* ── AJUSTE ROW ────────────────────────────────────────────────── */
.ajuste-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.ajuste-row:last-child { border-bottom: none; }
.ajuste-info  { flex: 1; }
.ajuste-label { font-size: 0.933rem; font-weight: 500; }
.ajuste-sub   { font-size: 0.8rem; color: var(--text3); margin-top: 2px; }

/* ── TOGGLE SWITCH ─────────────────────────────────────────────── */
.toggle-switch {
  position: relative; width: 44px; height: 26px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 13px; cursor: pointer; transition: all 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: var(--text3); border-radius: 50%; transition: all 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(200,240,90,0.2); border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  background: var(--accent); transform: translateX(18px);
}

/* ── TEMA PREVIEW ──────────────────────────────────────────────── */
.tema-previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.tema-preview-card {
  border-radius: 12px;
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.tema-preview-card:active { transform: scale(0.97); }
.tema-preview-card.selected { border-color: var(--accent); }
.tema-preview-card.selected::after {
  content: '✓';
  position: absolute;
  top: 6px; right: 8px;
  font-size: 0.733rem;
  font-weight: 700;
  color: var(--accent);
}

/* Mini mockup dentro del preview */
.tema-mockup {
  padding: 10px 10px 8px;
  height: 90px;
}
.tema-mockup-oscuro  { background: #0f1117; }
.tema-mockup-claro   { background: #f5f5f0; }

.tm-kcal {
  font-family: 'DM Mono', monospace;
  font-size: 1.333rem;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 4px;
}
.tm-label {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.5;
}
.tm-bars { display: flex; gap: 4px; }
.tm-bar {
  flex: 1;
  border-radius: 4px;
  padding: 4px 5px;
}
.tm-bar-label {
  font-size: 7px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tm-bar-val {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  margin-top: 1px;
}

.tema-preview-nombre {
  font-size: 0.733rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  color: var(--text2);
}
.tema-preview-card.selected .tema-preview-nombre {
  color: var(--accent);
}

/* ── COLOR ACENTO ──────────────────────────────────────────────── */
.acento-presets {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.acento-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.acento-dot:active { transform: scale(0.88); }
.acento-dot.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}
.acento-custom-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
}
.acento-custom-wrap.selected {
  border-color: var(--accent);
}
.acento-custom-label {
  font-size: 0.8rem;
  color: var(--text2);
  flex: 1;
}
.acento-custom-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.acento-custom-swatch input[type="color"] {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  border: none; padding: 0; cursor: pointer;
  background: none; opacity: 0;
}

/* ── FONT CARDS ────────────────────────────────────────────────── */
.font-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.font-card {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.font-card:active { transform: scale(0.95); }
.font-card.selected {
  border-color: var(--accent);
  background: rgba(200,240,90,0.07);
}
.font-card-preview {
  font-size: 1.467rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  margin-bottom: 6px;
}
.font-card-name {
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.font-card.selected .font-card-name { color: var(--accent); }

/* Preview de tipografía en vivo */
.font-preview-bar {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  transition: font-family 0.25s ease;
}
.font-preview-line1 {
  font-size: 1.067rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}
.font-preview-line2 {
  font-size: 0.8rem;
  color: var(--text2);
}

/* ── TAMAÑO SLIDER ──────────────────────────────────────────────── */
.size-slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.size-slider-a {
  font-size: 0.8rem;
  color: var(--text3);
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1;
}
.size-slider-a.grande { font-size: 1.2rem; }

#size-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  outline: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
#size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--bg2);
  box-shadow: 0 0 0 1px var(--accent);
  transition: transform 0.15s;
}
#size-slider::-webkit-slider-thumb:active { transform: scale(1.2); }
#size-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--bg2);
}

.size-preview-bar {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text2);
  transition: font-size 0.15s ease;
}

/* ── NOTIF PANEL COLAPSABLE ────────────────────────────────────── */
.notif-expand-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.32,0.72,0,1), opacity 0.3s ease;
}
.notif-expand-panel.visible {
  max-height: 1400px;
  opacity: 1;
}

.notif-tiempo-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: opacity 0.2s;
}
.notif-tiempo-card.inactivo { opacity: 0.4; }
.notif-tiempo-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.notif-tiempo-emoji  { font-size: 1.2rem; }
.notif-tiempo-nombre { flex: 1; font-size: 0.933rem; font-weight: 500; text-transform: capitalize; }
.notif-tiempo-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.notif-tiempo-body .field         { margin-bottom: 0; }
.notif-tiempo-body label.field-label { font-size: 0.733rem; }
.notif-tiempo-body select,
.notif-tiempo-body input[type="time"] { font-size: 0.867rem; padding: 8px 10px; }

.permiso-banner {
  background: rgba(240,168,90,0.1);
  border: 1px solid rgba(240,168,90,0.3);
  border-radius: 10px; padding: 12px 14px;
  font-size: 0.867rem; color: var(--amber);
  display: none; margin-bottom: 12px;
}
.permiso-banner.show { display: block; }

/* ── SEPARADOR DE SECCIÓN ──────────────────────────────────────── */
.ajuste-section-sep {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}