/* Kern en el celular (2026-10-30). Azul núcleo arriba y abajo, contenido en tarjetas; rojo sólo de acento. */
[hidden] { display: none !important; }
:root {
  --m-navy: #14213d; --m-red: #c4262e; --m-ok: #1d8a55; --m-gold: #8a6520;
  --m-bg: #f5f7fb; --m-card: #fff; --m-ink: #131c2b; --m-muted: #5a6577; --m-line: #e3e7ee;
  --m-disp: 'Source Serif 4', Georgia, serif; --m-body: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --m-bg: #0e1420; --m-card: #151d2b; --m-ink: #e8ecf3; --m-muted: #9ba6b8; --m-line: #263142; --m-gold: #e0b25a; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--m-bg); color: var(--m-ink); font: 14px/1.5 var(--m-body); }
button, input, select { font: inherit; color: inherit; }
.m-app { height: 100%; display: grid; grid-template-rows: auto 1fr auto; max-width: 560px; margin: 0 auto; }
.m-top { background: var(--m-navy); color: #fff; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
.m-anillos { width: 30px; height: 30px; flex: none; color: #fff; }
.m-marca b { font: 700 19px/1 var(--m-disp); display: block; }
.m-marca small { font-size: 11px; color: #9fb0cc; display: block; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sp { flex: 1; }
.m-empresa { max-width: 34vw; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 5px 6px; font-size: 12px; }
.m-empresa option { color: #131c2b; }
.m-av { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--m-red); color: #fff; font-weight: 700; text-transform: uppercase; cursor: pointer; }
.m-body { overflow-y: auto; padding: 14px max(14px, env(safe-area-inset-right, 0px)) 18px max(14px, env(safe-area-inset-left, 0px)); display: grid; gap: 10px; align-content: start; }
.m-tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--m-card); border-top: 1px solid var(--m-line);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px)); }
.m-tabs button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--m-muted); padding: 6px 0; cursor: pointer; }
.m-tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-tabs button[aria-selected="true"] { color: var(--m-red); }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--m-red); outline-offset: 2px; }
.m-h { font: 700 19px/1.2 var(--m-disp); margin: 2px 0; }
.m-c { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 14px; padding: 12px; display: grid; gap: 7px; }
.m-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.m-row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-mut { color: var(--m-muted); font-size: 12px; }
.m-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-kpi small { display: block; font-size: 11.5px; color: var(--m-muted); }
.m-kpi b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.m-big { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.m-chip { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.m-ok { background: rgba(29,138,85,.13); color: var(--m-ok); } .m-rd { background: rgba(196,38,46,.12); color: var(--m-red); } .m-gd { background: rgba(224,178,90,.2); color: var(--m-gold); } .m-gr { background: rgba(120,130,150,.15); color: var(--m-muted); }
.m-btn { display: flex; justify-content: center; align-items: center; gap: 6px; border-radius: 12px; padding: 12px; font-weight: 700; font-size: 14px; border: 0; cursor: pointer; text-decoration: none; }
.m-br { background: var(--m-red); color: #fff; } .m-bo { background: var(--m-card); border: 1px solid var(--m-line); color: var(--m-ink); } .m-bn { background: var(--m-navy); color: #fff; }
.m-btn[disabled] { opacity: .6; }
.m-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--m-line); border-radius: 10px; padding: 3px; gap: 3px; }
.m-seg button { border: 0; border-radius: 8px; padding: 8px; font-weight: 600; font-size: 13px; background: transparent; color: var(--m-muted); cursor: pointer; }
.m-seg button[aria-pressed="true"] { background: var(--m-card); color: var(--m-ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.m-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.m-acts button, .m-acts a { border: 1px solid var(--m-line); background: var(--m-card); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--m-ink); text-decoration: none; }
.m-in { width: 100%; border: 1px solid var(--m-line); border-radius: 10px; padding: 11px 12px; background: var(--m-card); }
.m-lbl { font-size: 12.5px; font-weight: 600; color: var(--m-muted); display: grid; gap: 4px; }
.m-qr { display: grid; justify-items: center; gap: 8px; padding: 16px; background: #fff; border-radius: 14px; color: #131c2b; }
.m-qr svg { width: 200px; height: 200px; }
.m-spark { width: 100%; height: 70px; display: block; }
.m-err { color: var(--m-red); font-size: 13px; }
.m-vacio { text-align: center; color: var(--m-muted); padding: 18px 8px; font-size: 13.5px; }
.m-toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #131c2b; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13.5px; z-index: 50; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.m-login { max-width: 380px; width: 100%; margin: 24px auto 0; }
.m-menu { position: fixed; right: 12px; top: calc(60px + env(safe-area-inset-top, 0px)); background: var(--m-card); border: 1px solid var(--m-line); border-radius: 12px; padding: 8px; display: grid; gap: 4px; min-width: 220px; z-index: 40; box-shadow: 0 14px 34px rgba(0,0,0,.25); }
.m-menu a, .m-menu button { text-align: left; border: 0; background: none; padding: 10px; border-radius: 8px; color: var(--m-ink); text-decoration: none; cursor: pointer; font-size: 14px; }

/* Marca: «por π Management» con la π en rojo claro, como el sitio (brand--kern). */
.m-marca small i { font-style: normal; color: #ff8a8f; font-weight: 700; font-family: var(--m-disp, Georgia, serif); font-size: 1.45em; line-height: 0; vertical-align: -.08em; margin: 0 .05em; }
.m-marca .m-neg { color: #cfd7e6; margin-top: 1px; }

/* FASE 2: pantallas propias que entran desde la derecha (‹ Atrás y el botón atrás del teléfono). */
.m-app { position: relative; overflow: hidden; }
.m-pant { position: absolute; inset: 0; z-index: 20; background: var(--m-bg); display: grid; grid-template-rows: auto 1fr;
  transform: translateX(100%); transition: transform .22s ease; }
.m-pant--in { transform: none; }
.m-pant__top { background: var(--m-navy); color: #fff; display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 12px max(10px, env(safe-area-inset-left, 0px)); }
.m-pant__top b { font: 700 17px/1.2 var(--m-disp); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-atras { border: 0; background: rgba(255,255,255,.1); color: #fff; border-radius: 10px; padding: 7px 12px; font-weight: 600; cursor: pointer; flex: none; }
.m-pant__body { overflow-y: auto; min-height: 0; padding: 14px max(14px, env(safe-area-inset-right, 0px)) calc(90px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); display: grid; gap: 10px; align-content: start; }
.m-pant__body--lleno { padding: 0; display: block; height: 100%; overflow: hidden; }
.m-visor { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
@media (prefers-reduced-motion: reduce) { .m-pant { transition: none; } }
.m-item { text-align: left; cursor: pointer; width: 100%; color: inherit; font: inherit; }
.m-lnk { border: 0; background: none; color: var(--m-red); font-weight: 700; cursor: pointer; padding: 6px 0; text-align: left; }
.m-uuid { font-size: 11.5px; word-break: break-all; }
.m-concepto { display: grid; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--m-line); }
.m-concepto__n { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
textarea.m-in { resize: vertical; }
/* Hojas de pregunta (en vez de alert/confirm del navegador). */
.m-hoja-fondo { position: fixed; inset: 0; background: rgba(10,15,26,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.m-hoja { background: var(--m-card); color: var(--m-ink); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); max-height: 80vh; overflow-y: auto; font-size: 14px; }
/* Pia */
.m-pia-fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(78px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  border: 0; border-radius: 999px; background: var(--m-navy); color: #fff; font-weight: 700; padding: 11px 16px; box-shadow: 0 10px 24px rgba(15,26,51,.35); cursor: pointer; }
.m-pant__body.m-pia { grid-template-rows: 1fr auto auto; align-content: stretch; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.m-pia__hilo { overflow-y: auto; display: grid; gap: 10px; align-content: start; min-height: 0; }
.m-pia__yo { justify-self: end; background: var(--m-navy); color: #fff; border-radius: 14px 14px 4px 14px; padding: 9px 12px; max-width: 85%; font-size: 13.5px; }
.m-pia__ella { background: var(--m-card); border: 1px solid var(--m-line); border-radius: 14px 14px 14px 4px; padding: 10px 12px; font-size: 13.5px; display: grid; gap: 8px; max-width: 94%; }
.m-pia__w { font-size: 11px; font-weight: 700; color: var(--m-red); }
.m-pia__sug { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.m-pia__caja { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
