/* Menú familiar · estilo app de comida a domicilio: blanco, negro, fotos grandes y un verde de acento */
:root {
  --bg: #FFFFFF;
  --surface: #F3F3F3;
  --surface-2: #E6E6E6;
  --ink: #000000;
  --ink-2: #333333;
  --muted: #5E5E5E;
  --line: #EEEEEE;
  --green: #06C167;
  --green-ink: #047A41;
  --green-soft: #E6F8EF;
  --we: #EEF8F2;
  --orange: #A63F00;
  --orange-soft: #FFF0E6;
  --primary: #000000;
  --on-primary: #FFFFFF;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --r: 16px;
  --tabbar-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0B; --surface: #1C1C1C; --surface-2: #2A2A2A; --ink: #FFFFFF; --ink-2: #E2E2E2; --muted: #A6A6A6;
    --line: #262626; --green: #1ED67A; --green-ink: #4BE296; --green-soft: #10291C; --we: #0F2017;
    --orange: #FF9A57; --orange-soft: #2E1A0E;
    --primary: #FFFFFF; --on-primary: #000000; --shadow: 0 2px 14px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 16px/1.4 var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }

main { max-width: 820px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 0 32px; }
.pad { padding-left: 16px; padding-right: 16px; }

/* ---------- Cabecera ---------- */
.hero-head { padding: 6px 16px 10px; }
.eyebrow { font-size: .9rem; color: var(--muted); font-weight: 600; }
.hero-head h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin-top: 2px; }
.pill-nav { display: flex; align-items: center; gap: 8px; margin: 4px 16px 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 0; border-radius: 999px;
  padding: 9px 14px; font-weight: 700; font-size: .92rem; min-height: 40px; white-space: nowrap; text-decoration: none;
}
.pill.grow { flex: 1; justify-content: center; }
.pill svg { width: 18px; height: 18px; stroke-width: 2.2; }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--surface);
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 700;
}
.icon-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }
.icon-btn:active, .pill:active { background: var(--surface-2); }

/* ---------- Selector de días ---------- */
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 18px; scrollbar-width: none; }
.strip::-webkit-scrollbar, .carousel::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.dchip {
  flex: 1 0 46px; max-width: 70px; border: 0; background: var(--surface); border-radius: 14px; padding: 8px 0;
  display: flex; flex-direction: column; align-items: center; gap: 1px; position: relative;
}
.dchip .dw { font-size: .72rem; font-weight: 700; color: var(--muted); }
.dchip .dn { font-size: 1.15rem; font-weight: 800; }
.dchip.weekend { background: var(--we); }
.dchip.sel { background: var(--primary); color: var(--on-primary); }
.dchip.sel .dw { color: inherit; opacity: .75; }
.dchip.today:not(.sel)::after { content: ""; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

/* ---------- Títulos ---------- */
.sec-h { font-size: 1.32rem; font-weight: 800; margin: 26px 0 10px; }
.meal > .sec-h, .sec-row, h2.sec-h.pad { padding: 0 16px; }
.sec-row { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 10px; }
.sec-row .sec-h { margin: 0; flex: 1; padding: 0; }
.sub-h { font-size: 1.05rem; font-weight: 800; margin: 20px 16px 10px; }
.link { border: 0; background: none; padding: 4px 0; font-weight: 700; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.link.muted { color: var(--muted); }

/* ---------- Fotos ---------- */
.ph {
  position: relative; overflow: hidden; display: grid; place-items: center; flex: none;
  background: var(--tile, #E7E0D6); color: color-mix(in srgb, var(--ink) 45%, var(--tile, #E7E0D6));
}
.ph .ph-ico svg { width: 30px; height: 30px; stroke-width: 1.6; opacity: .7; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.ph.loaded img { opacity: 1; }
.ph.loaded .ph-ico { visibility: hidden; }
.ph-retry {
  position: absolute; z-index: 2; right: 10px; top: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.45); color: #fff; display: none; place-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ph.loaded .ph-retry { display: grid; }
.ph-retry svg { width: 16px; height: 16px; stroke-width: 2.4; }
.ph-hero .ph-retry { top: auto; bottom: 12px; }
.g-pescado { --tile: #D5DEE3; } .g-carne { --tile: #E8D6CC; } .g-huevo { --tile: #EDE5C6; } .g-legumbre { --tile: #E2D6C3; }
.g-pasta { --tile: #EEE0C6; } .g-arroz { --tile: #EDE3CF; } .g-verdura { --tile: #D8E6D2; } .g-patata { --tile: #ECE1C8; }
.g-lacteo { --tile: #E4E6EC; } .g-fruta { --tile: #F0D9D9; } .g-otro { --tile: #E7E2DC; }
@media (prefers-color-scheme: dark) { .ph { background: color-mix(in srgb, var(--tile, #E7E0D6) 18%, #1C1C1C); } }
.ph-hero { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r); }
.ph-school { width: 100%; height: 170px; }
.ph-card { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; }
.ph-sq { width: 76px; height: 76px; border-radius: 12px; }
.ph-sq .ph-ico svg, .ph-xs .ph-ico svg, .ph-strip .ph-ico svg { width: 18px; height: 18px; }
.ph-xs { width: 48px; height: 48px; border-radius: 10px; }
.ph-strip { width: 100%; height: 100%; }
.ph-strip .ph-ico { display: none; }

.badge {
  position: absolute; top: 12px; left: 12px; z-index: 1; background: var(--bg); color: var(--ink); font-size: .74rem; font-weight: 800;
  padding: 5px 10px; border-radius: 999px; box-shadow: var(--shadow); display: inline-flex; gap: 4px; align-items: center;
}
.badge svg { width: 12px; height: 12px; stroke-width: 3.2; }
.badge.green { background: var(--green-ink); color: #fff; }
.badge.right { left: auto; right: 12px; }

/* ---------- Menú del cole ---------- */
.school-card { background: var(--green-soft); border-radius: var(--r); overflow: hidden; }
.school-card.empty .sc-body { padding: 14px; font-weight: 600; }
.sc-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.course { display: flex; gap: 10px; align-items: flex-start; }
.c-label { flex: none; width: 54px; font-size: .74rem; font-weight: 800; color: var(--green-ink); text-transform: uppercase; letter-spacing: .04em; padding-top: 3px; }
.c-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.c-dish { font-weight: 700; line-height: 1.3; }
.course.dessert .c-dish { font-weight: 600; color: var(--ink-2); }
.c-all { font-size: .78rem; font-weight: 600; color: var(--muted); }
.school-card.compact .sc-body { padding: 12px; }
.sc-row { display: flex; gap: 12px; align-items: flex-start; }
.sc-list { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.school-card.compact .c-label { width: 46px; }
.pill-note { align-self: flex-start; display: inline-block; background: var(--orange-soft); color: var(--orange); font-weight: 800; font-size: .8rem; padding: 4px 10px; border-radius: 999px; }
.tip {
  margin: 10px 16px 0; display: flex; gap: 10px; align-items: center; background: var(--surface); border-radius: 12px; padding: 11px 13px;
  font-size: .9rem; color: var(--ink-2);
}
.tip svg { width: 20px; height: 20px; color: var(--green-ink); flex: none; }
.tip b { color: var(--ink); }

/* ---------- Plato elegido ---------- */
.hero { position: relative; margin: 0 16px; }
.hero-txt { margin-top: 10px; }
.dish-title { font-size: 1.25rem; font-weight: 800; line-height: 1.25; }
.meta { color: var(--muted); font-size: .86rem; font-weight: 600; }
.hero.out .ph { opacity: .7; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 16px 2px; }
.chip {
  flex: none; border: 0; background: var(--surface); border-radius: 999px; padding: 0 14px; height: 38px; font-weight: 700; font-size: .88rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip svg { width: 16px; height: 16px; stroke-width: 2.2; }
.chip:active { background: var(--surface-2); }
.ings { list-style: none; margin: 10px 16px 0; padding: 4px 14px; background: var(--surface); border-radius: 12px; }
.ings li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: .92rem; }
.ings li + li { border-top: 1px solid var(--line); }
.ings b { color: var(--muted); font-weight: 700; white-space: nowrap; }

/* ---------- Carrusel de ideas ---------- */
.carousel { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 6px; scroll-padding-inline: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ocard { flex: none; width: 66%; max-width: 250px; scroll-snap-align: start; border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.oc-photo { position: relative; }
.oc-name { font-weight: 700; font-size: .95rem; margin-top: 8px; line-height: 1.25; }
.plus {
  position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: var(--bg); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.plus svg { width: 18px; height: 18px; stroke-width: 2.6; }
.ocard:active .ph { transform: scale(.98); }

/* Alternativas compactas (ventana del día) */
.alts { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.alt { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 6px; text-align: left; font-weight: 700; font-size: .9rem; }

/* ---------- Fin de semana ---------- */
.balance-card { margin: 0 16px; padding: 14px; border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.balance-card > b { font-size: 1rem; }
.bchips { display: flex; flex-wrap: wrap; gap: 6px; }
.bchip { padding: 5px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--bg); }
.bchip.low { background: var(--orange-soft); color: var(--orange); }

/* ---------- Calendario del mes ---------- */
.cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 0 10px; }
.dow { text-align: center; font-size: .72rem; font-weight: 800; color: var(--muted); padding-bottom: 4px; }
.dow b { display: none; font-weight: 800; }
.cell {
  border: 0; border-radius: 10px; background: var(--surface); padding: 6px 4px; min-height: 66px; text-align: left;
  display: flex; flex-direction: column; gap: 4px; align-items: stretch; min-width: 0; overflow: hidden;
}
.cell.blank { background: transparent; }
.cell.we { background: var(--we); }
.cell.hol { background: var(--orange-soft); }
.cell.today { box-shadow: inset 0 0 0 2px var(--primary); }
.cn { font-weight: 800; font-size: .95rem; line-height: 1; display: flex; flex-direction: column; gap: 2px; }
.cn em { font-style: normal; font-size: .55rem; font-weight: 800; color: var(--orange); letter-spacing: .02em; text-transform: uppercase; }
.mini { display: flex; flex-direction: column; gap: 3px; }
.strip-ph { display: block; height: 15px; border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 2px #1F1F1F; position: relative; }
.strip-ph.cole { box-shadow: inset 0 0 0 2px var(--green-ink); }
.strip-ph.cena { box-shadow: inset 0 0 0 2px var(--ink); }
.strip-ph .ph { position: absolute; inset: 0; }
.strip-ph::after { content: ""; position: absolute; inset: 0; border-radius: 4px; box-shadow: inset 0 0 0 2px inherit; pointer-events: none; }
.full { display: none; }
.legend { display: flex; gap: 16px; margin-top: 14px; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 16px; height: 9px; border-radius: 3px; background: #DCD3C6; }
.lg.cole { box-shadow: inset 0 0 0 2px var(--green-ink); }
.lg.cena { background: #CBD2D6; box-shadow: inset 0 0 0 2px var(--ink); }

@media (min-width: 720px) {
  main { max-width: 1240px; }
  .cal { gap: 8px; padding: 0 16px; }
  .dow { text-align: left; padding-left: 4px; }
  .dow b { display: inline; }
  .dow span { display: none; }
  .cell { padding: 10px; min-height: 150px; border-radius: 14px; gap: 8px; }
  .cn { flex-direction: row; align-items: center; gap: 8px; font-size: 1.15rem; }
  .cn em { font-size: .66rem; background: var(--bg); padding: 2px 7px; border-radius: 999px; }
  .mini { display: none; }
  .full { display: flex; flex-direction: column; gap: 8px; }
  .fb { display: flex; flex-direction: column; gap: 2px; padding-top: 7px; border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); }
  .fl { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .fl.cole { color: var(--green-ink); }
  .fm { font-size: .82rem; font-weight: 700; line-height: 1.3; }
  .fs { font-size: .78rem; font-weight: 500; line-height: 1.3; color: var(--ink-2); }
  .fd { font-size: .72rem; font-weight: 500; color: var(--muted); }
  .legend { display: none; }
}


/* ---------- Carrusel del menú del cole ---------- */
.sc-carousel { position: relative; }
.sc-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.sc-slides::-webkit-scrollbar { display: none; }
.sc-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; }
.sc-cap {
  position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); background: rgba(0,0,0,.62); color: #fff;
  padding: 5px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sc-cap b { font-weight: 800; margin-right: 2px; }
.sc-dots { position: absolute; right: 10px; bottom: 14px; display: flex; gap: 5px; }
.sc-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.6); box-shadow: 0 0 0 1px rgba(0,0,0,.15); transition: width .2s; }
.sc-dot.on { width: 20px; background: #fff; }

/* ---------- Mes en el móvil: lista por semanas ---------- */
.mweek-h { font-size: 1.05rem; font-weight: 800; margin: 18px 16px 8px; }
.mweek-box { margin: 0 16px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mrow { width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 0; background: var(--bg); padding: 13px 12px 13px 8px; }
.mrow + .mrow { border-top: 1px solid var(--line); }
.mrow.we { background: var(--we); }
.mrow.today { box-shadow: inset 3px 0 0 var(--primary); }
.mdate { width: 42px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.mdate small { font-size: .7rem; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.mdate b { font-size: 1.35rem; font-weight: 800; }
.mbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mb { display: flex; flex-direction: column; gap: 2px; }
.ml { font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.ml.cole { color: var(--green-ink); }
.mm { font-size: .95rem; font-weight: 700; line-height: 1.3; }
.ms { font-size: .9rem; font-weight: 500; line-height: 1.3; color: var(--ink-2); }
.md { font-size: .82rem; font-weight: 500; color: var(--muted); }
.mchev { color: var(--muted); font-size: 1.3rem; align-self: center; }
.cal, .legend { display: none; }
@media (min-width: 720px) {
  .mlist { display: none; }
  .cal { display: grid; }
}

/* ---------- Ventana del día ---------- */
#daysheet { padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); }
.ds-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ds-head > div { flex: 1; }
.ds-head h2 { font-size: 1.6rem; font-weight: 800; }
.ds-block { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.ds-label { display: flex; align-items: center; margin-bottom: 10px; font-size: .76rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.ds-label > span { flex: 1; }
.ds-label .cole { color: var(--green-ink); }
.ds-label .link { text-transform: none; letter-spacing: 0; }
#daysheet .tip, #daysheet .hero, #daysheet .ings { margin-left: 0; margin-right: 0; }
#daysheet .chips { padding-left: 0; padding-right: 0; flex-wrap: wrap; }
#daysheet .hero { display: flex; gap: 12px; align-items: center; }
#daysheet .hero-txt { margin: 0; }
#daysheet .dish-title { font-size: 1.05rem; }
#daysheet .meal > .sec-h { display: none; }

/* ---------- Botones y avisos ---------- */
.btn {
  border: 0; background: var(--surface); border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: .92rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; white-space: nowrap; text-decoration: none;
}
.btn:active { background: var(--surface-2); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 13px; font-size: .86rem; }
.btn:disabled, .chip:disabled { opacity: .5; }
.banner { margin: 0 16px 14px; border-radius: var(--r); padding: 14px; background: var(--surface); display: flex; gap: 12px; align-items: flex-start; }
.banner.green { background: var(--green-soft); }
.banner.orange { background: var(--orange-soft); }
.banner .txt { flex: 1; font-size: .9rem; }
.banner .txt b { display: block; font-size: 1rem; margin-bottom: 2px; }
.banner .close { border: 0; background: none; color: var(--muted); padding: 2px; }
.banner .close svg { width: 18px; height: 18px; }
.banner .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Lista de la compra ---------- */
.list { list-style: none; margin: 0; padding: 0 16px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row .txt { flex: 1; min-width: 0; }
.row .t { font-weight: 700; }
.row .s { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .qty { color: var(--muted); font-weight: 700; font-size: .88rem; white-space: nowrap; }
.check {
  appearance: none; -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface-2);
  flex: none; display: grid; place-items: center; margin: 0; background: var(--bg);
}
.check:checked { background: var(--green-ink); border-color: var(--green-ink); }
.check:checked::after { content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-1px) rotate(45deg); }
.row.done .t { text-decoration: line-through; color: var(--muted); }
.x { border: 0; background: none; color: var(--muted); padding: 4px; display: grid; }
.x svg { width: 16px; height: 16px; }
.shop-sec h3 { font-size: 1.05rem; font-weight: 800; padding: 18px 16px 2px; }
.add { display: flex; gap: 8px; margin: 14px 16px 6px; background: var(--surface); border-radius: 999px; padding: 4px 4px 4px 16px; align-items: center; }
.add input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; padding: 8px 0; }
.add select { border: 0; background: var(--bg); border-radius: 999px; padding: 8px 6px; width: 104px; flex: none; font-size: .82rem; }
.sticky-cta { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); margin: 18px 16px 0; z-index: 3; display: flex; gap: 8px; }
.sticky-cta .btn { box-shadow: var(--shadow); }
.progress { height: 6px; background: var(--surface); border-radius: 999px; margin: 0 16px 6px; overflow: hidden; }
.group .progress { margin: 8px 0 6px; background: var(--bg); }
.progress i { display: block; height: 100%; background: var(--green-ink); border-radius: 999px; transition: width .3s; }

/* ---------- Ajustes ---------- */
.group { margin: 0 16px 18px; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.group .item { padding: 14px; display: flex; gap: 12px; align-items: center; }
.group .item + .item { border-top: 1px solid var(--line); }
.group .item .txt { flex: 1; min-width: 0; font-size: .92rem; }
.group .item .txt > b { display: block; font-size: 1rem; }
.group .item .txt > span { color: var(--muted); overflow-wrap: anywhere; }
.logs { font: .74rem/1.45 ui-monospace, Menlo, monospace; color: var(--muted); max-height: 380px; overflow: auto; margin: 0; padding: 10px 14px; list-style: none; border-top: 1px solid var(--line); }
.logs li { padding: 3px 0; overflow-wrap: anywhere; }
.logs li + li { border-top: 1px dashed var(--line); }
.logs .lv { display: inline-block; min-width: 44px; margin-right: 6px; padding: 0 4px; border-radius: 4px; font-weight: 700; font-size: .66rem; text-align: center; background: var(--bg); }
.logs time { margin-right: 6px; opacity: .8; }
.logs .debug { opacity: .75; }
.logs .info .lv { color: var(--ink); }
.logs .warn .lv { background: var(--orange-soft); color: var(--orange); }
.logs .error { color: var(--orange); }
.logs .error .lv { background: var(--orange); color: var(--on-primary); }
.log-filter { display: flex; gap: 6px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: none; }
.log-filter .chip { height: 32px; padding: 0 12px; font-size: .8rem; background: var(--bg); }
.log-filter .chip.on { background: var(--primary); color: var(--on-primary); }
select.select { border: 0; background: var(--bg); border-radius: 999px; padding: 8px 12px; font-size: .86rem; font-weight: 600; max-width: 100%; }
.steps { margin: 6px 0 0; padding-left: 20px; }
.steps li { margin: 4px 0; }
.kbd { display: inline-flex; vertical-align: -4px; width: 20px; height: 20px; }
.kbd svg { width: 20px; height: 20px; }

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; max-width: 140px; border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; font-size: .7rem; font-weight: 700; position: relative;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar button.active { color: var(--ink); }
.tabbar button.active svg { stroke-width: 2.4; }
.tabbar .count {
  position: absolute; top: 8px; left: calc(50% + 6px); background: var(--green-ink); color: #fff; font-size: .65rem; min-width: 18px; height: 18px;
  border-radius: 999px; display: grid; place-items: center; padding: 0 5px;
}

.tabbar .count[hidden] { display: none; }
.alts-h { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 14px 0 -4px; }

/* ---------- Hojas inferiores / ventanas ---------- */
dialog {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0;
  background: var(--bg); color: var(--ink); box-shadow: 0 -10px 40px rgba(0,0,0,.25);
}
dialog[open] { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(30%); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 720px) { dialog { margin: auto; border-radius: 22px; } }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog form { padding: 8px 18px calc(16px + env(safe-area-inset-bottom)); }
.grabber { width: 40px; height: 5px; border-radius: 999px; background: var(--surface-2); margin: 4px auto 12px; }
dialog h2 { font-size: 1.3rem; font-weight: 800; }
.sheet-actions { display: flex; gap: 8px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }
label.f { display: block; font-weight: 700; font-size: .88rem; margin: 14px 0 6px; }
input[type=text], input[type=password], textarea {
  width: 100%; border: 2px solid transparent; background: var(--surface); border-radius: 12px; padding: 12px 14px; outline: none;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus { border-color: var(--ink); background: var(--bg); }
textarea { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: .84rem; margin: 6px 0 0; }

/* ---------- Varios ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 16px);
  background: var(--primary); color: var(--on-primary); padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); z-index: 20; box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.skeleton { margin: 16px; }
.skeleton i { display: block; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 12px; margin-bottom: 12px; }
@keyframes sh { to { background-position: -200% 0; } }
.empty-state { text-align: center; padding: 30px 24px; color: var(--muted); }
.empty-state b { display: block; color: var(--ink); font-size: 1.1rem; margin: 6px 0 4px; }
.offline { position: fixed; top: env(safe-area-inset-top); left: 0; right: 0; z-index: 30; background: var(--orange); color: #fff; text-align: center; font-size: .8rem; font-weight: 700; padding: 4px; }

@media (min-width: 720px) {
  .ocard { width: 240px; }
  .ph-hero { aspect-ratio: 16 / 7; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
