/* Profichef — Espacio de trabajo (2.0), MÓVIL PRIMERO.
   La base son estilos para 320–430 px con dedos; escritorio solo añade columnas en @media (min-width).
   Usa los tokens de shared.css. Objetivos táctiles ≥ 44 px; campos a 16 px para que iOS no haga zoom.
   La barra inferior (Inicio · Recetario · Herramientas · Mis recetas · Cuenta) la pone shared.js: no se duplica aquí. */

.pr-main { padding: 14px 16px 40px; }
.pr-wrap { max-width: 720px; margin: 0 auto; }
.pr-wrap h1 { font-size: 1.55rem; line-height: 1.15; margin: 6px 0 14px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pr-wrap h2 { font-size: 1.02rem; margin: 0 0 10px; }
.pr-section { margin-top: 26px; }
.pr-muted { color: var(--text-muted); font-size: .9rem; }
.pr-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-muted); text-decoration: none; font-size: .95rem; }

/* Controles */
.pr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--border-input); background: var(--bg-elevated); color: inherit; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pr-btn:active { transform: scale(.98); }
.pr-btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.pr-btn.ghost { background: none; border-color: transparent; color: var(--text-muted); }
.pr-btn.block { width: 100%; }
.pr-btn.sm { min-height: 44px; padding: 8px 14px; font-size: .92rem; }
.pr-btn:focus-visible, .pr-chip:focus-visible, .pr-nav button:focus-visible, .pr-lst a:focus-visible, .pr-sheet button:focus-visible, .pr-secbar button:focus-visible, .pr-ask input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pr-wrap input[type=number], .pr-wrap input[type=text], .pr-wrap input[type=search], .pr-wrap input[type=date], .pr-wrap select, .pr-wrap textarea {
  min-height: 48px; padding: 8px 12px; border: 1px solid var(--border-input); border-radius: 12px; background: var(--bg-elevated); color: inherit; font: inherit; font-size: 16px; max-width: 100%; box-sizing: border-box; }
.pr-wrap textarea { width: 100%; }
.pr-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pr-campo label { font-size: .84rem; color: var(--text-muted); }
.pr-fila { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.pr-chip { border: 1px solid var(--border-input); background: var(--bg-elevated); color: inherit; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; min-height: 44px; min-width: 56px; cursor: pointer; }
.pr-chip:active { background: var(--bg-input); }
.pr-rapidos { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Pantalla 1 ---------- */
.pr-ask { display: flex; gap: 8px; }
.pr-ask input { flex: 1; min-width: 0; min-height: 54px; border: 2px solid var(--border-input); border-radius: 14px; padding: 10px 14px; }
.pr-ask button { min-height: 54px; padding: 0 18px; }
.pr-entendido { margin-top: 12px; padding: 14px; border: 1px solid var(--accent); border-radius: 14px; background: var(--bg-elevated); }
.pr-entendido[hidden] { display: none; }
.pr-entendido .quien { font-weight: 650; }
.pr-entendido .detalle { color: var(--text-muted); margin: 3px 0 10px; font-size: .9rem; }
.pr-entendido .otras { margin-top: 10px; font-size: .86rem; color: var(--text-muted); }
.pr-entendido .otras a { color: inherit; display: inline-block; padding: 10px 6px; }
.pr-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pr-grande { display: flex; flex-direction: column; gap: 2px; justify-content: center; min-height: 72px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); color: inherit; text-decoration: none; }
.pr-grande strong { font-size: 1rem; }
.pr-grande .s { color: var(--text-muted); font-size: .8rem; }
.pr-grande.primaria { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pr-grande.primaria .s { color: inherit; opacity: .85; }
.pr-cabeza-seccion { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pr-cabeza-seccion h2 { margin: 0; }
.pr-cabeza-seccion a { color: var(--accent); min-height: 44px; display: inline-flex; align-items: center; font-size: .92rem; }
.pr-reciente-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); color: inherit; text-decoration: none; min-height: 56px; margin-bottom: 8px; }
.pr-reciente-fila .nom { font-weight: 650; display: block; overflow-wrap: anywhere; }
.pr-reciente-fila .meta { color: var(--text-muted); font-size: .8rem; display: block; margin-top: 2px; }
.pr-mas { margin-top: 18px; border-top: 1px solid var(--border); }
.pr-mas summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; color: var(--text-muted); font-weight: 600; }
.pr-linea { list-style: none; margin: 0; padding: 0; }
.pr-linea a { display: flex; align-items: center; min-height: 48px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.pr-solo-escritorio { display: none; }

/* Selección de receta: lista compacta */
.pr-conteo { color: var(--text-muted); font-size: .84rem; margin: 6px 2px 8px; }
.pr-lst { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); overflow: hidden; }
.pr-lst a { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; align-items: center; padding: 8px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); min-height: 52px; }
.pr-lst a:last-child { border-bottom: 0; }
.pr-lst a:active { background: var(--bg-input); }
.pr-lst .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-lst .m { color: var(--text-muted); font-size: .8rem; white-space: nowrap; }
.pr-lst .w { color: var(--warning); font-size: .8rem; grid-column: 1 / -1; }

/* ---------- Pantalla 2: ficha de trabajo ---------- */
.pr-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pr-cab h1 { margin: 2px 0 2px; font-size: 1.4rem; }
.pr-cab .pr-btn { min-width: 48px; padding: 8px; }
.pr-guardada { color: var(--success); font-size: .8rem; }
.pr-resumen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 8px; }
.pr-dato { padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); min-width: 0; }
.pr-dato .l { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.pr-dato .v { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 1px; overflow-wrap: anywhere; }
.pr-dato .n { font-size: .76rem; color: var(--text-muted); margin-top: 1px; }
.pr-dato.parcial { border-color: var(--warning); background: var(--warning-bg); }
.pr-dato.parcial .n { color: var(--warning); font-weight: 600; }
.pr-alerta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--warning); background: var(--warning-bg); color: var(--warning); font-size: .9rem; margin: 0 0 8px; min-height: 48px; width: 100%; text-align: left; font-family: inherit; cursor: pointer; }
.pr-estado { margin: 0 0 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); padding: 0 12px; }
.pr-estado summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; font-size: .92rem; }
.pr-estado ul { list-style: none; margin: 0; padding: 0 0 8px; display: grid; gap: 2px; }
.pr-estado li a { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: baseline; padding: 9px 0; min-height: 44px; color: inherit; text-decoration: none; font-size: .9rem; }
.pr-estado .st { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.pr-estado .completo { color: var(--success); } .pr-estado .incompleto { color: var(--warning); }
.pr-estado .revisar { color: var(--info); } .pr-estado .noaplica { color: var(--text-faint); }

/* Navegación entre secciones: barra compacta (móvil) / lista lateral (escritorio) */
.pr-secbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 48px 1fr 48px; gap: 6px; padding: 8px 0; background: var(--bg); border-bottom: 1px solid var(--border); margin-top: 10px; }
.pr-secbar button { min-height: 48px; border: 1px solid var(--border-input); border-radius: 12px; background: var(--bg-elevated); color: inherit; font: inherit; font-weight: 650; cursor: pointer; }
.pr-secbar .actual { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pr-secbar .pt, .pr-nav .pt, .pr-sheet .pt { width: 9px; height: 9px; border-radius: 50%; background: var(--warning); flex: 0 0 auto; }
.pr-secbar button:disabled { opacity: .35; }
.pr-nav { display: none; }
.pr-sheet-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 200; }
.pr-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 210; background: var(--bg-elevated); border-radius: 18px 18px 0 0; padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px)); max-height: 85vh; overflow-y: auto; box-shadow: 0 -8px 30px rgba(0,0,0,.3); }
.pr-sheet h2 { margin: 10px 4px 6px; font-size: .9rem; color: var(--text-muted); font-weight: 600; }
.pr-sheet button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 54px; border: 0; background: none; color: inherit; font: inherit; font-size: 1.02rem; text-align: left; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.pr-sheet button[aria-current="true"] { background: var(--bg-input); color: var(--accent); font-weight: 650; }
.pr-sheet[hidden], .pr-sheet-scrim[hidden] { display: none; }
.pr-ws { display: block; }
.pr-contenido { min-width: 0; padding-top: 14px; }
.pr-panel[hidden] { display: none; }

/* Filas verticales (sustituyen a las tablas) */
.pr-filas { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); overflow: hidden; }
.pr-f { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); min-height: 52px; }
.pr-f:last-child { border-bottom: 0; }
.pr-f .nom { font-weight: 600; overflow-wrap: anywhere; }
.pr-f .cant { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pr-f .sub { color: var(--text-muted); font-size: .8rem; grid-column: 1 / -1; }
.pr-f.sinprecio { background: var(--warning-bg); }
.pr-f .precio { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-top: 6px; }
.pr-f .precio input { width: 100%; }
.pr-f .precio .u { color: var(--text-muted); font-size: .85rem; white-space: nowrap; }
.pr-f.con-check { grid-template-columns: 44px 1fr auto; }
.pr-f.con-check input[type=checkbox] { width: 26px; height: 26px; margin: 0 auto; }
.pr-f.con-check input:checked ~ .nom { text-decoration: line-through; color: var(--text-faint); }
.pr-f .est { font-size: .82rem; text-align: right; }
.pr-f .est.contiene { color: var(--warning); font-weight: 650; }
.pr-f .est.verificar { color: var(--info); }
.pr-f .est.sindatos { color: var(--text-muted); }
.pr-aviso { padding: 12px 14px; border-radius: 12px; font-size: .9rem; margin: 0 0 12px; line-height: 1.45; }
.pr-aviso.warn { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.pr-aviso.ok { background: var(--success-bg); color: var(--success); }
.pr-aviso.info { background: var(--info-bg); color: var(--info); }
.pr-aviso.err { background: var(--danger-bg); color: var(--danger); }
.pr-alerg { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.pr-alerg span { background: var(--warning-bg); color: var(--warning); font-weight: 650; border-radius: 999px; padding: 6px 14px; font-size: .9rem; }
.pr-acciones-col { display: grid; gap: 10px; margin-top: 14px; }
.pr-toast { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: .92rem; z-index: 300; text-align: center; }

/* Creación / edición rápida de ingredientes */
.pr-rapido textarea { min-height: 54px; resize: none; }
.pr-ing { display: grid; grid-template-columns: 1fr 48px; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); margin-bottom: 8px; }
.pr-ing .nombre input { width: 100%; }
.pr-ing .borrar { grid-column: 2; grid-row: 1; min-height: 48px; border: 0; background: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; border-radius: 12px; }
.pr-ing .cu { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr-ing .cu input, .pr-ing .cu select { width: 100%; }
.pr-ing .pie { grid-column: 1 / -1; font-size: .78rem; color: var(--text-muted); margin-top: -2px; }
.pr-ing .pie.falta { color: var(--warning); }
.pr-guardar-fila { margin-top: 18px; display: grid; gap: 10px; }

/* ---------- Escritorio: la misma interfaz con más espacio ---------- */
@media (min-width: 721px) {
  .pr-solo-escritorio { display: block; }
  .pr-main { padding-top: 26px; }
  .pr-wrap { max-width: 860px; }
  .pr-wrap h1 { font-size: 2rem; }
  .pr-ask input { font-size: 1.1rem; }
  .pr-resumen { grid-template-columns: repeat(4, 1fr); }
  .pr-dos { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .pr-ws { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; margin-top: 18px; }
  .pr-secbar { display: none; }
  .pr-nav { display: block; position: sticky; top: 14px; align-self: start; }
  .pr-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .pr-nav button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; border: 0; background: none; color: var(--text-muted); font: inherit; font-weight: 600; padding: 10px 12px; min-height: 46px; border-radius: 10px; border-left: 3px solid transparent; cursor: pointer; }
  .pr-nav button:hover { background: var(--bg-input); color: inherit; }
  .pr-nav button[aria-current="true"] { color: var(--accent); background: var(--bg-elevated); border-left-color: var(--accent); }
  .pr-contenido { padding-top: 0; }
  .pr-sheet, .pr-sheet-scrim { display: none !important; }
  .pr-acciones-col { grid-auto-flow: column; grid-auto-columns: max-content; }
}
@media print {
  .site-header, .site-footer, .pc-bottom-nav,   .pr-panel[hidden] { display: none !important; }
  body { background: #fff; color: #000; padding-bottom: 0 !important; }
}

/* ---- Pie de página compacto (espacio de trabajo) ---- */
.site-footer:has(.pr-pie) { margin-top: 28px; padding: 6px 0 calc(78px + env(safe-area-inset-bottom, 0px)); }
.pr-pie > summary { list-style: none; cursor: pointer; text-align: center; color: var(--text-faint); font-size: .85rem; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pr-pie > summary::-webkit-details-marker { display: none; }
.pr-pie > summary::after { content: '▾'; font-size: .8em; }
.pr-pie[open] > summary::after { content: '▴'; }
.pr-pie-cuerpo { padding: 4px 0 8px; }
@media (min-width: 900px) { .site-footer:has(.pr-pie) { padding-bottom: 24px; } }
@media print { .pr-pie { display: none; } }

/* ---- Mis herramientas (inicio) ---- */
.pr-herr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr-herr-a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); color: inherit; text-decoration: none; font-weight: 600; font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent; }
.pr-herr-a:active { background: var(--bg-input); }
.pr-herr-a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pr-herr-a > span:first-child { font-size: 1.25rem; flex: 0 0 auto; }
@media (min-width: 900px) { .pr-herr { grid-template-columns: repeat(3, 1fr); } }

/* ---- Laboratorio de recetas: tercer mosaico del inicio (en móvil ocupa todo el ancho) ---- */
@media (max-width: 899px) { .pr-grande-lab { grid-column: 1 / -1; } }
