:root {
  /* Idea de layout: cuestionario por pasos arriba, cifras clave siempre visibles en una tira, y la lista de la compra como un ticket de caja. */
  --bg: #eceff4;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --ink: #131722;
  --muted: #586074;
  --line: #d6dae4;
  --accent: #2440d8;
  --accent-ink: #ffffff;
  --accent-soft: #e3e8ff;
  --carb: #d99400;
  --fat: #0c9382;
  --good: #1a7f4e;
  --warn: #a8530a;
  --warn-soft: #fff1dd;
  --crit: #c2261d;
  --ticket: #fffdf5;
  --ticket-line: #cfc9b4;
  --shadow: 0 1px 2px rgba(19, 23, 34, .06), 0 8px 24px rgba(19, 23, 34, .06);
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1118; --surface: #171b26; --surface-2: #1f2433; --ink: #eceef5; --muted: #9ba3b9; --line: #2e3548;
    --accent: #8a9eff; --accent-ink: #0a0f2e; --accent-soft: #232c58;
    --carb: #f0b63a; --fat: #3fc9b5; --good: #4fcd90; --warn: #f0a650; --warn-soft: #3a2a14; --crit: #ff7f76;
    --ticket: #1b1f2c; --ticket-line: #3a4258;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1118; --surface: #171b26; --surface-2: #1f2433; --ink: #eceef5; --muted: #9ba3b9; --line: #2e3548;
  --accent: #8a9eff; --accent-ink: #0a0f2e; --accent-soft: #232c58;
  --carb: #f0b63a; --fat: #3fc9b5; --good: #4fcd90; --warn: #f0a650; --warn-soft: #3a2a14; --crit: #ff7f76;
  --ticket: #1b1f2c; --ticket-line: #3a4258;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; display: flex; flex-direction: column; gap: 18px; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.05; font-weight: 700; }
h2 { font-size: 24px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 650; }
h4 { font-size: 17px; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }

/* cabecera */
.top { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; justify-content: space-between; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.lede { color: var(--muted); max-width: 46ch; margin-top: 6px; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--ink); color: var(--bg); border-radius: 14px; overflow: hidden; flex: 1 1 520px; max-width: 640px; }
.strip div { padding: 10px 14px; border-left: 1px solid color-mix(in srgb, var(--bg) 18%, transparent); min-width: 0; }
.strip div:first-child { border-left: 0; }
.strip small { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip b { font-family: var(--display); font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strip i { font-style: normal; font-size: 12px; opacity: .75; margin-left: 3px; }
.demo { background: var(--accent-soft); border-radius: 10px; padding: 9px 14px; font-size: 14px; }

/* pasos */
.steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps button { flex: 1 0 auto; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 550; font-size: 14.5px; white-space: nowrap; }
.steps button .n { font-family: var(--mono); font-size: 12px; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.steps button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps button.on .n { background: color-mix(in srgb, var(--accent-ink) 22%, transparent); color: var(--accent-ink); }
.steps button.go { border-color: var(--ink); color: var(--ink); }

/* paneles de formulario */
.panel { display: none; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: clamp(18px, 3.5vw, 30px); flex-direction: column; gap: 22px; }
.panel.on { display: flex; }
.panel.bare { background: none; box-shadow: none; padding: 0; }
.panel > header p { color: var(--muted); margin-top: 4px; max-width: 65ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lab { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field small, .hint { font-size: 13px; color: var(--muted); }
.inp { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.inp:focus-within { border-color: var(--accent); }
.inp input { border: 0; background: none; padding: 10px 12px; width: 100%; min-width: 0; font-variant-numeric: tabular-nums; outline: none; }
.inp span { padding-right: 12px; color: var(--muted); font-size: 14px; white-space: nowrap; }
select { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 10px 10px; min-width: 0; width: 100%; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; align-self: flex-start; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: 14.5px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(19, 23, 34, .18); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.cards button { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 13px 14px; display: flex; flex-direction: column; gap: 3px; }
.cards button b { font-family: var(--display); font-size: 16.5px; font-weight: 650; }
.cards button span { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.cards button.on { border-color: var(--accent); background: var(--accent-soft); }
.block { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.tog { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px 7px 10px; font-size: 14.5px; font-weight: 550; color: var(--muted); }
.tog::before { content: ''; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--muted); flex: none; }
.tog.on { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.tog.on::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2.5px var(--accent-soft); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.stepper button { border: 0; background: none; width: 38px; height: 38px; font-size: 18px; }
.stepper button:hover { background: var(--accent-soft); }
.stepper output { min-width: 64px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; padding: 0 6px; }

.acts { display: flex; flex-direction: column; gap: 8px; }
.act { display: grid; grid-template-columns: minmax(150px, 2fr) repeat(2, minmax(96px, 1fr)) minmax(120px, 1.2fr) 38px; gap: 8px; align-items: center; }
.act .x { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; height: 40px; color: var(--muted); }
.act .x:hover { color: var(--crit); border-color: var(--crit); }
@media (max-width: 640px) { .act { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 12px; } .act select:first-child { grid-column: 1 / -1; } .act .x { grid-column: 1 / -1; } }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 15px; font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { padding: 6px 11px; font-size: 13.5px; }
.nav { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; }

.likes { display: flex; flex-direction: column; gap: 12px; }
.likes .g { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; align-items: start; }
.likes .g > span { font-size: 13.5px; font-weight: 600; padding-top: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--ink); }
.chip.like { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.like::before { content: '+ '; }
.chip.no { color: var(--muted); border-style: dashed; border-color: var(--crit); text-decoration: line-through; background: var(--surface-2); }
@media (max-width: 560px) { .likes .g { grid-template-columns: 1fr; } .likes .g > span { padding-top: 0; } }

/* resultados */
#plan { display: flex; flex-direction: column; gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.tile small { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tile b { font-family: var(--display); font-size: 32px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile b i { font-style: normal; font-size: 15px; font-weight: 550; color: var(--muted); margin-left: 4px; }
.tile span { font-size: 13.5px; color: var(--muted); }
.tile.key { background: var(--accent); color: var(--accent-ink); }
.tile.key small, .tile.key span, .tile.key b i { color: color-mix(in srgb, var(--accent-ink) 80%, transparent); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.bar i { display: block; min-width: 3px; }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.legend div { display: flex; align-items: baseline; gap: 8px; }
.legend div::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; transform: translateY(1px); }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.legend em { font-style: normal; color: var(--muted); font-size: 13px; }
.foot { font-size: 13px; color: var(--muted); }
.macro { display: grid; grid-template-columns: 86px 1fr auto; gap: 4px 12px; align-items: center; font-size: 14.5px; }
.macro .track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.macro .track i { display: block; height: 100%; background: var(--c); border-radius: 5px; }
.macro b { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; white-space: nowrap; }
.macro em { grid-column: 2 / -1; font-style: normal; font-size: 13px; color: var(--muted); margin-top: -2px; }
.notes { display: flex; flex-direction: column; gap: 8px; }
.note { border-radius: 12px; padding: 10px 14px; font-size: 14.5px; border-left: 4px solid var(--accent); background: var(--surface); box-shadow: var(--shadow); }
.note.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.note b { font-weight: 650; }
.adjust { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.adjust p { font-size: 13.5px; color: var(--muted); max-width: 60ch; flex: 1 1 220px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 12px; font-weight: 600; font-size: 14px; color: var(--muted); }
.pills button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dayhead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.dayhead .tot { font-size: 14.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dayhead .tot b { color: var(--ink); }
.meals { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 12px; }
.meal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.meal .mh { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.meal .mh span { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.meal .mh em { font-style: normal; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meal ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.meal li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.meal li:last-child { border-bottom: 0; }
.meal li b { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.meal .how { font-size: 13.5px; color: var(--muted); }
.meal .mf { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.mchips { display: flex; gap: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mchips i { font-style: normal; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border-bottom: 2px solid var(--c); }

/* ticket */
.ticketwrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .ticketwrap { grid-template-columns: 1fr; } }
.ticket { background: var(--ticket); color: var(--ink); font-family: var(--mono); font-size: 13.5px; padding: 22px 18px 30px; box-shadow: var(--shadow); border-radius: 4px 4px 0 0;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, radial-gradient(circle at 8px 0, #000 7.5px, transparent 8px) bottom left / 16px 10px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, radial-gradient(circle at 8px 0, #000 7.5px, transparent 8px) bottom left / 16px 10px repeat-x; }
.ticket .th { text-align: center; padding-bottom: 12px; border-bottom: 1px dashed var(--ticket-line); }
.ticket .th b { font-size: 17px; letter-spacing: .12em; display: block; }
.ticket .th span { color: var(--muted); font-size: 12.5px; }
.ticket h5 { margin: 14px 0 4px; font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.trow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 0; border-bottom: 1px dotted var(--ticket-line); align-items: start; }
.trow input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); }
.trow a { color: var(--ink); text-decoration-color: var(--ticket-line); text-underline-offset: 3px; font-weight: 600; }
.trow a:hover { color: var(--accent); }
.trow .pr { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trow .sub { grid-column: 2 / -1; color: var(--muted); font-size: 12.5px; }
.trow .sub u { text-decoration: none; color: var(--warn); }
.trow.done a, .trow.done .pr { text-decoration: line-through; color: var(--muted); }
.tsum { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--ticket-line); display: flex; flex-direction: column; gap: 4px; }
.tsum div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.tsum .big { font-size: 17px; font-weight: 600; padding-top: 6px; border-top: 1px solid var(--ink); margin-top: 4px; }
.side { display: flex; flex-direction: column; gap: 12px; }
.side .card p, .side .card li { font-size: 14.5px; }
.side ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.kv b { font-variant-numeric: tabular-nums; white-space: nowrap; }

.supp { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.supp .card p { font-size: 14.5px; color: var(--muted); }
.supp .card p b { color: var(--ink); }
.tag { align-self: flex-start; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); }
.tag.off { background: var(--surface-2); color: var(--muted); }

footer { font-size: 13px; color: var(--muted); max-width: 80ch; }
.modal { position: fixed; inset: 0; background: rgba(10, 12, 20, .55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal[hidden] { display: none; }
.modal .box { background: var(--surface); border-radius: 16px; padding: 18px; width: min(560px, 100%); display: flex; flex-direction: column; gap: 10px; }
.modal textarea { width: 100%; height: 300px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 10px; font: 13px var(--mono); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 11; }
.toast[hidden] { display: none; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toast .tundo { margin-left: 12px; min-height: 44px; padding: 0 6px; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; }
input, select { font-size: max(16px, 1em); }
.seg button, .tog, .chip, .btn { min-height: 44px; }
.seg.days button { min-width: 44px; }
.act .x { height: 44px; min-width: 44px; }
.stepper button { width: 44px; height: 44px; }
.act-err { grid-column: 1 / -1; }
.chips { gap: 8px; }
.seg button.on::before, .cards button.on b::before { content: '\2713\00a0'; }
.chip.like::before { content: '\2713\00a0'; }
.chip.no::before { content: '\2715\00a0'; }
.lkey { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.lkey .chip { min-height: 0; padding: 3px 10px; margin-right: 6px; font-size: 13px; }
.lkey .chip:not(.like):not(.no)::before { content: ''; }
@media (max-width: 620px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); flex-basis: 100%; }
  .strip div:nth-child(3) { border-left: 0; }
  .strip div:nth-child(n+3) { border-top: 1px solid color-mix(in srgb, var(--bg) 18%, transparent); }
}
@media (prefers-reduced-motion: no-preference) { .cards button, .chip, .steps button, .btn { transition: background-color .12s, border-color .12s, color .12s; } }

/* v2 */
.inp.bad { border-color: var(--crit); }
.err { color: var(--crit); font-size: 13px; font-weight: 550; }
.lnk { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.seg.days button { padding: 7px 11px; min-width: 38px; }
.btn.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.menubar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 10px 0 12px; }
details.how { font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
details.how summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details.how p { margin-top: 8px; }
details.how b { color: var(--ink); }
.prep ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0 28px; }
.prep li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.prep li b { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prep li em { font-style: normal; font-size: 12.5px; color: var(--muted); width: 58px; text-align: right; white-space: nowrap; }
.weekwrap { overflow-x: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
table.week { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 13.5px; }
table.week th, table.week td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 0; vertical-align: top; text-align: left; }
table.week th { padding: 10px; font-family: var(--display); font-weight: 650; font-size: 14px; white-space: nowrap; }
table.week th:first-child, table.week td:first-child { border-left: 0; }
table.week thead th em, table.week td em { display: block; font-style: normal; font-family: var(--body); font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
table.week tbody th { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
table.week td button { display: block; width: 100%; height: 100%; text-align: left; border: 0; background: none; padding: 10px; line-height: 1.3; }
table.week td button:hover { background: var(--accent-soft); }
table.week tr.sum td { padding: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
table.week tr:last-child th, table.week tr:last-child td { border-bottom: 0; }
.dayhead h3 .tag { vertical-align: middle; margin-left: 6px; }
.trow .pr { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 1px dashed var(--ticket-line); color: var(--ink); }
.trow .pr:hover { color: var(--accent); border-bottom-color: var(--accent); }
.trow .pr.edit { border: 0; cursor: default; display: inline-flex; align-items: center; gap: 4px; font-weight: 400; color: var(--muted); }
.trow .pr.edit input { width: 72px; font: inherit; padding: 3px 6px; border: 1px solid var(--accent); border-radius: 6px; background: var(--surface); color: var(--ink); text-align: right; }
.trow .lnk { font-family: var(--body); font-size: 12.5px; margin-left: 8px; white-space: nowrap; }
.trow.have a, .trow.have .pr { color: var(--muted); text-decoration: line-through; }
.trow.have .sub { opacity: .75; }
.cart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cart .wide { grid-column: 1 / -1; }
.cart ol, .cart ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.cart .safe { border-left: 4px solid var(--good); }
.bm { border-style: dashed; border-color: var(--accent); cursor: grab; margin-left: 4px; }
@media (max-width: 760px) { .cart { grid-template-columns: 1fr; } }

/* páginas legales (static/*.html) y enlaces legales del pie */
.wrap.legal { max-width: 760px; gap: 14px; }
.legal section { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; }
.legal h2 { font-size: 19px; }
.legal ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.legal .lede { max-width: 60ch; }
.legal code { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
.legal .ph { font-family: var(--mono); font-size: .88em; font-weight: 600; background: var(--warn-soft); color: var(--warn); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.legal .upd { font-size: 13px; color: var(--muted); }
.legal-links { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 8px; }
.legal-links a { padding: 5px 0; }
.legal-links a[aria-current] { color: var(--muted); text-decoration: none; }

/* ---------- impresión: solo la vista activa (menú del día, semana o lista), en blanco y negro ---------- */
@page { margin: 12mm; }
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --muted: #333; --line: #999;
    --accent: #000; --accent-ink: #fff; --accent-soft: #fff; --carb: #000; --fat: #000; --warn: #000; --crit: #000;
    --ticket: #fff; --ticket-line: #777; --shadow: none;
  }
  html, body { background: #fff !important; color: #000 !important; font-size: 11.5pt; }
  header.top, #demo, #steps, main > .panel:not(#p-plan), footer, .toast, .modal, .tiles, .notes, .cols, .tabs,
  .pills, .menubar, .side, .btn, .lnk, .dayhead .tag, .meal .mf, .foot, .trow.have { display: none !important; }
  main { padding: 0 !important; max-width: none !important; margin: 0 !important; }
  .panel#p-plan { display: block !important; padding: 0 !important; }
  .dayhead { margin: 0 0 8px !important; }
  .meals { display: block; }
  .meal { break-inside: avoid; box-shadow: none; border: 1px solid #000; border-radius: 6px; padding: 8px 12px; margin: 0 0 8px; gap: 4px; }
  .meal li, .prep li { border-bottom: 1px dotted #777; }
  .prep { break-inside: avoid; box-shadow: none; border: 1px solid #000; border-radius: 6px; margin-top: 10px; }
  .prep .foot { display: block !important; }
  .weekwrap { overflow: visible; box-shadow: none; border-radius: 0; }
  table.week { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8.5pt; }
  table.week th, table.week td { border: 1px solid #000; padding: 4px 5px; vertical-align: top; text-align: left; }
  table.week th:first-child { width: 10%; }
  table.week tr { break-inside: avoid; }
  table.week button { border: 0; background: none; padding: 0; font: inherit; color: #000; text-align: left; }
  table.week em { display: block; font-style: normal; color: #333; }
  .ticketwrap { display: block; }
  .ticket { box-shadow: none; background: #fff; -webkit-mask: none; mask: none; border: 0; padding: 0; font-size: 10.5pt; }
  .ticket h5 { break-after: avoid; margin-top: 12px; color: #000; border-bottom: 1px solid #000; }
  .trow { break-inside: avoid; }
  .trow input { -webkit-appearance: none; appearance: none; background: #fff !important; border: 1.5px solid #000; border-radius: 2px; width: 12px; height: 12px; }
  .trow.done a, .trow.done .pr { text-decoration: none; color: #000; }
  .trow a, a { color: #000; text-decoration: none; }
  a[href]::after { content: none !important; }
  .trow .pr { border: 0; background: none; padding: 0; font: inherit; color: #000; }
  .tsum { break-inside: avoid; }
}


.brandrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modal .box.help { max-height: min(88vh, 760px); overflow-y: auto; width: min(640px, 100%); gap: 8px; }
.helphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help details { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface-2); }
.help summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.help details[open] summary { margin-bottom: 4px; }
.help details > :not(summary) { margin-bottom: 10px; }
.help ul, .help ol { padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.help p { max-width: 62ch; }
.help a { color: var(--accent); text-underline-offset: 3px; }

/* primera visita, ejemplo y progreso */
.demo .btn { margin-left: 6px; }
.demo.ex { background: var(--warn-soft); border: 1.5px dashed var(--warn); position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.demo.ex[hidden] { display: none; }
.demo.ex span { flex: 1 1 260px; }
@media (max-width: 640px) { .demo.ex { font-size: 13.5px; padding: 8px 12px; } }
.demo.ex .btn { margin-left: 0; }
.strip .empty { grid-column: 1 / -1; padding: 12px 16px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.strip .empty span { font-size: 14.5px; }
.strip .empty button { border: 1px solid currentColor; background: none; color: inherit; border-radius: 8px; padding: 5px 11px; font-size: 13.5px; font-weight: 600; }
.strip .exrow { grid-column: 1 / -1; border-left: 0; border-top: 1px dashed color-mix(in srgb, var(--bg) 40%, transparent); padding: 4px 14px; font-size: 12px; font-weight: 600; letter-spacing: .03em; }
.steps button.done:not(.on) .n { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); font-size: 0; }
.steps button.done:not(.on) .n::after { content: '\2713'; font-size: 12px; }
.need { flex: 1 1 auto; align-self: center; font-size: 14px; font-weight: 550; color: var(--crit); }
.seg.bad { border-color: var(--crit); }
.acts > p.hint:only-child { display: none; }
#actsEmpty:empty { display: none; }
.quick { margin-top: 8px; gap: 8px; }
@media print { #intro, .strip .empty button { display: none; } .demo.ex { position: static; } }

/* seguimiento del peso */
.track { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.track > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.track .card p { font-size: 14.5px; max-width: 68ch; }
.track .card p.foot { font-size: 13px; }
.wk-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.wk-form .field { flex: 1 1 130px; }
.wk-fig { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wk-svg { display: block; width: 100%; height: auto; max-width: 720px; }
.wk-grid line { stroke: var(--line); stroke-width: 1; }
.wk-ax text { fill: var(--muted); font-family: var(--body); font-size: 11px; font-variant-numeric: tabular-nums; }
.wk-plan { fill: none; stroke: var(--carb); stroke-width: 2; stroke-dasharray: 6 5; stroke-linecap: round; }
.wk-avg { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wk-pts circle { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.wk-pts circle.hit { fill: transparent; stroke: none; }
.wk-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.wk-key li { display: inline-flex; align-items: center; gap: 6px; }
.wk-key li::before { content: ''; flex: none; width: 18px; height: 0; border-top: 2px solid var(--accent); }
.wk-key .k-plan::before { border-top: 2px dashed var(--carb); }
.wk-key .k-pt::before { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--ink); margin: 0 5px; }
.wk-empty { border: 1px dashed var(--line); border-radius: 12px; padding: 18px; color: var(--muted); background: var(--surface-2); }
.wk-data summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.wk-scroll { overflow-x: auto; margin-top: 8px; }
table.wk { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.wk th, table.wk td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.wk th:first-child, table.wk td:first-child { text-align: left; }
table.wk thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
table.wk tbody th { font-weight: 500; }
.wk-rates { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0; }
.wk-rates div { background: var(--surface-2); border-radius: 10px; padding: 9px 12px; }
.wk-rates dt { font-size: 12.5px; color: var(--muted); }
.wk-rates dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.wk-ask { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
@media (max-width: 860px) { .track { grid-template-columns: minmax(0, 1fr); } }
.wk-pts.dense circle { stroke-width: 1; }

/* ---------- resiliencia (agente 28): error de cálculo, avisos, navegadores antiguos, zoom 200 % y 320 px ---------- */
.fatal { background: var(--warn-soft); border: 1.5px solid var(--warn); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.fatal p { margin: 0; max-width: 65ch; }
body.dc-fatal #strip, body.dc-fatal #steps, body.dc-fatal #intro, body.dc-fatal .panel { display: none !important; }
.demo.notice { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: var(--warn-soft); }
.demo.notice span { flex: 1 1 240px; }
.demo.notice .btn { margin-left: 0; }
.compat-old { margin: 0; border-radius: 0; padding: 12px 16px; font-size: 16px; background: #fff1dd; color: #1b1b1b; border-bottom: 2px solid #c27a00; }
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .strip div { border-left: 1px solid rgba(128, 128, 128, .45); }
  .strip div:first-child { border-left: 0; }
  .steps button.on .n { background: rgba(255, 255, 255, .25); color: var(--accent-ink); }
  .tile.key small, .tile.key span, .tile.key b i { color: var(--accent-ink); }
  .strip .exrow { border-top: 1px dashed rgba(128, 128, 128, .5); }
  .steps button.done:not(.on) .n { background: var(--accent-soft); color: var(--good); }
  @media (max-width: 720px) { .strip div:nth-child(n+3) { border-top: 1px solid rgba(128, 128, 128, .45); } }
}
@media (max-width: 480px) {
  .strip { flex-basis: 100%; max-width: 100%; }
  .toast { max-width: calc(100vw - 24px); white-space: normal; text-align: center; border-radius: 16px; }
  .meals, .cols, .supp { grid-template-columns: minmax(0, 1fr); }
  .act { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .likes .g { grid-template-columns: minmax(0, 1fr); }
  .ticket, .trow, .meal li, .kv { overflow-wrap: anywhere; }
  .cart { grid-template-columns: minmax(0, 1fr); }
}

/* pulido v3 */
:root { --line-strong: #7d869b; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --carb: #b07100; --strip-sep: color-mix(in srgb, var(--bg) 18%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --line-strong: #6f7a95; --strip-bg: var(--surface-2); --strip-fg: var(--ink); --strip-sep: var(--line); --carb: #f0b63a; } }
:root[data-theme="dark"] { --line-strong: #6f7a95; --strip-bg: var(--surface-2); --strip-fg: var(--ink); --strip-sep: var(--line); --carb: #f0b63a; }
/* controles de formulario: borde con contraste de componente (>= 3:1) */
.inp, select, .seg { border-color: var(--line-strong); }
.inp:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.cards button, .chip, .btn { border-color: var(--line-strong); }
.cards button.on, .chip.like, .btn.primary { border-color: var(--accent); }
.chip.no { border-color: var(--crit); }
.btn:hover:not(:disabled) { border-color: var(--ink); background: var(--surface-2); }
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.1); border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.danger { border-color: var(--crit); }
:root[data-theme="dark"] .btn.danger, :root:not([data-theme="light"]) .btn.danger { color: var(--accent-ink); }
.lnk:hover { text-decoration-thickness: 2px; }
.btn:disabled, .steps button:disabled { opacity: 1; background: var(--surface-2); color: var(--muted); border-color: var(--line); border-style: dashed; cursor: not-allowed; }
/* cabecera y tira de cifras */
.strip { background: var(--strip-bg, var(--ink)); color: var(--strip-fg, var(--bg)); border-radius: var(--r-lg); box-shadow: var(--shadow); }
:root[data-theme="dark"] .strip { border: 1px solid var(--line); }
.strip div { border-left-color: var(--strip-sep); }
.strip small { opacity: .8; }
.strip .empty { gap: 8px; padding: 14px 16px; }
.strip .empty button { border-color: currentColor; min-height: 36px; padding: 6px 14px; }
.strip .empty button:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
/* franja de primera visita y de ejemplo */
.demo { border-radius: var(--r-md); padding: 12px 16px; line-height: 1.5; }
#intro .btn { margin: 4px 0 0 6px; vertical-align: middle; }
.demo.ex:not([hidden]) { flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.demo.ex .btn { margin-left: 0; flex: none; }
.demo.ex { background: var(--warn-soft); color: var(--ink); border: 1.5px dashed var(--warn); box-shadow: var(--shadow); }
.demo.ex span { flex: 1 1 260px; }
.demo.ex .btn.primary { margin-left: auto; }
/* pasos: legibles en todos los estados */
.steps { gap: 8px; padding: 2px 2px 4px; }
.steps button { min-height: 44px; border-color: var(--line-strong); }
.steps button:hover { border-color: var(--ink); color: var(--ink); }
.steps button.done:not(.on) { color: var(--ink); }
.steps button.done:not(.on) .n { background: color-mix(in srgb, var(--good) 20%, var(--surface)); color: var(--good); }
.steps button.on { font-weight: 650; }
.steps button.on .n { background: var(--accent-ink); color: var(--accent); font-weight: 650; }
.steps button.go:not(.on) { border-color: var(--ink); color: var(--ink); }
.steps button:focus-visible, .tabs button:focus-visible { outline-offset: 3px; border-radius: 999px; }
/* pestañas del plan */
.tabs { gap: 2px; }
.tabs button { min-height: 44px; }
.tabs button:hover { color: var(--ink); background: var(--surface-2); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tabs button.on { font-weight: 700; }
/* leyenda de gustos: compacta */
.lkey { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 13px; }
.lkey li { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lkey .chip { margin-right: 2px; min-height: 0; line-height: 1.4; }
.lkey li:last-child { white-space: normal; }
.chip { min-height: 44px; }
.lkey .chip { min-height: 0; }
.chip:hover { border-color: var(--ink); }
.chip.like:hover { filter: brightness(1.08); border-color: var(--accent); }
/* selector de día */
.pills button { min-height: 44px; min-width: 44px; border-color: var(--line-strong); }
.pills button:hover { border-color: var(--ink); color: var(--ink); }
.pills button.on { border-color: var(--ink); }
/* ticket y gráfico de seguimiento en oscuro */
:root[data-theme="dark"] .ticket { border: 1px solid var(--ticket-line); border-bottom: 0; }
.wk-grid line { stroke: color-mix(in srgb, var(--ink) 14%, transparent); }
.wk-fig { background: var(--surface); }
.wk-ax text { font-size: 11.5px; }
.wk-pts circle { fill: var(--ink); stroke: var(--surface); }
.wk-plan { stroke-width: 2.25; }
.wk-empty, .wk-ask { border-radius: var(--r-md); }
.wk-ask { border: 1px solid var(--warn); color: var(--ink); }
.modal .box { box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal textarea, table.wk th, table.wk td { border-color: var(--line); }
/* movil */
@media (max-width: 760px) {
  .steps, .tabs { padding-right: 28px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
  .tabs { margin-right: -2px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .demo { padding: 12px 14px; }
  .demo.ex { position: static; }
  .demo.ex .btn.primary { margin-left: 0; }
  .panel { border-radius: var(--r-lg); }
  .lkey { flex-direction: column; align-items: flex-start; }
  .lkey li { white-space: normal; flex-wrap: wrap; }
  .weekwrap, .wk-scroll { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .weekwrap { background-image: linear-gradient(90deg, var(--surface) 30%, transparent), linear-gradient(270deg, var(--surface) 30%, transparent), linear-gradient(90deg, rgba(0,0,0,.18), transparent), linear-gradient(270deg, rgba(0,0,0,.18), transparent); background-position: left, right, left, right; background-size: 32px 100%, 32px 100%, 12px 100%, 12px 100%; background-repeat: no-repeat; background-attachment: local, local, scroll, scroll; }
}
@media (pointer: coarse) {
  .trow { grid-template-columns: 28px minmax(0, 1fr) auto; padding: 10px 0; }
  .trow input { width: 22px; height: 22px; margin: 1px 0 0; }
  .trow a { padding: 2px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms; animation-iteration-count: 1; transition-duration: .01ms; scroll-behavior: auto; }
  .btn:active:not(:disabled) { transform: none; }
}
@media (forced-colors: active) { .steps button.on, .tabs button.on { outline: 2px solid Highlight; } .steps button.done:not(.on) .n::after { color: CanvasText; } }

/* ---------- CSP estricta (style-src 'self'): el marcado no lleva atributos style="" ---------- */
.c-ink { --c: var(--ink); } .c-acc { --c: var(--accent); } .c-carb { --c: var(--carb); } .c-fat { --c: var(--fat); }
.bar i { background: var(--c); }
.stepper button:disabled { opacity: .35; }

/* móvil v3 */
@media (max-width: 640px) {
  /* primera pantalla compacta */
  .wrap { padding-top: 12px; gap: 12px; }
  .top { gap: 10px; }
  .top .eyebrow, .top .lede { display: none; }
  .brandrow h1 { font-size: 26px; line-height: 1.15; }
  .strip .empty { padding: 10px 14px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .strip .empty button { min-height: 44px; }
  #intro.demo { padding: 10px 12px; font-size: 14.5px; line-height: 1.4; }
  #intro .btn { min-height: 44px; margin: 6px 0 0; }
  .panel { padding: 16px; }
  .panel > header p, .panel header > p { font-size: 14.5px; }
  /* navegación horizontal sin desbordar la página */
  .steps, .tabs { max-width: 100%; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
  .steps button, .tabs button { scroll-snap-align: center; }
  /* formularios: 48 px y 16 px */
  .inp, select, .field select, .act select, .act .x, .stepper { min-height: 48px; }
  .inp input { min-height: 46px; padding: 8px 12px; font-size: 16px; }
  select { padding: 10px; font-size: 16px; min-height: 48px; }
  .stepper button { width: 48px; height: 48px; }
  .act { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .act .x { height: 48px; min-width: 48px; }
  .chip { min-height: 48px; padding-inline: 14px; }
  .pills { gap: 6px; }
  .pills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pills button { min-height: 48px; padding-inline: 2px; font-size: 14px; }
  .wk-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
  .wk-form .btn { min-height: 48px; }
  .wk-fig, .wk-scroll { max-width: 100%; }
  .wk-svg { max-width: 100%; }
  /* menú: tabla semanal con primera columna fija */
  .weekwrap { max-width: 100%; overflow-x: auto; }
  table.week thead th:first-child, table.week tbody th { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: 1px 0 0 var(--line); min-width: 84px; }
  /* lista del súper */
  .trow { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 0; min-height: 56px; }
  .trow input { width: 26px; height: 26px; margin: 0; }
  .trow a { font-size: 15.5px; line-height: 1.3; }
  .trow .pr { font-size: 15.5px; align-self: start; }
  .trow.done { opacity: .5; }
  .trow .btn, .trow button { min-height: 44px; }
  /* botones Anterior/Siguiente al alcance del pulgar */
  .nav { position: sticky; bottom: 0; z-index: 4; background: var(--surface); margin: 0 -16px -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-strong); border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .nav .btn { flex: 1 1 0; min-height: 52px; font-size: 16px; }
  .nav .need { flex-basis: 100%; }
  .nav .need:empty { display: none; }
  /* diálogos casi a pantalla completa */
  .modal { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); place-items: stretch; }
  .modal .box { width: 100%; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .modal textarea { height: min(300px, 40vh); font-size: 16px; }
  .helphead { position: sticky; top: -18px; background: var(--surface); padding: 6px 0; z-index: 1; }
}
/* con teclado virtual (poca altura) nada fijo ni pegajoso que robe sitio */
@media (max-width: 640px) and (max-height: 520px) {
  .nav { position: static; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); border-radius: 0; }
  .demo.ex { position: static; }
  .helphead { position: static; }
}

.lab.lab-w { min-width: 7.5em; }
.foot.sp-week { margin: 10px 0 14px; } .foot.sp-menu { margin: 12px 0 14px; } .foot.sp-top { margin-top: 12px; }
.dayhead.sp-day { margin: 16px 0 10px; }

/* a11y */
.skip { position: absolute; left: 8px; top: -80px; z-index: 30; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }
.steps button { position: relative; }
.steps button.on, .steps button.on:hover { color: var(--accent-ink); border-color: var(--accent); }
.lnk, .trow a, .trow .pr, details > summary { min-height: 24px; }
.trow .pr.edit input { height: auto; min-height: 28px; margin: 0; }
.strip small { white-space: normal; overflow: visible; }
:root:has(#demo:not([hidden])) { scroll-padding-top: 110px; }
@media (max-width: 640px) { html { scroll-padding-bottom: 80px; } }
@media (forced-colors: active) {
  .tog.on::before, .pills button.on, .seg button.on { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .cards button.on, .chip.like, .tog.on { border-color: Highlight; }
  .skip, .toast, .modal .box { border: 1px solid CanvasText; }
}



/* hogar y extras */
#hogar { display: grid; gap: 12px; margin-bottom: 10px; }
#hogar:empty { display: none; }
.persona { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; background: var(--surface-2); }
.persona .p-head { display: grid; grid-template-columns: minmax(140px, 1fr) auto 44px; gap: 8px; align-items: end; }
.persona .p-head .x { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; height: 44px; min-width: 44px; color: var(--muted); font-size: 18px; }
.persona .p-head .x:hover { color: var(--crit); border-color: var(--crit); }
.persona .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.persona .hint { margin: 0; }
.persona .hint:empty { display: none; }
.persona select { width: 100%; }
.p-no > summary, .xother > summary, .xprev > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.p-no[open] > summary, .xother[open] > summary, .xprev[open] > summary { margin-bottom: 6px; }
.p-no .chips { margin: 10px 0; }
@media (max-width: 640px) { .persona .p-head { grid-template-columns: 1fr 44px; } .persona .p-head .seg { grid-column: 1 / -1; grid-row: 2; } }
.pills.quien { align-items: center; margin-top: 8px; }
.pills.quien .lab { margin-right: 4px; }
.xcard { display: grid; gap: 10px; }
.xcard > p, .xcard > h3 { margin: 0; }
.xbar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.xbar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; }
.xbar.over i { background: var(--warn, var(--crit)); }
.xread { font-size: 15.5px; }
.xp .chip em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
.xlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.xlist li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.xlist li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media print { .xcard { display: none !important; } }
.pills button.on:hover { color: var(--bg); }
@media (max-width: 640px) {
  .pills.quien { display: flex; flex-wrap: wrap; }
  .pills.quien .lab { flex: 0 0 100%; }
  .pills.quien button { padding-inline: 14px; }
  .persona .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .persona .grid .wide { grid-column: 1 / -1; }
}
/* platos distintos por persona */
.meal .dif { margin: 0 0 6px; font-size: 13px; color: var(--warn); font-weight: 600; }
.meal .platos { list-style: none; margin: 0 0 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; font-size: 13.5px; display: grid; gap: 4px; }
.meal .platos li { display: block; border: 0; padding: 0; }
#menuCasaRow { margin-top: 12px; }
.cart .row a.btn { text-decoration: none; display: inline-flex; align-items: center; }
/* cuenta */
#cuentaOpen[hidden] { display: none; }
.brandbtns { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.btn.warn { border-color: var(--warn); color: var(--warn); }
.modal .box.cuenta { width: min(480px, 100%); }
#cuentaBody { display: flex; flex-direction: column; gap: 12px; }
#cuentaBody > p { margin: 0; }
.aform { display: flex; flex-direction: column; gap: 12px; }
.aform .inp input { font-variant-numeric: normal; }
.aform .err[hidden] { display: none; }
.aform .err { margin: 0; }
.atabs { align-self: flex-start; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.chk input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.chk a { color: var(--accent); }
.acode { font: 600 19px/1.5 var(--mono); letter-spacing: .04em; background: var(--surface-2); border: 1px dashed var(--line-strong, var(--line)); border-radius: 12px; padding: 14px; text-align: center; overflow-wrap: anywhere; user-select: all; }
.amore { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface-2); }
.amore summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.amore .row { margin-bottom: 12px; }
@media print { #cuenta, #cuentaOpen { display: none !important; } }
