/* Recepta · Configuración (configuracion.js): temas a la izquierda, ajustes con interruptores y guardado automático. */
.cf { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.cf-buscar { width: 260px; max-width: 100%; }
.cf-nav { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 4px; }
.cf-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--tinta); text-decoration: none; border: 1px solid transparent; }
.cf-nav a:hover { background: var(--perla-suave); text-decoration: none; }
.cf-nav a.activo { background: var(--hoja); border-color: var(--perla); box-shadow: var(--sombra); }
.cf-nav a.activo b { color: var(--cobalto); }
.cf-nav-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--perla-suave); font-size: 1.1rem; flex: none; }
.cf-nav a.activo .cf-nav-ico { background: var(--cobalto-suave); }
.cf-nav b { display: block; font-size: 0.92rem; }
.cf-nav small { display: block; color: var(--pizarra); font-size: 0.76rem; line-height: 1.3; }
.cf-nav-sep { margin: 14px 12px 4px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pizarra); }
.cf-nav a.cf-nav-otra { padding: 6px 12px; }
.cf-nav a.cf-nav-otra .cf-nav-ico { width: 28px; height: 28px; font-size: 0.9rem; }
.cf-nav a.cf-nav-otra b { font-weight: 600; font-size: 0.86rem; }
.cf-cuerpo { min-width: 0; }
.cf-bloque { margin: 0 0 16px; }
.cf-cab { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.cf-cab h2 { margin: 0; }
.cf-cab p { margin: 2px 0 0; }
.cf-cab-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--cobalto-suave); font-size: 1.4rem; flex: none; }
.cf-fila { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 0; border-top: 1px solid var(--perla-suave); }
.cf-fila.ancha { flex-direction: column; align-items: stretch; gap: 10px; }
.cf-texto { min-width: 0; flex: 1; }
.cf-texto label { display: block; font-weight: 700; font-size: 0.94rem; margin: 0; }
.cf-texto small { display: block; color: var(--pizarra); font-size: 0.82rem; margin-top: 2px; line-height: 1.4; }
.cf-control { display: flex; align-items: center; gap: 10px; flex: none; max-width: 100%; }
.cf-fila.ancha .cf-control { flex-direction: column; align-items: stretch; }
.cf-control > input { width: 260px; max-width: 100%; }
.cf-control textarea { width: 100%; }
.cf-ok { font-size: 0.78rem; font-weight: 700; min-width: 74px; white-space: nowrap; }
.cf-ok.si { color: var(--menta-texto); } .cf-ok.no { color: var(--error); }
.cf-fila.ancha .cf-ok { min-width: 0; min-height: 1em; }
.cf-unidad { position: relative; display: inline-flex; align-items: center; width: 170px; }
.cf-unidad input { width: 100%; padding-right: 54px; text-align: right; }
.cf-unidad i { position: absolute; right: 12px; color: var(--pizarra); font-style: normal; font-weight: 700; font-size: 0.85rem; pointer-events: none; }
.cf-unidad.izq input { padding-right: 12px; padding-left: 28px; }
.cf-unidad.izq i { right: auto; left: 12px; }
/* Interruptor */
.cf-interruptor { position: relative; display: inline-block; width: 50px; height: 28px; margin: 0; flex: none; cursor: pointer; }
.cf-interruptor input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cf-interruptor span { position: absolute; inset: 0; border-radius: 999px; background: var(--perla); transition: background 0.2s; }
.cf-interruptor span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cf-interruptor input:checked + span { background: var(--menta); }
.cf-interruptor input:checked + span::after { transform: translateX(22px); }
.cf-interruptor input:focus-visible + span { box-shadow: var(--foco); }
.cf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-chips button { border-radius: 999px; padding: 6px 12px; font-size: 0.84rem; font-weight: 600; min-height: 0; }
.cf-chips button.activo { background: var(--cobalto-suave); border-color: var(--cobalto); color: var(--cobalto); }
.cf-chips button.activo::before { content: '✓ '; }
.cf-avanzado { margin-top: 10px; border-top: 1px solid var(--perla-suave); padding-top: 6px; }
.cf-avanzado summary { cursor: pointer; font-weight: 700; color: var(--pizarra); padding: 10px 0; font-size: 0.9rem; }
.cf-avanzado summary small { font-weight: 600; }
.cf-avanzado[open] summary { color: var(--tinta); }
.cf-de { margin-top: 12px; font-size: 0.76rem; font-weight: 800; color: var(--pizarra); text-transform: uppercase; letter-spacing: 0.04em; }
.cf-vacio { color: var(--pizarra); padding: 10px 0; margin: 0; }
.cf-enlace { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--perla-suave); color: var(--tinta); text-decoration: none; }
.cf-enlace:hover { background: var(--cobalto-suave); text-decoration: none; }
.cf-enlace > span:nth-child(2) { flex: 1; } .cf-enlace b, .cf-enlace small { display: block; } .cf-enlace small { color: var(--pizarra); font-size: 0.82rem; }
.cf-reglas { list-style: none; margin: 10px 0; padding: 0; }
.cf-reglas li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--perla-suave); }
.cf-reglas li > span:first-child { flex: 1; min-width: 0; }
.cf-regla-pct { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.cf-regla-form { display: grid; grid-template-columns: 1fr 1fr 140px auto; gap: 8px; margin-top: 10px; }
.cf-regla-form .cf-unidad { width: auto; }
.cf-mas { margin-top: 16px; }
.cf-mas summary { cursor: pointer; color: var(--cobalto); font-weight: 600; font-size: 0.88rem; }
@media (max-width: 900px) {
  .cf { grid-template-columns: 1fr; }
  .cf-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: thin; }
  .cf-nav a { flex: none; padding: 8px 10px; }
  .cf-nav small, .cf-nav-sep, .cf-nav a.cf-nav-otra { display: none; }
  .cf-nav-ico { width: 28px; height: 28px; font-size: 0.95rem; }
}
@media (max-width: 640px) {
  .cf-fila { flex-direction: column; align-items: stretch; gap: 8px; }
  .cf-control { justify-content: space-between; }
  .cf-control > input, .cf-control > .cf-unidad { flex: 1; width: auto; }
  .cf-control .cf-ok { min-width: 0; }
  .encabezado .acciones:has(.cf-buscar) { width: 100%; }
  .cf-regla-form { grid-template-columns: 1fr; }
  .cf-buscar { width: 100%; }
}
