/* ===== Tokens =====
   La app elige su tema (oscuro por defecto, claro desde Ajustes) con data-app-theme en <html>. */
:root, :root[data-app-theme="light"] {
  --bg: #F7F5F2; --surface: #FFFFFF; --surface-2: #F0EDE8; --text: #1C1A17; --muted: #6B655D;
  --border: #E3DED6; --accent: #B23A1E; --accent-hover: #9A3018; --accent-ink: #FFFFFF; --accent-soft: #F8E6E0;
  --ok: #2F7D4F; --ok-soft: #E3F1E8; --warn: #9A5A00; --warn-soft: #FBEFD9; --info: #2560A8; --info-soft: #E2ECF8;
  --danger: #C0392B; --scrim: rgba(15, 12, 10, .45);
  --shadow: 0 1px 2px rgba(28,26,23,.06), 0 2px 8px rgba(28,26,23,.05);
  --shadow-lg: 0 12px 40px rgba(28,26,23,.18);
  --radius: 14px; --radius-sm: 10px;
  --ph-bg-l: 92%; --ph-ink-l: 32%; --ph-sat: 32%; --pc-bg-l: 93%; --pc-ink-l: 32%;
  --logo: url('logo.png');
  color-scheme: light;
}
:root[data-app-theme="dark"] {
  --bg: #141210; --surface: #1D1A17; --surface-2: #28241F; --text: #F2EEE8; --muted: #A69E94;
  --border: #35302A; --accent: #E2603F; --accent-hover: #EE7656; --accent-ink: #1A0E09; --accent-soft: #3A231C;
  --ok: #5DBB84; --ok-soft: #1B3024; --warn: #E7A949; --warn-soft: #3A2A12; --info: #7DB0EE; --info-soft: #182A40;
  --danger: #F07A6B; --scrim: rgba(0, 0, 0, .6);
  --shadow: none; --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --ph-bg-l: 20%; --ph-ink-l: 76%; --ph-sat: 22%; --pc-bg-l: 22%; --pc-ink-l: 76%;
  color-scheme: dark;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 41; background: var(--surface); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(24px, 4vw, 30px); font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); }
.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.ic svg, [data-ic] svg { width: 100%; height: 100%; display: block; }
[data-ic] { width: 22px; height: 22px; display: inline-block; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===== Barra superior y menú ===== */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 16px; }
.topbar-in .logo { justify-self: center; max-width: 100%; }
@media (max-width: 359px) { .menu-btn > span:last-child { display: none; } .menu-btn { padding: 0 10px; } }
.menu-btn { justify-self: start; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 15px; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--surface-2); }
.logo { display: block; width: 132px; height: 30px; background: var(--text); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.avatar { justify-self: end; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 700px) { .logo { width: 170px; height: 38px; } }

.menu-backdrop { position: fixed; inset: 0; z-index: 44; background: var(--scrim); }
.menu { position: fixed; z-index: 45; top: calc(env(safe-area-inset-top, 0px) + 72px); left: max(12px, env(safe-area-inset-left, 0px)); width: min(340px, calc(100vw - 24px)); max-height: calc(100vh - 96px - env(safe-area-inset-top, 0px)); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; }
@media (min-width: 1140px) { .menu { left: calc((100vw - 1100px) / 2 + 12px); } }
.menu-user { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-user b { display: block; }
.mgroup { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 12px 6px; }
.mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 10px; font-weight: 600; font-size: 15.5px; border: 0; background: transparent; text-align: left; }
.mi:hover { background: var(--surface-2); }
.mi.on { background: var(--accent-soft); color: var(--accent); }
.mi .count { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mi .badge { margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.mi.sub { padding-left: 16px; font-weight: 500; font-size: 15px; }
.cdot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: hsl(var(--h, 30) 45% 55%); }

/* ===== Página ===== */
.page { max-width: 1100px; margin: 0 auto; padding: 22px 16px 80px; }
@media (min-width: 960px) { .page { padding: 32px 24px 80px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.link { color: var(--accent); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 15px; margin-bottom: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: color-mix(in srgb, var(--ok) 85%, #000); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 10px; }
.btn-lg { min-height: 54px; font-size: 16.5px; padding: 0 22px; }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip .ic { width: 15px; height: 15px; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.info { background: var(--info-soft); color: var(--info); }
.pchip { background: hsl(var(--h) 65% var(--pc-bg-l)); color: hsl(var(--h) 60% var(--pc-ink-l)); }
.pchip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 18px; scrollbar-width: none; }
.filters button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.filters button.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.filters button small { font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }

.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 52px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); padding: 0 16px 0 46px; font-size: 16px; box-shadow: var(--shadow); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }

.ph { width: 100%; height: 100%; background: hsl(var(--h, 30) var(--ph-sat) var(--ph-bg-l)); color: hsl(var(--h, 30) 40% var(--ph-ink-l)); display: grid; place-items: center; place-content: center; text-align: center; font-weight: 700; letter-spacing: .02em; }
.ph span { opacity: .9; padding: 0 12px; }
.ph small { display: block; font-weight: 500; font-size: 12px; opacity: .75; margin-top: 4px; }
img.photo { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== Tareas del día ===== */
.prod-top { display: grid; gap: 14px; margin-bottom: 16px; }
.datenav { display: flex; align-items: center; gap: 6px; padding: 6px; }
.datenav .d { font-weight: 700; font-size: 17px; min-width: 0; flex: 1; text-align: center; }
.datenav .d::first-letter { text-transform: uppercase; }
.datenav .d small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.prog-line { display: flex; align-items: center; gap: 12px; }
.prog-line .progress { flex: 1; }
.prog-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 760px) { .prod-top { grid-template-columns: minmax(0, 1fr) minmax(240px, auto); align-items: center; } }

.psec { margin-top: 22px; }
.psec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.psec-head .pdot { width: 12px; height: 12px; border-radius: 50%; background: hsl(var(--h) 60% 50%); }
.psec-head .who { color: var(--muted); font-weight: 600; font-size: 15px; }
.psec-head .cnt { margin-left: auto; color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tasks { display: flex; flex-direction: column; gap: 10px; }

.task { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 14px; cursor: pointer; border-left: 4px solid hsl(var(--h, 30) 55% 55%); }
.task:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); border-left-color: hsl(var(--h, 30) 55% 55%); }
.tcheck { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); display: grid; place-items: center; color: transparent; }
.tcheck:hover { border-color: var(--ok); }
.tcheck .ic { width: 24px; height: 24px; }
.task.st-hecha .tcheck { background: var(--ok); border-color: var(--ok); color: #fff; }
.task.st-curso .tcheck { border-color: var(--info); }
.task.st-hecha { background: color-mix(in srgb, var(--surface) 65%, var(--bg)); }
.task.st-hecha .ttitle { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.ttitle { font-weight: 700; font-size: 17px; line-height: 1.3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; color: var(--muted); font-size: 14px; align-items: center; }
.tmeta .qty { color: var(--text); font-weight: 700; }
.tmeta .ic { width: 16px; height: 16px; }
.titems { margin-top: 6px; font-size: 14px; color: var(--muted); }
.titems b { color: var(--text); font-weight: 600; }
.tstatus { margin-top: 6px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.tstatus .ic { width: 16px; height: 16px; }
.tstatus.ok { color: var(--ok); } .tstatus.info { color: var(--info); }
.tnote { margin-top: 6px; font-size: 14px; color: var(--warn); display: flex; gap: 6px; align-items: flex-start; }
.tnote .ic { width: 16px; height: 16px; margin-top: 2px; }
.tactions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tmore { color: var(--accent); font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty .btn-row { justify-content: center; margin-top: 16px; }

/* Detalle de tarea */
.td-head { display: grid; gap: 10px; margin-bottom: 18px; }
.td-head .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.td-head .tmeta { font-size: 15px; }
.td-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; }
.note-box { padding: 14px 16px; border-left: 4px solid var(--warn); background: var(--warn-soft); border-radius: var(--radius-sm); }
.note-box b { display: flex; align-items: center; gap: 6px; color: var(--warn); margin-bottom: 2px; }
.items { display: flex; flex-direction: column; gap: 10px; }
.titem { display: grid; grid-template-columns: 34px 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; }
.titem .n { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.titem .th { width: 72px; height: 56px; border-radius: 10px; overflow: hidden; }
.titem b { display: block; font-size: 16.5px; line-height: 1.3; }
.titem .r-meta { margin-top: 4px; }
.titem .uses { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.titem .uses a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.titem .go { color: var(--accent); }
@media (max-width: 560px) { .titem { grid-template-columns: 30px minmax(0, 1fr) auto; } .titem .th { display: none; } }

/* ===== Recetas ===== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat { display: flex; flex-direction: column; overflow: hidden; }
.cat .ph, .cat .thumb { aspect-ratio: 4 / 3; font-size: 34px; font-weight: 700; }
.cat-body { padding: 10px 12px 12px; }
.cat-body b { display: block; font-size: 15px; line-height: 1.25; }
.cat-body small { color: var(--muted); font-size: 13px; }
.cat:hover, .r-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.r-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.r-card { overflow: hidden; display: flex; flex-direction: column; }
.r-card .thumb { aspect-ratio: 16 / 10; }
.r-card .ph span { font-size: 18px; }
.r-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.r-card-body b { font-size: 16.5px; line-height: 1.3; }
.r-meta { display: flex; gap: 6px 12px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; align-items: center; }
.r-meta span { display: inline-flex; align-items: center; gap: 4px; }
.r-meta .ic { width: 16px; height: 16px; }

.r-hero { display: grid; gap: 18px; margin-bottom: 18px; }
.r-hero-img { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; border: 1px solid var(--border); max-width: 100%; }
.r-hero-img .ph span { font-size: 22px; }
.r-title .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.r-title h1 { font-size: clamp(26px, 4vw, 34px); margin: 10px 0 6px; }
.r-title .upd { color: var(--muted); font-size: 14px; }
.r-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
@media (min-width: 760px) { .r-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fact { padding: 12px 14px; }
.fact small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.fact small .ic { width: 16px; height: 16px; }
.fact b { display: block; margin-top: 4px; font-size: 16px; }
.allergens { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.uses-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; padding: 12px 14px; }
.uses-box a { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; }

.scaler { padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 18px; }
.scaler .lbl { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.scaler .presets { display: flex; gap: 6px; }
.scaler .presets button { min-width: 48px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; }
.scaler .presets button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scaler .yield { display: flex; align-items: center; gap: 8px; }
.scaler input { width: 96px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); padding: 0 10px; font-weight: 700; font-size: 16px; text-align: right; }
.scaler .hint { color: var(--muted); font-size: 13.5px; flex-basis: 100%; }
.scaler .hint b { color: var(--accent); }

.r-cols { display: grid; gap: 18px; }
@media (min-width: 900px) { .r-cols { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; } .r-cols .ing-card { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); } }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: grid; grid-template-columns: 26px 92px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.ing-list li:last-child { border-bottom: 0; }
.ing-list .box { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px; display: grid; place-items: center; margin-top: 1px; color: transparent; }
.ing-list .box .ic { width: 14px; height: 14px; }
.ing-list .q { font-weight: 700; font-variant-numeric: tabular-nums; }
.ing-list .n small { display: block; color: var(--muted); font-size: 13.5px; }
.ing-list .n a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ing-list .n .subtag { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 1px 8px; vertical-align: 1px; }
.ing-list li.got .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.ing-list li.got .n, .ing-list li.got .q { color: var(--muted); text-decoration: line-through; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.steps li:last-child { border-bottom: 0; }
.steps .num { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.steps p { margin: 4px 0 0; font-size: 16.5px; }
.btn-timer { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.btn-timer .ic { width: 16px; height: 16px; color: var(--accent); }
.plating { display: grid; gap: 16px; }
@media (min-width: 700px) { .plating { grid-template-columns: 220px 1fr; align-items: start; } }
.plating .pimg { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4/3; border: 1px solid var(--border); max-width: 100%; }

/* ===== Formularios ===== */
.form { display: flex; flex-direction: column; gap: 18px; }
.form fieldset { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px 18px 18px; margin: 0; min-width: 0; }
.form legend { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); padding: 0 6px; }
.fgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .lbl-sm { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .row-in { width: 100%; min-height: 46px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); padding: 10px 12px; font-size: 16px; min-width: 0; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .row-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }
.help { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.rows { display: flex; flex-direction: column; gap: 8px; }
.ing-row { display: grid; grid-template-columns: 84px 104px minmax(0, 1fr) 42px; gap: 8px; align-items: center; }
.ing-row .row-in.nota { grid-column: 3 / 4; min-height: 40px; font-size: 14.5px; }
.ing-row .gap { grid-column: 1 / 3; }
.step-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 96px 42px; gap: 8px; align-items: start; }
.step-row .num { width: 30px; height: 46px; display: grid; place-items: center; font-weight: 700; color: var(--accent); }
.step-row textarea.row-in { min-height: 64px; resize: vertical; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 96px 42px; gap: 8px; align-items: center; }
@media (max-width: 620px) {
  .ing-row { grid-template-columns: 1fr 1fr 42px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
  .ing-row .row-in.n { grid-column: 1 / 3; grid-row: 2; }
  .ing-row .row-in.nota { grid-column: 1 / 3; grid-row: 3; }
  .ing-row .icon-btn { grid-column: 3; grid-row: 1; }
  .ing-row .gap { display: none; }
  .step-row { grid-template-columns: 26px minmax(0, 1fr) 42px; }
  .step-row .min { grid-column: 2; }
  .step-row .icon-btn { grid-column: 3; grid-row: 1; }
  .item-row { grid-template-columns: 1fr 1fr 42px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
  .item-row .ir { grid-column: 1 / 3; }
  .item-row .icon-btn { grid-column: 3; grid-row: 1; }
}
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; cursor: pointer; background: var(--bg); }
.checks input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.checks.wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.photo-pick { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: center; }
.photo-pick .prev { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
@media (max-width: 480px) { .photo-pick { grid-template-columns: 1fr; } }
.form-actions { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
@media (max-width: 480px) { .form-actions .btn { padding: 0 14px; } .form-actions .lbl { display: none; } }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.prow:last-of-type { border-bottom: 0; }
.prow .pname { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 75; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 600px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet .fgrid { margin-bottom: 4px; }
.sheet .btn-row { margin-top: 18px; justify-content: flex-end; }
@media (min-width: 640px) { .modal { align-items: center; } .sheet { border-radius: 20px; } }

/* ===== Paso a paso ===== */
.cook { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; }
.cook-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--surface); }
.cook-top .t { flex: 1; min-width: 0; }
.cook-top .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-top .t small { color: var(--muted); }
.cook-bar { height: 5px; background: var(--surface-2); }
.cook-bar i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.cook-body { flex: 1; display: grid; overflow: hidden; position: relative; }
.cook-step { overflow: auto; padding: 28px 22px; display: flex; flex-direction: column; justify-content: center; max-width: 900px; width: 100%; margin: 0 auto; }
.cook-step .kicker { color: var(--accent); font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.cook-step .recipe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-weight: 600; font-size: 15px; margin-top: 6px; }
.cook-step p.big { font-size: clamp(24px, 4.2vw, 40px); line-height: 1.35; font-weight: 600; margin: 14px 0 0; }
.cook-step .btn-timer { font-size: 18px; padding: 12px 18px; margin-top: 24px; align-self: flex-start; }
.cook-step .btn-timer .ic { width: 22px; height: 22px; }
.cook-step.prep { justify-content: flex-start; }
.cook-step.prep h2 { font-size: clamp(24px, 4vw, 32px); margin: 8px 0 4px; }
.cook-step.prep .qty { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.cook-step.prep .ing-list li { font-size: 17px; }
.cook-step.end { align-items: center; text-align: center; }
.cook-step.end .bigcheck { width: 88px; height: 88px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin-bottom: 18px; }
.cook-step.end .bigcheck .ic { width: 48px; height: 48px; }
.cook-step.end h2 { font-size: clamp(24px, 4vw, 32px); }
.cook-step.end p { color: var(--muted); font-size: 17px; margin: 8px 0 24px; }
.cook-ing { display: none; border-left: 1px solid var(--border); background: var(--surface); overflow: auto; padding: 18px; }
.cook-ing.open { display: block; position: absolute; inset: 0; z-index: 2; border-left: 0; }
.cook-ing .ing-list li { grid-template-columns: 26px 96px minmax(0, 1fr); font-size: 17px; }
@media (min-width: 1000px) { .cook-body.has-ing { grid-template-columns: 1fr 360px; } .cook-body.has-ing .cook-ing { display: block; position: static; } .cook-ing-toggle { display: none !important; } }
.cook-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.cook-nav .btn { min-height: 60px; font-size: 18px; border-radius: 14px; }

/* ===== Temporizadores ===== */
.timers { position: fixed; z-index: 80; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
body.cooking .timers { bottom: calc(100px + env(safe-area-inset-bottom)); }
.tpill { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); border-radius: 14px; padding: 8px 8px 8px 14px; box-shadow: var(--shadow-lg); min-width: 190px; }
.tpill .ic { width: 20px; height: 20px; }
.tpill b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.tpill small { display: block; font-size: 12px; opacity: .75; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpill .icon-btn { color: inherit; width: 36px; height: 36px; margin-left: auto; }
.tpill.done { background: var(--accent); color: var(--accent-ink); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* ===== Login ===== */
.login { position: fixed; inset: 0; z-index: 90; background: var(--bg); overflow: auto; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 440px; }
.login-brand { text-align: center; margin-bottom: 28px; display: grid; justify-items: center; gap: 6px; }
.login-brand .logo { width: min(300px, 80vw); height: 68px; }
.login-brand p { margin: 0; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.who { display: flex; flex-direction: column; gap: 10px; }
.who button { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.who button:hover { border-color: var(--accent); }
.who b { display: block; font-size: 17px; }
.who .avatar { width: 46px; height: 46px; }
.who .chip { margin-top: 4px; }
.pin { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pin input { width: 200px; height: 60px; font-size: 30px; letter-spacing: .5em; text-align: center; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); padding-left: .5em; }
.pin .err { color: var(--danger); font-weight: 600; min-height: 22px; }

/* ===== Toast ===== */
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Barra superior: avisos ===== */
.top-right { justify-self: end; display: flex; align-items: center; gap: 6px; }
.top-right .avatar { justify-self: auto; }
.bell { position: relative; color: var(--text); }
.bell-badge { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.menu-right { left: auto; right: max(12px, env(safe-area-inset-right, 0px)); width: min(380px, calc(100vw - 24px)); }
@media (min-width: 1140px) { .menu-right { left: auto; right: calc((100vw - 1100px) / 2 + 12px); } }
.nitem { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; width: 100%; padding: 11px 10px; border-radius: 10px; border: 0; background: transparent; text-align: left; font-size: 14.5px; }
.nitem:hover { background: var(--surface-2); }
.nitem .ni { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.nitem .ni .ic { width: 18px; height: 18px; }
.nitem b { font-weight: 600; }
.nitem small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.nitem.warn .ni { background: var(--warn-soft); color: var(--warn); }
.nitem.late .ni { background: var(--accent-soft); color: var(--accent); }
.nitem.unread { background: var(--info-soft); }
.nitem.unread .ni { background: var(--surface); color: var(--info); }

/* ===== Entrada: elegir área ===== */
.areas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.area-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); font-weight: 700; font-size: 19px; }
.area-card:hover { border-color: var(--accent); }
.area-card .ic { width: 42px; height: 42px; color: var(--accent); }
.area-card small { font-weight: 500; font-size: 13.5px; color: var(--muted); }
/* Quiz: un acceso aparte, encima de Cocina y Sala */
.area-card.quiz-card { width: 100%; flex-direction: row; justify-content: center; gap: 12px; padding: 14px 12px; margin-top: 12px; font-size: 17px; }
.area-card.quiz-card > span:not(.ic) { display: flex; flex-direction: column; align-items: flex-start; }
.area-card.quiz-card .ic { width: 28px; height: 28px; }
.login-back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; margin-bottom: 12px; padding: 6px 0; }

/* ===== Avisos en la parte superior de una sección ===== */
.banners { display: grid; gap: 10px; margin-bottom: 18px; }
/* Aviso con botón para quitarlo: el enlace ocupa todo menos la X */
.banner.has-x { padding: 0; gap: 0; }
.banner.has-x .banner-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 6px 12px 16px; color: inherit; }
.banner .bx { flex: none; width: 44px; align-self: stretch; border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: 0 var(--radius) var(--radius) 0; }
.banner .bx:hover { color: var(--text); background: var(--surface-2); }
/* Sectores de sala: el mío, en grande y con el color del sector */
.sx-mio { display: grid; gap: 2px; padding: 18px 20px; margin-bottom: 16px; border-radius: var(--radius); background: hsl(var(--h) 55% 42%); color: #fff; }
.sx-mio.runner { background: var(--accent); color: var(--accent-ink); }
.sx-mio.libre { background: var(--surface-2); color: var(--text); }
.sx-mio-k { font-size: 14px; font-weight: 600; opacity: .85; }
.sx-mio b { font-size: 40px; line-height: 1.1; letter-spacing: -.01em; }
.sx-mio > span:last-child:not(.sx-mio-k) { font-size: 14.5px; opacity: .9; }
/* Sectores de sala */
.sx { padding: 12px 16px 6px; }
.sx.now { border-color: var(--accent); }
.sx-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sx-head b { font-size: 17px; }
.sx-head .icon-btn { margin-left: auto; }
.sx.now .sx-head b { font-size: 19px; color: var(--accent); }
.sx-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.sx-z { display: inline-flex; align-items: center; gap: 8px; width: 112px; flex: none; font-weight: 600; color: var(--muted); }
.sx-z .ic { width: 16px; height: 16px; }
.sx-z .pdot { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--h) 60% 50%); flex: none; }
.sx-p { flex: 1; min-width: 0; font-weight: 600; }
.sx-row.me .sx-p { color: var(--accent); }
.sx-row.me .sx-z { color: var(--text); }
.sx-row.fija .sx-z, .sx-row.fija .sx-p { opacity: .75; }
.sx-grid { display: grid; gap: 12px; }
@media (min-width: 760px) { .sx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sx-tabla { padding: 4px 12px; overflow-x: auto; }
.sx-tabla table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sx-tabla th, .sx-tabla td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.sx-tabla thead th { color: var(--muted); font-weight: 600; font-size: 13px; }
.sx-tabla tbody th { text-align: left; font-weight: 600; }
.sx-tabla tr:last-child th, .sx-tabla tr:last-child td { border-bottom: 0; }
.sx-tabla tr.me th { color: var(--accent); }
.banner { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 16px; border-left: 4px solid var(--info); color: inherit; }
.banner:hover .bgo { background: var(--surface-2); color: var(--text); }
.banner b.bt { font-size: 17px; }
.banner.now { background: var(--accent-soft); border-color: transparent; border-left-color: var(--accent); }
.banner.now .bi { background: var(--accent); color: var(--accent-ink); }
.banner.now b.bt { font-size: 19px; color: var(--accent); }
.banner.now.ok { background: var(--ok-soft); border-left-color: var(--ok); }
.banner.now.ok .bi { background: var(--ok); color: #fff; }
.banner.now.ok b.bt { color: var(--ok); }
.banner.late .bt span { color: var(--accent); font-weight: 600; }
.bnum { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bgo { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--muted); flex: none; }
.bgo .ic { width: 18px; height: 18px; }
.banner.warn { border-left-color: var(--warn); }
.banner.late { border-left-color: var(--accent); }
.banner.ok { border-left-color: var(--ok); }
.banner .bi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); flex: none; }
.banner.warn .bi { background: var(--warn-soft); color: var(--warn); }
.banner.late .bi { background: var(--accent-soft); color: var(--accent); }
.banner.ok .bi { background: var(--ok-soft); color: var(--ok); }
.banner .bt { flex: 1; min-width: 0; }
.banner .bt b { display: block; font-size: 16px; }
.banner .bt span { color: var(--muted); font-size: 14px; }

/* ===== Apertura y cierre ===== */
.seg-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; min-height: 46px; padding: 0 18px; border-radius: 11px; font-weight: 700; font-size: 15.5px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg button .ic { width: 18px; height: 18px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
@media (max-width: 560px) { .seg-row .seg { flex: 1 1 100%; } .seg button { flex: 1; padding: 0 8px; } }
.now-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; color: var(--muted); font-size: 14.5px; }
.now-line span.when::first-letter { text-transform: uppercase; }
.grp { padding: 4px 16px 8px; margin-bottom: 14px; }
.grp-head { display: flex; align-items: center; gap: 10px; padding: 12px 0 6px; flex-wrap: wrap; }
.grp-head .who { color: var(--muted); font-weight: 600; font-size: 15px; }
.grp-head .cnt { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.chk { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 13px 2px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 16px; }
.chk:last-child { border-bottom: 0; }
.chk .box { width: 26px; height: 26px; border: 2px solid var(--border); border-radius: 7px; display: grid; place-items: center; color: transparent; }
.chk .box .ic { width: 16px; height: 16px; }
.chk.done .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk.done .txt { color: var(--muted); text-decoration: line-through; }
.chk .who { display: block; font-size: 13px; color: var(--ok); font-weight: 600; margin-top: 2px; }
.chk .tagcol { display: flex; align-items: center; gap: 4px; }
.chk .tagcol .icon-btn { width: 36px; height: 36px; }

/* ===== Pedidos ===== */
.prov { padding: 2px 16px 6px; margin-bottom: 14px; }
.prov-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 0 4px; }
.prov-head h2 { font-size: 17.5px; flex: 1 1 180px; }
.prov-when { margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.prov-when .ic { width: 16px; height: 16px; }
.prod { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.prod:last-child { border-bottom: 0; }
.prod .st { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; color: transparent; }
.prod .st .ic { width: 14px; height: 14px; }
.prod.rev .st { background: var(--ok); border-color: var(--ok); color: #fff; }
.prod .pn b { display: block; font-size: 16px; }
.prod .pn small { color: var(--muted); font-size: 13.5px; }
.prod .ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.qty-in { width: 84px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); padding: 0 10px; font-size: 16px; font-weight: 700; text-align: right; }
.qty-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }
.unit { color: var(--muted); font-size: 14px; min-width: 40px; }
.mini { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 7px 11px; font-size: 13.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.mini .ic { width: 15px; height: 15px; }
.mini:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 640px) { .prod { grid-template-columns: 26px minmax(0, 1fr); } .prod .ctl { grid-column: 2; justify-content: flex-start; } }
.actionbar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; justify-content: flex-end; margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
.actionbar .sum { flex: 1 1 220px; color: var(--muted); font-size: 14px; }
@media (max-width: 560px) { .actionbar .sum { flex-basis: 100%; font-size: 13px; } .actionbar .btn { flex: 1 1 0; padding-left: 8px; padding-right: 8px; } }

/* ===== Horarios ===== */
.week-me { padding: 2px 16px 6px; margin-bottom: 20px; }
.wm-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: center; }
.wm-row:last-child { border-bottom: 0; }
.wm-row .d { font-weight: 700; }
.wm-row .d::first-letter { text-transform: uppercase; }
.wm-row.today .d { color: var(--accent); }
.wm-row .shs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sh { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.sh .ic { width: 14px; height: 14px; }
.sh-m { background: var(--warn-soft); color: var(--warn); }
.sh-n { background: var(--info-soft); color: var(--info); }
.sh-off { background: var(--surface-2); color: var(--muted); }
.hwrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.htable { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; }
.htable th, .htable td { border-bottom: 1px solid var(--border); padding: 6px 4px; text-align: center; }
.htable th { font-size: 12.5px; color: var(--muted); font-weight: 700; line-height: 1.3; padding-top: 10px; padding-bottom: 10px; }
.htable th b { display: block; font-size: 15px; color: var(--text); }
.htable .today { background: var(--accent-soft); }
.htable .closed { opacity: .45; }
.htable .sh { font-size: 12px; padding: 3px 7px; }
.htable .hcell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
/* Quiénes se turnan el horario cada semana */
.alt-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; font-size: 14.5px; }
.alt-box > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.alt-box .ic { width: 16px; height: 16px; color: var(--muted); }
/* Nombre en la tabla de horarios: abre su horario de cada semana */
.pn-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; padding: 6px 0; text-align: left; }
.pn-btn .ic { width: 14px; height: 14px; color: var(--muted); }
/* Horario de cada semana: un día por fila con mediodía y noche */
.hb { display: grid; gap: 2px; }
.hb-row { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.hb-row:last-child { border-bottom: 0; }
.hb-row b { grid-row: span 2; }
.hb-row .hrs { margin-left: 0; }
.hb-row .hrs .ic { width: 16px; height: 16px; }
/* Horas de entrada y salida en el turno */
.shift-checks { grid-template-columns: 1fr; }
.shift-checks label { flex-wrap: wrap; }
.hrs { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); }
.hrs input { width: 96px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 6px; font: inherit; font-size: 15px; }
.htable .pn { text-align: left; font-weight: 700; position: sticky; left: 0; z-index: 1; background: var(--surface); white-space: nowrap; padding-left: 12px; padding-right: 10px; }
.htable tr:last-child td { border-bottom: 0; }
.hcell { display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; min-height: 52px; width: 100%; border: 0; background: transparent; border-radius: 8px; padding: 4px 2px; }
button.hcell:hover { background: var(--surface-2); }
.hcell .note { font-size: 11px; color: var(--muted); line-height: 1.2; }

/* ===== Carta y alérgenos ===== */
/* ===== Carta (con el aspecto de la carta digital) ===== */
.ct-banner { position: relative; margin: -22px -16px 18px; height: 190px; overflow: hidden; background: var(--surface-2); }
.ct-banner-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.ct-tools { display: flex; gap: 8px; align-items: center; margin: 4px 0 14px; }
.ct-search { flex: 1; min-width: 0; }
.ct-search input { height: 46px; }
.ct-tools .mini { height: 46px; padding: 0 14px; flex: none; }
.mini.on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.ct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ct-cat { display: flex; flex-direction: column; overflow: hidden; padding: 0; color: inherit; border-radius: 18px; }
.ct-cat-img { aspect-ratio: 16 / 10; background: var(--surface-2); }
.ct-cat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-cat-b { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 14px; flex: 1; }
.ct-cat-b > div { flex: 1; min-width: 0; }
.ct-cat-b b { display: block; font-size: 15px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.25; }
.ct-cat-b span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.ct-go { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; flex: none; }
.ct-go .ic { width: 16px; height: 16px; }
.ct-cat:hover .ct-go { background: var(--text); color: var(--bg); border-color: var(--text); }
.ct-back { position: absolute; top: 12px; left: 12px; width: 42px; height: 42px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; }
.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ct-head h1 { margin: 0; font-size: 28px; text-transform: uppercase; }
.ct-desc { color: var(--muted); margin: 8px 0 16px; font-size: 15.5px; }
.ct-list { padding: 0 14px; }
.ct-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.ct-item:last-child { border-bottom: 0; }
.ct-item-b { flex: 1; min-width: 0; }
.ct-item-b b { display: block; font-size: 15.5px; text-transform: uppercase; letter-spacing: .01em; }
.ct-item-b p { margin: 3px 0 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ct-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.ct-al { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.ct-al span { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; }
.ct-al.unc { opacity: .55; }
.ct-thumb { width: 88px; height: 88px; border-radius: 14px; object-fit: cover; flex: none; background: #fff; }
.ct-edit { display: flex; gap: 6px; margin-top: 8px; }
.ct-sec-t { font-size: 17px; text-transform: uppercase; margin: 0 0 10px; }
.ct-count { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.ct-det { position: relative; }
.ct-det-img { display: block; width: calc(100% + 36px); max-width: none; margin: -20px -18px 16px; aspect-ratio: 16 / 10; object-fit: cover; background: #fff; }
.ct-x { position: absolute; top: -8px; right: -6px; background: var(--surface); }
.ct-det h2 { margin: 0; padding-right: 44px; font-size: 23px; text-transform: uppercase; }
.ct-det-sec { margin: 2px 0 10px; font-size: 14px; }
.ct-det p { font-size: 15.5px; }
.ct-det-l { margin: 6px 0; }
.ct-det-al { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.emo { font-style: normal; }
@media (min-width: 760px) {
  .ct-banner { margin: 0 0 18px; height: 240px; border-radius: 18px; }
  .ct-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pl-empty { margin: 0; padding: 14px 0; }
/* Apertura y cierre: qué lista se está viendo, en una línea */
.ac-now { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ac-now > .ic { color: var(--accent); }
.ac-now b { font-size: 18px; }
.ac-now .mini { margin-left: auto; }
/* Filtro por tipo de receta: una fila que se desliza de lado */
.rc-filtros { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px 16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.rc-filtros::-webkit-scrollbar { display: none; }
.rc-filtros button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 13px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rc-filtros button span { font-size: 12.5px; opacity: .75; }
.rc-filtros button.on { background: var(--text); border-color: var(--text); color: var(--bg); }
/* Ficha por completar */
.draft-box { display: grid; gap: 12px; margin-top: 16px; }
.draft-box > b { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.draft-box p { margin: 0; font-size: 15px; }
.draft-prog { display: flex; gap: 8px; flex-wrap: wrap; }
.draft-prog > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 14px; }
.draft-prog > span.ok { background: var(--ok-soft); color: var(--ok); }
.draft-prog .ic { width: 16px; height: 16px; }
.pl-okb { color: var(--ok); border-color: var(--ok); }
.chip.pend { background: transparent; border: 1px dashed var(--muted); }
.al-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.al-filter button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.al-filter button.on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }

/* ===== Configuración ===== */
.cfg-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.cfg-row:last-child { border-bottom: 0; }
.cfg-row b { display: block; }
.cfg-row small { color: var(--muted); font-size: 13.5px; }
.checks.days { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

/* ===== Cabecera de receta: foto a sangre con tarjeta superpuesta ===== */
.rhero { position: relative; margin: -22px -16px 0; }
.rhero-img { height: min(52vh, 440px); overflow: hidden; background: var(--surface-2); }
.rhero-img .ph { flex-direction: column; gap: 4px; }
.ph-big { font-size: 110px; font-weight: 800; line-height: 1; opacity: .3; }
.rhero-img .ph small { margin-top: 0; opacity: .7; }
.rhero-tools { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; }
.hero-right { display: flex; gap: 8px; }
.hero-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(20, 18, 16, .55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hero-btn:hover { background: rgba(20, 18, 16, .72); }
.hero-btn:disabled { opacity: .6; }
.rhero-card { position: relative; z-index: 1; margin: -64px 16px 0; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 18px 20px 20px; text-align: center; }
.rhero-card .kick { font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rhero-card h1 { font-size: clamp(26px, 6vw, 36px); color: var(--accent); margin: 6px 0; }
.rhero-card .by { color: var(--muted); font-size: 15px; }
.rhero-card .by b { color: var(--text); }
.rhero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 20px 4px 16px; text-align: center; align-items: end; }
.rhero-stats b { display: block; font-size: 20px; line-height: 1.2; }
.rhero-stats small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.rstat-p { color: hsl(var(--h) 60% var(--pc-ink-l)); }
.rstat-p small { color: inherit; }
.rstat-ic { width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: hsl(var(--h) 65% var(--pc-bg-l)); border: 2px solid currentColor; }
.rstat-ic .ic { width: 20px; height: 20px; }
.btn-block { display: flex; width: 100%; }
.cta { margin-bottom: 18px; }
@media (min-width: 760px) {
  .rhero { margin: 0; }
  .rhero-img { border-radius: 20px; height: 420px; }
  .rhero-card { max-width: 560px; margin: -90px auto 0; padding: 22px 28px 24px; }
  .rhero-stats, .cta { max-width: 560px; margin-left: auto; margin-right: auto; }
  .cta { display: flex; }
}

/* ===== Quiz de sala ===== */
.quiz-hero { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--accent-soft); border-color: transparent; margin-bottom: 14px; }
.qh-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.qh-ic .ic { width: 28px; height: 28px; }
.quiz-hero b { display: block; font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.quiz-hero span { color: var(--text); font-size: 14.5px; }
.quiz-play { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.quiz-play b { display: block; font-size: 18px; }
.quiz-play span { font-size: 14.5px; }
.rank { padding: 4px 16px; }
.rk-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rk-row:last-child { border-bottom: 0; }
.rk-row .avatar { width: 40px; height: 40px; }
.rk-pos { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.rk-pos.p1 { background: var(--warn-soft); color: var(--warn); }
.rk-name b { display: block; }
.rk-name small { color: var(--muted); font-size: 13.5px; }
.rk-pts { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.rk-pts small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.rk-row.me .rk-name b { color: var(--accent); }
.qopts { display: grid; gap: 10px; margin-top: 22px; }
.qopt { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); font-size: 17px; font-weight: 600; text-align: left; }
.qopt:hover:not(:disabled) { border-color: var(--accent); }
.qopt:disabled { cursor: default; }
.qopt .ic { width: 22px; height: 22px; }
.qopt { position: relative; overflow: visible; }
.qopt.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
/* Acierto: un brillo que cruza la respuesta y unas chispas pequeñas, una sola vez */
.qopt.win { animation: qpop .45s ease-out; overflow: hidden; }
.qopt.win::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--ok) 35%, transparent) 50%, transparent 65%); transform: translateX(-100%); animation: qshine .8s ease-out .05s forwards; pointer-events: none; }
.sparks { position: absolute; left: 26px; top: 50%; width: 0; height: 0; pointer-events: none; }
.sparks i { position: absolute; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: var(--ok); opacity: 0; transform: rotate(calc(var(--k) * 60deg)) translateY(0); animation: qspark .6s ease-out .05s forwards; }
@keyframes qpop { 40% { transform: scale(1.025); } 100% { transform: scale(1); } }
@keyframes qshine { to { transform: translateX(100%); } }
@keyframes qspark { 0% { opacity: 1; transform: rotate(calc(var(--k) * 60deg)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(calc(var(--k) * 60deg)) translateY(-18px) scale(.4); } }
.qopt.wrong { border-color: var(--danger); background: var(--accent-soft); color: var(--danger); }
/* Fallo: la respuesta elegida tiembla y la correcta se marca justo después */
.qopt.wrong { animation: qshake .5s cubic-bezier(.36, .07, .19, .97); }
.qopt.right:not(.win) { animation: qpop .45s ease-out .45s; }
.qfeed.ko { animation: qin .3s ease-out; }
@keyframes qshake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@keyframes qin { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .qopt.wrong, .qopt.right, .qopt.win, .qfeed.ko { animation: none; } }
.qopt.dim { opacity: .55; }
/* Reloj de la pregunta (quiz con puntos) */
.qtimer { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.qt-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.qt-bar i { display: block; height: 100%; width: 100%; background: var(--ok); border-radius: inherit; transform-origin: left; animation: qtime linear forwards; }
.qtimer b { min-width: 2ch; text-align: right; font-size: 18px; font-variant-numeric: tabular-nums; }
.qtimer.low .qt-bar i { background: var(--danger); }
.qtimer.low b { color: var(--danger); }
@keyframes qtime { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.quiz-foco { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.quiz-foco .lbl-sm { margin: 0; }
.qimg { display: block; width: 100%; max-height: 34vh; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; margin-top: 14px; background: #fff; }
.qfeed { margin: 16px 0 0; font-weight: 700; font-size: 16px; }
.qfeed.ok { color: var(--ok); }
.qfeed.ko { color: var(--danger); }
.cook-step.quiz-q { justify-content: flex-start; padding-top: 32px; }
.qb-op { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: center; }
.qb-op input[type="radio"] { width: 20px; height: 20px; accent-color: var(--ok); }
.cook-step.quiz-q p.big { font-size: clamp(22px, 3.6vw, 32px); }

/* ===== Administración ===== */
.cfg-row.person { grid-template-columns: 40px minmax(0, 1fr) auto; }
.cfg-row.person .avatar { width: 40px; height: 40px; }
.adm-link { grid-template-columns: 40px minmax(0, 1fr) auto; color: inherit; }
.adm-link:hover .bgo { background: var(--surface-2); color: var(--text); }
.adm-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); }
.login-dir { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius); background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; }
.login-dir:hover { border-color: var(--accent); color: var(--text); }

/* ===== Impresión ===== */
@media print {
  .topbar, .menu, .timers, .r-actions, .scaler .presets, .back { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; }
  .ing-list .box { display: none; } .ing-list li { grid-template-columns: 90px 1fr; }
}

/* ===== Tablón de anuncios ===== */
.anuncio { padding: 14px 16px; margin-bottom: 12px; }
.an-head { display: flex; align-items: center; gap: 10px; }
.an-head small { color: var(--muted); font-size: 13.5px; flex: 1; min-width: 0; }
.an-head .icon-btn { margin: -6px -6px -6px 0; }
.anuncio p { margin: 10px 0 0; font-size: 16.5px; white-space: pre-line; overflow-wrap: anywhere; }

/* ===== Enciclopedia ===== */
.en-item { padding: 13px 0; border-bottom: 1px solid var(--border); }
.en-item:last-child { border-bottom: 0; }
.en-item > b { display: block; font-size: 15.5px; }
.en-item > small { display: block; font-size: 13.5px; margin-top: 2px; }
.en-item p { margin: 8px 0 4px; font-size: 14.5px; }
.en-t { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.en-t small { color: var(--muted); font-size: 13.5px; }
.en-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.en-chips .chip { white-space: normal; }

/* ===== Racha (botón de arriba, ventana y pantalla al terminar) ===== */
.racha-btn { display: inline-flex; align-items: center; gap: 3px; height: 40px; padding: 0 6px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 800 16px Nunito, Inter, sans-serif; font-variant-numeric: tabular-nums; }
.racha-btn:hover { background: var(--surface-2); }
.racha-btn .fuego { width: 19px; height: 22px; }
.racha-btn.on { color: #FF9600; }
.fuego .f1 { fill: #FF9600; }
.fuego .f2 { fill: #FFC800; }
.racha-btn:not(.on) .fuego .f1, .racha.off .fuego .f1 { fill: var(--es-lock-ic); }
.racha-btn:not(.on) .fuego .f2, .racha.off .fuego .f2 { fill: var(--es-lock); }
.racha { text-align: center; padding: 6px 0 2px; font-family: Nunito, Inter, sans-serif; }
.fuego.grande { width: 92px; height: auto; display: block; margin: 0 auto; }
.racha-n { display: block; font-size: 80px; line-height: 1; font-weight: 900; color: #FF9600; margin-top: 8px; font-variant-numeric: tabular-nums; }
.racha-t { font-size: 22px; font-weight: 800; color: #FF9600; margin-bottom: 18px; }
.racha.off .racha-n, .racha.off .racha-t { color: var(--muted); }
.racha-sem { border: 2px solid var(--es-line); border-radius: 16px; max-width: 380px; margin: 0 auto 12px; }
.racha-dias { display: flex; justify-content: center; gap: 10px; padding: 14px 10px 12px; }
.racha-dias > div { display: grid; gap: 6px; justify-items: center; }
.racha-dias > div > span { font-weight: 800; font-size: 14px; color: var(--muted); }
.racha-dias .hoy > span { color: #FF9600; }
.racha-dias i { width: 38px; height: 38px; border-radius: 50%; background: var(--es-lock); display: grid; place-items: center; color: #fff; }
.racha-dias i.ok { background: #FF9600; }
.racha-dias i.com { background: #1CB0F6; }
.racha-dias i.ko { opacity: .55; }
.racha-dias i .ic { width: 22px; height: 22px; }
.racha-sem p { margin: 0; padding: 11px 12px; border-top: 2px solid var(--es-line); color: var(--muted); font-weight: 700; }
.racha-extra { margin: 0; color: var(--muted); font-weight: 700; font-size: 14px; }
.racha-mini { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; color: #FF9600; font: 800 18px Nunito, Inter, sans-serif; }
.racha-mini .fuego { width: 26px; height: auto; }

/* ===== Enciclopedia: camino de lecciones (botones gruesos y colores vivos) ===== */
:root, :root[data-app-theme="light"] {
  --es-line: #E5E5E5; --es-lock: #E5E5E5; --es-lock-sh: #B7B7B7; --es-lock-ic: #AFAFAF; --es-bub: #FFFFFF;
  --es-ok: #58CC02; --es-ok-sh: #58A700; --es-ok-bg: #D7FFB8; --es-ok-tx: #4B9A00;
  --es-ko: #FF4B4B; --es-ko-sh: #EA2B2B; --es-ko-bg: #FFDFE0; --es-ko-tx: #E02424;
  --es-sel: #1899D6; --es-sel-bg: #DDF4FF; --es-sel-bd: #84D8FF;
  --es-land: #E3DFD8; --es-land-2: #EEEBE6;
}
:root[data-app-theme="dark"] {
  --es-line: #3A3530; --es-lock: #37332E; --es-lock-sh: #24211E; --es-lock-ic: #6E675F; --es-bub: #1D1A17;
  --es-ok-bg: #1E3313; --es-ok-tx: #79D634;
  --es-ko-bg: #3B1E1F; --es-ko-tx: #FF7A7A;
  --es-sel: #49C0F8; --es-sel-bg: #13303D; --es-sel-bd: #3F85A7;
  --es-land: #4A443D; --es-land-2: #353029;
}
.es { --c: #CE82FF; --c-sh: #A568CC; font-family: Nunito, Inter, system-ui, sans-serif; }
.es[data-cat="comida"] { --c: #58CC02; --c-sh: #46A302; }
.es[data-cat="servicio"] { --c: #1CB0F6; --c-sh: #1899D6; }
.es h1, .es h2, .es h3, .es b { font-weight: 800; }
.es h1.es-marca { font-weight: 900; color: #58CC02; letter-spacing: -.01em; }
.es-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.es-cats button { min-height: 50px; padding: 0 6px; border: 2px solid transparent; border-radius: 14px; background: transparent; font: 800 15px Nunito, Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.es-cats button:hover { background: var(--surface-2); }
.es-cats button.on { background: var(--es-sel-bg); border-color: var(--es-sel-bd); color: var(--es-sel); }
.es-nivel { margin-bottom: 20px; }
.es-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 18px; border-radius: 16px; background: var(--c-sh); color: #fff; margin-bottom: 40px; }
.es-banner small { display: block; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.es-banner b { font-size: 20px; }
.es-guia { width: 46px; height: 46px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .45); background: transparent; color: #fff; display: grid; place-items: center; flex: none; }
.es-guia .ic { width: 22px; height: 22px; }
.es-nivel.lock .es-banner { background: var(--es-lock); color: var(--es-lock-ic); }
.es-nivel.lock .es-guia { border-color: transparent; color: var(--es-lock-ic); }
.es-path { display: flex; flex-direction: column; }
.es-row { position: relative; height: 100px; display: flex; justify-content: center; align-items: flex-start; }
.es-n { position: relative; transform: translateX(calc(var(--x) * 44px)); }
.es-node { width: 70px; height: 64px; border-radius: 50%; border: 0; padding: 0; background: var(--c); color: #fff; box-shadow: 0 7px 0 var(--c-sh); display: grid; place-items: center; transition: transform .1s, box-shadow .1s; }
.es-node svg { width: 32px; height: 32px; }
.es-node:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--c-sh); }
.es-node.lock { background: var(--es-lock); color: var(--es-lock-ic); box-shadow: 0 7px 0 var(--es-lock-sh); }
.es-node.lock:active { box-shadow: 0 3px 0 var(--es-lock-sh); }
.es-node.cur { outline: 7px solid color-mix(in srgb, var(--c) 28%, transparent); outline-offset: 4px; }
.es-node.hecho.prueba { background: #FFC800; box-shadow: 0 7px 0 #E0A800; }
.es-start { position: absolute; z-index: 2; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); padding: 7px 13px; border-radius: 12px; border: 2px solid var(--es-line); background: var(--es-bub); color: var(--c); font-weight: 800; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; pointer-events: none; animation: es-bote 1.4s ease-in-out infinite; }
.es-start::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--es-line); }
@keyframes es-bote { 50% { transform: translate(-50%, -5px); } }
.es-chest-btn { width: 80px; height: 70px; border: 0; padding: 0; background: none; display: grid; place-items: center; }
.es-chest { width: 74px; height: auto; display: block; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .14)); }
.es-chest .k1 { fill: #C47A2C; }
.es-chest .k2 { fill: #DE9440; }
.es-chest .k3 { fill: #8A5320; }
.es-chest .k4 { fill: #FFC800; }
.es-chest-btn.lock .k1, .es-chest-btn.lock .k2 { fill: var(--es-lock); }
.es-chest-btn.lock .k3 { fill: var(--es-lock-sh); }
.es-chest-btn.lock .k4 { fill: var(--es-lock-ic); }
.es-chest-btn.cur .es-chest, .es-chest-btn.abierto .es-chest { animation: es-cofre 1.6s ease-in-out infinite; }
@keyframes es-cofre { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-6deg); } 86% { transform: rotate(6deg); } }
.es-pop { position: absolute; z-index: 5; top: 82px; left: 50%; transform: translateX(-50%); width: min(300px, calc(100vw - 40px)); padding: 16px; border-radius: 16px; background: var(--c); color: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .2); display: grid; gap: 2px; }
.es-pop::before { content: ""; position: absolute; bottom: 100%; left: calc(50% + var(--x) * 44px); margin-left: -10px; border: 10px solid transparent; border-bottom-color: var(--c); }
.es-pop b { font-size: 18px; }
.es-pop span { font-size: 15px; font-weight: 700; opacity: .9; }
.es-pop .es-btn { margin-top: 12px; }
.es-pop.lock { background: var(--surface); color: var(--muted); border: 2px solid var(--es-line); }
.es-pop.lock::before { border-bottom-color: var(--es-line); }
.es-deco { position: absolute; top: -6px; width: 92px; pointer-events: none; }
.es-deco.izq { left: max(0px, calc(50% - 175px)); }
.es-deco.der { right: max(0px, calc(50% - 175px)); }
.es-deco svg { width: 100%; height: auto; display: block; }
.es-deco .persona { width: 72px; margin: 0 auto; }
.es-nivel.lock .es-deco { filter: grayscale(1); opacity: .4; }
.sombra { fill: rgba(0, 0, 0, .1); }
:root[data-app-theme="dark"] .sombra { fill: rgba(0, 0, 0, .35); }

/* Mapa de España */
.es-mapa { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto 16px; overflow: visible; }
.es-mapa .m-t { fill: var(--es-land); }
.es-mapa .m-pt { fill: var(--es-land-2); stroke: var(--bg); stroke-width: 1; }
.es-mapa .m-caja { fill: none; stroke: var(--es-line); stroke-width: 1.5; stroke-dasharray: 4 3; }
.es-mapa .m-vin { fill: var(--muted); }
.es-mapa .m-vint { font: 700 10px Nunito, Inter, sans-serif; fill: var(--muted); }
.m-p .dot { fill: var(--c); stroke: var(--bg); stroke-width: 2.5; transition: fill .15s; }
.m-p .hit { fill: transparent; }
.m-p text { font: 800 12px Nunito, Inter, sans-serif; fill: #fff; text-anchor: middle; pointer-events: none; }
.m-p[role="button"] { cursor: pointer; }
.m-p[role="button"]:focus-visible { outline: none; }
.m-p[role="button"]:focus-visible .dot { stroke: var(--text); }
.m-p.sel .dot { fill: var(--es-sel); stroke: var(--es-sel-bd); stroke-width: 4; }
.m-p.ok .dot { fill: var(--es-ok); }
.m-p.ko .dot { fill: var(--es-ko); }
.m-p.dim { opacity: .4; }
.m-p.preg .dot, .m-p.sol .dot { transform-box: fill-box; transform-origin: center; animation: es-latido 1.3s ease-in-out infinite; }
@keyframes es-latido { 50% { transform: scale(1.25); } }

/* Lección en pantalla completa */
.es-les { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.es-top { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 760px; margin: 0 auto; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.es-prog { flex: 1; height: 16px; border-radius: 99px; background: var(--es-lock); overflow: hidden; }
.es-prog i { position: relative; display: block; height: 100%; border-radius: 99px; background: var(--es-ok); transition: width .35s ease; }
.es-prog i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .3); }
.es-body { flex: 1; overflow: auto; width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; }
.es-h { font-size: 22px; margin: 6px 0 16px; }
.es-say { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; }
.es-say .es-pj-svg { width: 96px; height: auto; flex: none; }
.es-say .persona { width: 78px; }
.es-bub { position: relative; flex: 0 1 auto; min-width: 0; padding: 12px 14px; border: 2px solid var(--es-line); border-radius: 16px; background: var(--es-bub); font-size: 17px; font-weight: 600; line-height: 1.4; }
.es-bub::before, .es-bub::after { content: ""; position: absolute; top: 50%; border-style: solid; border-color: transparent; }
.es-bub::before { left: -14px; margin-top: -9px; border-width: 9px 14px 9px 0; border-right-color: var(--es-line); }
.es-bub::after { left: -10px; margin-top: -7px; border-width: 7px 11px 7px 0; border-right-color: var(--es-bub); }
.es-bub small { display: block; color: var(--c-sh); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.es-bub b { display: block; font-size: 20px; }
.es-bub span { display: block; color: var(--muted); font-size: 15px; }
.es-txt { margin: 0; font-size: 17px; line-height: 1.5; }
.es-img { display: block; width: 100%; max-width: 420px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; margin: 0 auto 16px; }
.es-ops { display: grid; gap: 10px; }
.es-op { min-height: 56px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--es-line); border-bottom-width: 4px; background: var(--surface); font: 700 16.5px/1.35 Nunito, Inter, sans-serif; text-align: left; color: var(--text); }
.es-op:hover:not(:disabled) { background: var(--surface-2); }
.es-op.sel { border-color: var(--es-sel-bd); background: var(--es-sel-bg); color: var(--es-sel); }
.es-op.ok { border-color: var(--es-ok); background: var(--es-ok-bg); color: var(--es-ok-tx); }
.es-op.ko { border-color: var(--es-ko); background: var(--es-ko-bg); color: var(--es-ko-tx); animation: qshake .5s cubic-bezier(.36, .07, .19, .97); }
.es-op.dim { opacity: .5; }
.es-op:disabled { cursor: default; }
.es-foot { padding: 14px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); border-top: 2px solid var(--es-line); }
.es-foot > * { max-width: 728px; margin-left: auto; margin-right: auto; }
.es-btn { display: block; width: 100%; min-height: 52px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--es-ok); color: #fff; box-shadow: 0 4px 0 var(--es-ok-sh); font: 800 16px Nunito, Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.es-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--es-ok-sh); }
.es-btn:disabled { background: var(--es-lock); color: var(--es-lock-ic); box-shadow: none; cursor: default; }
.es-btn.rojo { background: var(--es-ko); box-shadow: 0 4px 0 var(--es-ko-sh); }
.es-btn.naranja { background: #FF9600; box-shadow: 0 4px 0 #E08600; }
.es-btn.blanco { background: #fff; color: var(--c-sh); box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.es-fb { border-top-color: transparent; animation: qin .25s ease-out; }
.es-fb.ok { background: var(--es-ok-bg); color: var(--es-ok-tx); }
.es-fb.ko { background: var(--es-ko-bg); color: var(--es-ko-tx); }
.es-fb-t { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.es-fb-t b { font-size: 21px; }
.es-fb-i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--es-ok-tx); flex: none; }
.es-fb.ko .es-fb-i { background: var(--es-ko-tx); }
.es-fb-i .ic { width: 20px; height: 20px; }
.es-fb p { margin: 0 0 10px; font-weight: 700; }
.es-fb .es-fb-info { font-weight: 600; opacity: .92; margin-bottom: 14px; }
.es-fin .es-body { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.es-fin-pj .es-pj-svg { width: 150px; height: auto; }
.es-fin h2 { font-size: 28px; color: var(--c-sh); margin-top: 10px; }
.es-fin .es-body > p { margin: 8px 0 0; font-size: 17px; }
.es-stats { display: flex; gap: 12px; margin-top: 24px; }
.es-stats > div { min-width: 124px; border: 2px solid var(--c); border-radius: 14px; overflow: hidden; }
.es-stats small { display: block; padding: 4px 8px; background: var(--c); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.es-stats b { display: block; padding: 8px; font-size: 24px; color: var(--c-sh); }
.es-cofre-ok { text-align: center; padding: 8px 4px 2px; }
.es-cofre-ok .es-chest { width: 110px; margin: 0 auto 10px; }
.es-cofre-ok h2 { font-size: 24px; margin-bottom: 6px; }
.es-cofre-ok p { margin: 4px 0; }
.es-cofre-ok .es-btn { margin-top: 18px; }
.es-fichas .es-ficha { margin-bottom: 24px; }
.es-ficha h3 { font-size: 18px; margin-bottom: 10px; }
.es-ficha .es-mapa { margin-bottom: 10px; }
.es-lista { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
ul.es-lista { list-style: none; padding-left: 0; }
.es-lista b { font-weight: 800; }
.es-lista span { display: block; color: var(--muted); font-size: 14.5px; }
@media (prefers-reduced-motion: reduce) { .es-start, .es-chest, .m-p .dot, .es-op.ko, .es-fb { animation: none !important; } }

/* Sorteo del mes */
.sorteo { display: grid; gap: 8px; margin: 6px 0 16px; }
.sorteo-p { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--border); transition: background .08s, border-color .08s; }
.sorteo-p small { color: var(--muted); }
.sorteo-p.on { border-color: var(--accent); background: var(--accent-soft); }
.sorteo-p.win { border-color: var(--ok); background: var(--ok-soft); }
/* En el móvil caben los 5 días: horas en dos líneas, sin iconos (el color dice mediodía o noche) */
@media (max-width: 640px) {
  .htable { min-width: 0; font-size: 13px; }
  .htable th, .htable td { padding: 4px 1px; }
  .htable .pn { white-space: normal; padding-left: 8px; padding-right: 4px; width: 76px; max-width: 76px; font-size: 13px; line-height: 1.2; }
  .htable .pn-btn { padding: 4px 0; }
  .htable .pn-btn .ic { display: none; }
  .htable .sh { white-space: normal; text-align: center; font-size: 11px; line-height: 1.15; padding: 2px 3px; border-radius: 6px; }
  .htable .sh .ic { display: none; }
  .hcell { min-height: 44px; padding: 3px 1px; }
}
/* Recetas: dos por fila en el móvil */
@media (max-width: 560px) {
  .r-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .r-card .thumb { aspect-ratio: 1 / 1; }
  .r-card .ph span { display: none; }
  .r-card .ph small { display: none; }
  .r-card-body { padding: 8px 10px 10px; gap: 5px; }
  .r-card-body b { font-size: 14px; }
  .r-card .r-meta { font-size: 12px; gap: 4px; }
  .r-card .chip { font-size: 11px; padding: 2px 7px; }
}
@media (max-width: 640px) { .prod .ctl { flex-wrap: nowrap; } .prod .qty-in { width: 64px; } .prod .unit { min-width: 0; } .prod .ctl .mini { padding: 7px 9px; white-space: nowrap; } }
.prod .pn small { display: block; }
.prod .pn .pstock { color: var(--text); font-weight: 600; }

/* Stock de cocina */
.grp-head h2 { font-size: 18px; }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.st-row.ed { grid-template-columns: minmax(0, 1fr) auto auto; }
.st-row:last-of-type { border-bottom: 0; }
.st-row .pn b { display: block; font-size: 16px; }
.st-row .pn small { display: block; color: var(--muted); font-size: 13.5px; }
.st-row.low .pn small { color: var(--warn); font-weight: 600; }
.st-ctl { display: flex; align-items: center; gap: 6px; }
.st-b { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 22px; font-weight: 700; line-height: 1; display: grid; place-items: center; padding: 0; }
.st-b:active { background: var(--surface-2); }
.st-ctl .qty-in { width: 62px; padding: 0 6px; text-align: center; }
.st-row.low .qty-in, .st-row.low .st-n { color: var(--warn); }
.st-row.low .qty-in { border-color: var(--warn); background: var(--warn-soft); }
.st-n { font-size: 18px; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.prod .pn .preal { color: var(--text); font-weight: 600; }
.prod .pn .preal b { display: inline; font-size: inherit; }
.prod .pn .preal .low { color: var(--warn); }

/* ===== Control de horas ===== */
.hr-seg a { min-height: 42px; padding: 0 18px; border-radius: 11px; font-weight: 700; font-size: 15.5px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.hr-seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.hd-card { padding: 0 16px 4px; margin-bottom: 14px; }
.hd-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.hd-row:last-child, .hm-row:last-child { border-bottom: 0; }
.hd-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; padding: 12px 0; min-height: 60px; }
.hd-n { flex: 1; min-width: 0; }
.hd-n b { display: block; font-size: 16px; }
.hd-n small { display: block; color: var(--muted); font-size: 13.5px; }
.hd-row.done .hd-n small { color: var(--text); }
.hd-row.off .hd-n b { color: var(--muted); font-weight: 600; }
.hd-t { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hd-ok { width: 46px; height: 46px; border: 2px solid var(--ok); color: var(--ok); border-radius: 50%; }
.hd-ok:hover { background: var(--ok); color: #fff; }
.hm-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; min-height: 60px; }
button.hm-row { width: 100%; border-width: 0 0 1px; background: transparent; font: inherit; text-align: left; }
.hm-v { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-v b { font-size: 16.5px; }
.hm-row .bgo { width: 32px; height: 32px; }
.hr-sin { margin-bottom: 14px; }
.hr-sin .ic { color: var(--warn); }
.hp-sum { margin-bottom: 14px; }
.hp-big { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hp-big b { font-size: 30px; font-variant-numeric: tabular-nums; }
.hp-sum p { margin: 4px 0 0; font-size: 14.5px; }
.hp-ctr { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.hp-ctr label { font-weight: 600; }
.hp-ctr input { width: 76px; height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); padding: 0 10px; font: inherit; font-size: 16px; font-weight: 700; text-align: right; }
.hp-ctr .icon-btn { margin-left: auto; border-color: var(--border); }
.fj-head, .fj-row { display: grid; grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr) 42px; gap: 8px; align-items: center; }
.fj-head { font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.fj-row { margin-bottom: 8px; }
.fj-row input { width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); padding: 0 10px; font: inherit; font-size: 17px; font-weight: 700; }
.fj-row span { color: var(--muted); text-align: center; }
.fj-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.fj-foot b { font-variant-numeric: tabular-nums; }

/* WhatsApp: un botón por proveedor */
.t-warn { color: var(--warn); font-weight: 600; }
.btn.wa1.hecho { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }

/* Pasos de receta: cuadro más grande y foto de cada paso */
.step-row textarea.row-in { min-height: 112px; }
.step-row .paso-foto-ed { grid-column: 2 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-row .paso-foto-ed img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.step-row .paso-foto-ed label.mini { cursor: pointer; }
.paso-foto { display: block; width: 100%; max-width: 440px; margin-top: 10px; border-radius: 12px; border: 1px solid var(--border); }
.cook-step .paso-foto { max-height: 38vh; object-fit: contain; margin: 12px auto 4px; background: var(--surface-2); }
