/* Mi Home Kitchen — estilos. Claro y cálido por defecto; oscuro automático según el teléfono (o forzado en Ajustes). */
:root {
  --bg: #FBF6EC;
  --surface: #FFFDF8;
  --surface-2: #F3ECDD;
  --line: #E6DCC8;
  --text: #2E2A24;
  --muted: #6F6657;
  --primary: #6B7F3A;
  --primary-ink: #FFFFFF;
  --primary-soft: #E7ECD6;
  --accent: #C2643C;
  --accent-soft: #F6E1D6;
  --warn: #9A6A06;
  --warn-soft: #FBEFCF;
  --bad: #B5402F;
  --bad-soft: #F7DCD6;
  --ok: #4F6B2A;
  --ok-soft: #E2EBD0;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 4px 14px rgba(60, 45, 20, .06);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C1A16; --surface: #26231E; --surface-2: #302C25; --line: #3D382F;
    --text: #F1EADC; --muted: #B3A893;
    --primary: #9DB062; --primary-ink: #1C1A16; --primary-soft: #343B24;
    --accent: #E08A62; --accent-soft: #432D22;
    --warn: #E5B64F; --warn-soft: #3D3320; --bad: #EE8471; --bad-soft: #452824; --ok: #A9C46F; --ok-soft: #2F3824;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C1A16; --surface: #26231E; --surface-2: #302C25; --line: #3D382F;
  --text: #F1EADC; --muted: #B3A893;
  --primary: #9DB062; --primary-ink: #1C1A16; --primary-soft: #343B24;
  --accent: #E08A62; --accent-soft: #432D22;
  --warn: #E5B64F; --warn-soft: #3D3320; --bad: #EE8471; --bad-soft: #452824; --ok: #A9C46F; --ok-soft: #2F3824;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
body.noscroll { overflow: hidden; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.hidden, [hidden] { display: none !important; }
.gap { height: 8px; }

/* ---------- barra superior y navegación ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand img { border-radius: 8px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--muted); }
.icon-btn svg, .nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.active { color: var(--primary); background: var(--primary-soft); }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--muted); text-decoration: none; padding: 4px 0; border-radius: 12px; }
.nav a.active { color: var(--primary); font-weight: 700; }
.nav a.active svg { stroke-width: 2.2; }
body.onboarding .nav, body.onboarding .topbar .icon-btn { display: none; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }

/* ---------- bloques ---------- */
.page-head { margin: 4px 0 14px; }
.page-head p { margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.panel > h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-link { font-size: .86rem; font-weight: 600; text-decoration: none; }
.notice { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; background: var(--primary-soft); }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .big { font-size: 2.4rem; display: block; margin-bottom: 6px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; text-decoration: none; color: var(--text); }
.stat b { display: block; font-size: 1.4rem; }
.stat span { font-size: .78rem; color: var(--muted); }
.stat.bad b { color: var(--bad); }
.stat.warn b { color: var(--warn); }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.quick button, .quick a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .84rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.quick .ico { font-size: 1.5rem; line-height: 1; }

/* ---------- botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 auto; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 10px 0 4px; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.qty { grid-template-columns: 1fr 1.3fr; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 8px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 7px 12px; font: inherit; font-size: .88rem; cursor: pointer; min-height: 36px;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.chip .n { opacity: .75; margin-left: 4px; font-size: .8rem; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button, .seg a { border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; text-align: center; text-decoration: none; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg .count { font-size: .76rem; opacity: .8; margin-left: 3px; }

.search { position: relative; margin-bottom: 10px; }
.search input { padding-left: 38px; }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); font-size: 1.2rem; color: var(--muted); }

/* ---------- lista de productos ---------- */
.group-title { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 16px 2px 8px; }
.items { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px;
}
.item-name { font-weight: 600; }
.item-qty { font-weight: 700; text-align: right; white-space: nowrap; }
.item-sub { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.item .bar { grid-column: 1 / -1; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 999px; }
.bar.bajo i { background: var(--warn); }
.bar.critico i, .bar.agotado i { background: var(--bad); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bajo, .badge.pronto { background: var(--warn-soft); color: var(--warn); }
.badge.critico, .badge.agotado, .badge.vencido { background: var(--bad-soft); color: var(--bad); }
.badge.vacio { background: var(--surface-2); color: var(--muted); }
.badge.est { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.t-vencido { color: var(--bad); font-weight: 600; }
.t-pronto { color: var(--warn); font-weight: 600; }

.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.alert-list li:first-child { border-top: 0; }
.alert-list a { color: var(--text); text-decoration: none; font-weight: 600; }

/* ---------- detalle de producto ---------- */
.p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.p-qty { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.p-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.p-meta div { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; }
.p-meta b { display: block; font-size: .95rem; }
.p-meta span { font-size: .76rem; color: var(--muted); }
.lot { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.lot:first-of-type { border-top: 0; }
.lot-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.moves { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.moves li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.moves li:first-child { border-top: 0; }
.plus { color: var(--ok); font-weight: 700; }
.minus { color: var(--bad); font-weight: 700; }
.quick-qty { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 8px 0 4px; }

/* ---------- bienvenida ---------- */
.ob-hero { text-align: center; padding: 18px 0 8px; }
.ob-hero img { width: min(260px, 70vw); height: auto; display: block; margin: 0 auto 8px; }
.home-logo { width: 72px; height: 72px; flex: none; }
.home-head { display: flex; align-items: center; gap: 12px; }
.home-head h1 { margin: 0; }
.about-logo { width: 140px; height: auto; display: block; margin: 0 auto 6px; }
.brand img { border-radius: 50%; }
.ob-steps { display: flex; gap: 6px; justify-content: center; margin: 4px 0 16px; }
.ob-steps i { width: 26px; height: 5px; border-radius: 999px; background: var(--line); }
.ob-steps i.on { background: var(--primary); }
.ob-foot { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 calc(8px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.ob-foot .btn { flex: 1; }
.pick-cat { margin-bottom: 14px; }
.pick-cat .chip { font-size: .85rem; }
.cuisine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cuisine {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.cuisine .flag { font-size: 1.6rem; }
.cuisine small { display: block; color: var(--muted); }
.cuisine.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.stepper { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.stepper output { text-align: center; font-weight: 700; }
.init-row { display: grid; grid-template-columns: 1fr 150px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.init-row:first-child { border-top: 0; }
.init-row small { display: block; color: var(--muted); }

/* ---------- próximamente ---------- */
.soon { text-align: center; padding: 30px 16px; }
.soon .big { font-size: 3rem; }
.soon ul { text-align: left; display: inline-block; margin: 10px auto 0; color: var(--muted); }

/* ---------- modal y aviso ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(30, 24, 14, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-card {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--bg);
  border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 30px rgba(0,0,0,.2);
}
@media (min-width: 640px) { .modal { align-items: center; } .modal-card { border-radius: 20px; } }
.modal-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.3rem; cursor: pointer; }
.modal-body h2 { padding-right: 40px; }
.modal-body .btn-row { margin-top: 16px; }

.toast {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translate(-50%, -12px); z-index: 80;
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 12px; display: flex; gap: 12px; align-items: center;
  max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-size: .92rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .link { color: var(--bg); text-decoration: underline; }

.suggest-list { list-style: none; padding: 0; margin: 6px 0 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.suggest-list li button { width: 100%; text-align: left; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.suggest-list li:first-child button { border-top: 0; }
.suggest-list small { color: var(--muted); }

/* ---------- congelador ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--muted); }
.dot.verde { background: #5E8A2E; }
.dot.amarillo { background: #D9A02B; }
.dot.rojo { background: var(--bad); }
.t-verde { color: var(--ok); }
.t-amarillo { color: var(--warn); font-weight: 600; }
.t-rojo { color: var(--bad); font-weight: 600; }
button.item { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.bar.fz-verde i { background: #5E8A2E; }
.bar.fz-amarillo i { background: #D9A02B; }
.bar.fz-rojo i { background: var(--bad); }
.fz-chips { margin: 12px 0 10px; }
.sub-h { font-size: 1rem; margin: 18px 2px 10px; color: var(--muted); }
.panel .btn-row + .items, .panel .chips + .items { margin-top: 4px; }
.alert-list li.wrap { flex-wrap: wrap; }
.alert-list .li-actions { flex-basis: 100%; display: flex; gap: 6px; justify-content: flex-end; }
.alert-list .link { text-align: left; color: var(--text); }
details.panel summary, .panel details summary { cursor: pointer; padding: 4px 0; font-weight: 600; }
.panel details { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.ft-lbl { margin: 0; font-weight: 500; font-size: .9rem; }
.init-row input { text-align: center; }

/* ---------- recetas ---------- */
.scroll-x { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x .chip { flex: none; }
.rc-filters { margin-bottom: 8px; }
.rc-filters + .items, .rc-filters + .empty { margin-top: 12px; }
.rcard .item-name { font-size: 1rem; }
.star { color: #D9A02B; }
.icon-star { border: 0; background: none; font-size: 1.6rem; color: var(--line); cursor: pointer; line-height: 1; padding: 4px; }
.icon-star.on { color: #D9A02B; }
.rc-status { margin: 12px 0 4px; }
.more { margin-top: 12px; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ing:first-child { border-top: 0; }
.ing > span:nth-child(2) { flex: 1; }
.ing-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok); }
.ing.falta .ing-dot { background: var(--bad); }
.ing.poco .ing-dot { background: #D9A02B; }
.ing.opt .ing-dot { background: var(--line); }
.steps { padding-left: 22px; margin: 0; }
.steps li { margin: 0 0 10px; padding-left: 4px; }
.steps li::marker { color: var(--accent); font-weight: 700; }
.cook-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.cook-row { display: grid; grid-template-columns: 1fr 130px; gap: 2px 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.cook-row .check { margin: 0; }
.cook-row small { grid-column: 1 / -1; }
.cook-q { display: flex; align-items: center; gap: 6px; }
.cook-q input { min-height: 38px; padding: 6px 8px; text-align: right; }
.cook-q span { font-size: .85rem; color: var(--muted); width: 30px; }
.ing-row { display: grid; grid-template-columns: 1fr 64px 82px auto 32px; gap: 6px; align-items: center; margin-bottom: 8px; }
.ing-row select, .ing-row input { min-height: 40px; padding: 6px 8px; font-size: .9rem; }
.ri-opt { margin: 0; font-size: .75rem; font-weight: 500; display: flex; align-items: center; gap: 3px; }
@media (max-width: 420px) { .ing-row { grid-template-columns: 1fr 58px 74px 32px; } .ri-opt { grid-column: 1 / 2; } }
textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--surface); }
.chip-check input { accent-color: var(--primary); }

/* ---------- IA ---------- */
.ai-btn { margin-top: 10px; }
.ai-why { grid-column: 1 / -1; font-size: .82rem; color: var(--accent); font-weight: 600; }
.ai-cost { margin-top: 12px; }
.ai-plan { list-style: none; padding: 0; margin: 8px 0; }
.ai-plan li { border-top: 1px solid var(--line); }
.ai-plan li:first-child { border-top: 0; }
.ai-plan .check { align-items: flex-start; }
.ai-meter { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 12px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.ai-meter b { display: block; font-size: 1.05rem; }
.ai-meter span { font-size: .8rem; color: var(--muted); }

/* ---------- sugerencias y avisos ---------- */
.min-sugg { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.panel > .min-sugg:first-child, .panel h2 + .min-sugg { border-top: 0; }
.min-sugg .btn-row { justify-content: flex-end; }
.min-sugg .btn-row > .btn { flex: 0 0 auto; }
.push-state { display: flex; align-items: flex-end; padding-bottom: 10px; }

/* ---------- hogar compartido ---------- */
.topbar .brand { flex: 1; }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; text-decoration: none; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface-2); margin-right: 6px; }
.sync-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-pill.ok i { background: #5E8A2E; }
.sync-pill.syncing i { background: #D9A02B; animation: pulse 1s infinite alternate; }
.sync-pill.offline i { background: var(--muted); }
.sync-pill.error { color: var(--bad); }
.sync-pill.error i { background: var(--bad); }
@keyframes pulse { to { opacity: .3; } }
.qr-wrap { background: #fff; border-radius: 16px; padding: 10px; width: min(250px, 70vw); margin: 10px auto; }
.qr { display: block; width: 100%; height: auto; }
.code-blocks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font: 700 1.05rem/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; }
.code-blocks span { background: var(--surface-2); padding: 8px 9px; border-radius: 8px; }
code { font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- stickers y banderas ---------- */
.sticker { display: block; width: min(210px, 58vw); height: auto; margin: 2px auto 10px; user-select: none; -webkit-user-drag: none; }
.sticker.sm { width: min(170px, 48vw); }
.sticker.xs { width: 92px; margin: 0; flex: none; }
.ob-sticker { width: min(190px, 52vw); }
.rc-sticker { width: min(200px, 55vw); margin-top: -4px; }
.empty .sticker { margin-bottom: 8px; }
.empty-inline { display: flex; align-items: center; gap: 12px; }
.empty-inline p { margin: 0; }
.menu-head { display: flex; align-items: center; justify-content: space-between; }
.done-modal { text-align: center; }
.done-modal .sticker { width: min(230px, 62vw); }
.flag { width: 18px; height: 12px; border-radius: 2px; overflow: hidden; flex: none; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25); vertical-align: -1px; }
.origin { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 5px; border-radius: 999px; background: var(--surface-2); font-size: .74rem; font-weight: 600; color: var(--text); }
.rc-origin { margin: 0 0 4px; }

/* ---------- menú ---------- */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.week-nav b { text-align: center; flex: 1; }
.btn-row + .panel, .btn-row + .notice { margin-top: 12px; }
.day.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.day.past { opacity: .7; }
.day h2 { font-size: 1rem; }
.meal-row { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.meal-row:first-of-type { border-top: 0; }
.meal-name { font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.meal-row .link { justify-self: start; }
.plan-entry { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 8px 10px; font: inherit; color: var(--text); cursor: pointer; }
.plan-entry > span:first-child { font-weight: 600; }
.plan-entry.done > span:first-child { text-decoration: line-through; color: var(--muted); }

/* ---------- compras ---------- */
.shop-item { display: grid; grid-template-columns: 44px 1fr 36px; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 8px; }
.shop-item .tick { width: 32px; height: 32px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.shop-item .tick::after { content: ""; width: 12px; height: 7px; border-left: 3px solid transparent; border-bottom: 3px solid transparent; transform: rotate(-45deg) translate(1px, -2px); }
.shop-item.done .tick { background: var(--primary); border-color: var(--primary); }
.shop-item.done .tick::after { border-color: var(--primary-ink); }
.shop-item.done .item-name { text-decoration: line-through; color: var(--muted); }
.shop-main { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 0; padding: 6px 0; text-align: left; font: inherit; color: var(--text); cursor: pointer; min-width: 0; }
.shop-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.sticky-foot { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); padding: 14px 0 4px; background: linear-gradient(transparent, var(--bg) 35%); z-index: 5; }
.suggest-list button:disabled { color: var(--muted); cursor: default; }
.buy h2 { margin-bottom: 0; }

/* ---------- escáner ---------- */
.scanner { position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow: auto; padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.scanner .modal-x { position: static; }
.scan-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.scan-top h2 { margin: 0; }
.scan-box { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-width: 560px; margin: 0 auto; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-guide { position: absolute; left: 12%; right: 12%; top: 34%; bottom: 34%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
.scan-msg { color: var(--muted); text-align: center; margin: 10px 0; }
.scan-tools { display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin: 0 auto; }
.scan-tools .zoom { display: flex; align-items: center; gap: 10px; margin: 0; }
.scan-tools .zoom input { flex: 1; accent-color: var(--primary); }
.scan-manual { max-width: 560px; margin: 14px auto 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
