/* ============================================================
   Finanzas para emprender · estilos
   Todo está limitado a .fpe para no chocar con main.css del sitio.
   Las variables toman las del sitio (--navy, --cyan...) y, si no
   existen (modo independiente), usan los valores de respaldo.
   ============================================================ */
.fpe, .fpe * { box-sizing: border-box; }
.fpe {
  --f-navy: var(--navy, #013567);
  --f-navy-deep: var(--navy-deep, #011f3f);
  --f-navy-mid: var(--navy-mid, #012a52);
  --f-navy-light: var(--navy-light, #024a8f);
  --f-cyan: var(--cyan, #00CCFF);
  --f-cyan-soft: var(--cyan-soft, rgba(0,204,255,.10));
  --f-cyan-border: var(--cyan-border, rgba(0,204,255,.25));
  --f-bg: var(--gray-bg, #f4f7fb);
  --f-line: var(--gray-mid, #e2e8f0);
  --f-text: var(--text, #0f172a);
  --f-muted: var(--text-muted, #64748b);
  --f-r-sm: var(--r-sm, 6px);
  --f-r-md: var(--r-md, 12px);
  --f-r-lg: var(--r-lg, 20px);
  --f-shadow: var(--shadow, 0 4px 24px rgba(1,53,103,.10));
  --f-shadow-lg: var(--shadow-lg, 0 8px 48px rgba(1,53,103,.16));
  --f-t: var(--t, .22s ease);
  --f-input: #0a4aa6;          /* texto azul = lo escribes tú */
  --f-ok: #0d6b34;   --f-ok-bg: #e9f9ee;
  --f-warn: #8a5a00; --f-warn-bg: #fff6dc;
  --f-bad: #b42318;  --f-bad-bg: #fdecea;
  --f-info: #024a8f; --f-info-bg: #eaf2fb;
  --f-nav-offset: 0px;          /* altura del menú fijo del sitio (la página la fija en 68px) */
  font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
  color: var(--f-text);
  background: var(--f-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 60vh;
}
.fpe button, .fpe input, .fpe select, .fpe textarea { font-family: inherit; font-size: 14px; color: inherit; }
.fpe h1, .fpe h2, .fpe h3, .fpe h4 { font-family: 'Syne', 'DM Sans', sans-serif; margin: 0; color: var(--f-navy); line-height: 1.2; }
.fpe p { margin: 0; }
.fpe .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fpe :focus-visible { outline: 3px solid var(--f-cyan); outline-offset: 2px; border-radius: 6px; }

/* ---------- banda de título ---------- */
.fpe-hero {
  background: linear-gradient(135deg, var(--f-navy-deep), var(--f-navy) 55%, var(--f-navy-light));
  color: #fff; padding: calc(36px + var(--f-nav-offset)) 20px 34px;
}
.fpe-hero { position: relative; overflow: hidden; }
.fpe-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(0,204,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0,204,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.fpe-hero-in { position: relative; max-width: 1140px; margin: 0 auto; }
.fpe-tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--f-cyan); background: rgba(0,204,255,.1); border: 1px solid var(--f-cyan-border);
  padding: 5px 14px; border-radius: 100px; margin-bottom: 14px;
}
.fpe-hero h1 { color: #fff; font-size: clamp(24px, 4.2vw, 34px); font-weight: 800; }
.fpe-hero p { margin-top: 10px; max-width: 680px; color: rgba(255,255,255,.82); font-size: 15px; }
.fpe-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fpe-hero-chips { list-style: none; padding: 0; margin-bottom: 0; }
.fpe-hero-chips li { font-size: 12px; color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.22); padding: 4px 12px; border-radius: 100px; }

/* ---------- barra de pasos ---------- */
.fpe-bar {
  position: sticky; top: var(--f-nav-offset); z-index: 30;
  background: rgba(244,247,251,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--f-line);
}
.fpe-bar-in { max-width: 1140px; margin: 0 auto; padding: 10px 20px; }
.fpe-steps { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.fpe-steps::-webkit-scrollbar { display: none; }
.fpe-step-btn {
  flex: 1 1 0; min-width: 138px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 9px 12px; background: #fff; border: 1.5px solid var(--f-line); border-radius: var(--f-r-md);
  text-align: left; transition: all var(--f-t);
}
.fpe-step-btn:hover { border-color: var(--f-cyan); }
.fpe-step-btn .n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 12px; background: var(--f-bg); color: var(--f-navy); border: 1.5px solid var(--f-line);
  transition: all var(--f-t);
}
.fpe-step-btn .l { font-size: 12.5px; font-weight: 600; color: #475569; line-height: 1.2; }
.fpe-step-btn .l small { display: block; font-weight: 500; font-size: 11px; color: var(--f-muted); }
.fpe-step-btn.is-active { border-color: var(--f-cyan); background: #f0faff; box-shadow: 0 0 0 3px var(--f-cyan-soft); }
.fpe-step-btn.is-active .n { background: var(--f-navy); color: var(--f-cyan); border-color: var(--f-navy); }
.fpe-step-btn.is-active .l { color: var(--f-navy); }
.fpe-step-btn.is-done .n { background: var(--f-ok-bg); color: var(--f-ok); border-color: #b9e6c8; }
.fpe-progress { height: 4px; background: var(--f-line); border-radius: 4px; margin-top: 9px; overflow: hidden; }
.fpe-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--f-navy), var(--f-cyan)); transition: width .4s ease; }
.fpe-tools { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.fpe-save { font-size: 12px; color: var(--f-muted); display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
.fpe-save i { width: 8px; height: 8px; border-radius: 50%; background: #25a35a; display: inline-block; }
.fpe-save.is-warn i { background: #e0a100; } .fpe-save.is-off i { background: #94a3b8; } .fpe-save.is-busy i { animation: fpePulse 1s infinite; }
@keyframes fpePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.75); } }

/* ---------- botones ---------- */
.fpe-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 10px 18px; border-radius: var(--f-r-md); font-weight: 600; font-size: 13.5px; line-height: 1.2;
  border: 1.5px solid transparent; transition: all var(--f-t); text-decoration: none; white-space: nowrap;
}
.fpe-btn:disabled { opacity: .45; cursor: not-allowed; }
.fpe-btn.p { background: var(--f-cyan); color: var(--f-navy-deep); }
.fpe-btn.p:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,204,255,.35); }
.fpe-btn.n { background: var(--f-navy); color: #fff; }
.fpe-btn.n:hover:not(:disabled) { background: var(--f-navy-light); }
.fpe-btn.o { background: #fff; color: var(--f-navy); border-color: var(--f-line); }
.fpe-btn.o:hover:not(:disabled) { border-color: var(--f-cyan); background: #f0faff; }
.fpe-btn.g { background: transparent; color: var(--f-navy); padding: 8px 10px; }
.fpe-btn.g:hover:not(:disabled) { background: var(--f-cyan-soft); }
.fpe-btn.d { background: #fff; color: var(--f-bad); border-color: #f1c7c2; }
.fpe-btn.d:hover:not(:disabled) { background: var(--f-bad-bg); }
.fpe-btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.fpe-btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- cuadrícula principal ---------- */
.fpe-wrap { max-width: 1140px; margin: 0 auto; padding: 22px 20px 90px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.fpe-main { min-width: 0; }
.fpe-live { position: sticky; top: calc(var(--f-nav-offset) + 150px); }
@media (max-width: 1020px) { .fpe-wrap { grid-template-columns: minmax(0, 1fr); } .fpe-live { display: none; } }

.fpe-stage { position: relative; }
.fpe-step { animation: fpeIn .35s ease both; }
.fpe-step.out { animation: fpeOut .18s ease both; }
@keyframes fpeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fpeOut { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- paneles ---------- */
.fpe-panel { background: #fff; border-radius: 14px; box-shadow: 0 2px 14px rgba(1,53,103,.07); border: 1px solid var(--f-line); margin-bottom: 18px; overflow: visible; }
.fpe-panel-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 0; flex-wrap: wrap; }
.fpe-panel-h h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.fpe-panel-h .sub { font-size: 12.5px; color: var(--f-muted); margin-top: 4px; max-width: 640px; }
.fpe-panel-b { padding: 16px 22px 22px; }
.fpe-lead { font-size: 13.5px; color: #475569; margin-bottom: 14px; }
.fpe-sec { margin-top: 22px; }
.fpe-sec > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--f-muted); font-family: 'DM Sans', sans-serif; font-weight: 700; margin-bottom: 10px; }

/* ---------- campos ---------- */
.fpe-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fpe-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fpe-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fpe-grid.c1 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .fpe-grid, .fpe-grid.c3, .fpe-grid.c4 { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 761px) and (max-width: 1020px) { .fpe-grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fpe-field { min-width: 0; }
.fpe-field > label, .fpe-lbl { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #6b7686; margin-bottom: 6px; }
.fpe-ctl { position: relative; }
.fpe-ctl input, .fpe-ctl select, .fpe-ctl textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid #dbe3ee; border-radius: 10px; background: #fff;
  color: var(--f-input); font-weight: 500; transition: border-color .2s, box-shadow .2s; outline: none;
}
.fpe-ctl textarea { min-height: 78px; resize: vertical; }
.fpe-ctl input:focus, .fpe-ctl select:focus, .fpe-ctl textarea:focus { border-color: var(--f-cyan); box-shadow: 0 0 0 3px var(--f-cyan-soft); }
.fpe-ctl.money input { padding-left: 26px; text-align: right; }
.fpe-ctl.money::before { content: '$'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-weight: 600; pointer-events: none; }
.fpe-ctl.pct input { padding-right: 28px; text-align: right; }
.fpe-ctl.pct::after { content: '%'; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-weight: 600; pointer-events: none; }
.fpe-ctl.num input { text-align: right; }
.fpe-ctl.num[data-suf]::after { content: attr(data-suf); position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 12px; pointer-events: none; }
.fpe-ctl.num[data-suf] input { padding-right: 52px; }
.fpe-note { font-size: 12px; color: var(--f-muted); margin-top: 5px; }
.fpe-field.bad .fpe-ctl input, .fpe-field.bad .fpe-ctl select { border-color: #e37b72; }

/* ---------- ayuda "?" ---------- */
.fpe-q {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--f-cyan); background: var(--f-cyan-soft); color: var(--f-navy);
  font-size: 11px; font-weight: 800; line-height: 1; display: inline-grid; place-items: center; cursor: pointer; padding: 0; flex: none;
  text-transform: none; transition: all var(--f-t);
}
.fpe-q:hover, .fpe-q[aria-expanded="true"] { background: var(--f-cyan); }
.fpe-pop {
  position: fixed; z-index: 1200; left: 0; top: 0; width: min(310px, calc(100vw - 24px)); background: var(--f-navy-deep); color: #fff; border-radius: 12px;
  padding: 13px 15px; font-size: 13px; line-height: 1.5; box-shadow: var(--f-shadow-lg); border: 1px solid rgba(0,204,255,.3);
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s ease, transform .15s ease; text-transform: none; letter-spacing: 0; font-weight: 400;
}
.fpe-pop.on { opacity: 1; transform: none; pointer-events: auto; }
.fpe-pop b { color: var(--f-cyan); display: block; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; margin-top: 8px; }
.fpe-pop .x { margin-top: 6px; color: #d6eefb; }

/* ---------- valores calculados ---------- */
.fpe-out { background: var(--f-bg); border: 1.5px solid transparent; border-radius: 10px; padding: 10px 12px; font-weight: 600; color: var(--f-text); text-align: right; min-height: 43px; display: flex; align-items: center; justify-content: flex-end; }
.fpe-out.left { justify-content: flex-start; text-align: left; }
.fpe-out.big { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; color: var(--f-navy); }
.fpe-out.link { color: var(--f-ok); } /* verde = viene de otro paso */
.fpe-kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--f-line); font-size: 13.5px; }
.fpe-kv:last-child { border-bottom: 0; }
.fpe-kv span:first-child { color: #52606f; }
.fpe-kv b { font-weight: 700; text-align: right; }
.fpe-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: #52606f; }
.fpe-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; border: 1.5px solid; }
.fpe-legend .a { border-color: #cfe0f5; background: #fff; box-shadow: inset 0 0 0 3px #e6f0fc; } .fpe-legend .b { background: var(--f-bg); border-color: var(--f-line); } .fpe-legend .c { background: var(--f-ok-bg); border-color: #b9e6c8; }

/* ---------- tarjetas de producto ---------- */
.fpe-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.fpe-card { border: 1.5px solid var(--f-line); border-radius: 16px; padding: 16px 16px 14px; background: #fff; position: relative; transition: border-color var(--f-t), box-shadow var(--f-t); }
.fpe-card:hover { border-color: var(--f-cyan-border); box-shadow: var(--f-shadow); }
.fpe-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fpe-card-h .num { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--f-navy); color: var(--f-cyan); font-family: 'Syne', sans-serif; font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.fpe-card-h .fpe-ctl { flex: 1; }
.fpe-card-h .rm { background: none; border: 0; color: #94a3b8; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.fpe-card-h .rm:hover { color: var(--f-bad); background: var(--f-bad-bg); }
.fpe-card .res { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(1,53,103,.18); }
.fpe-add { border: 2px dashed #c9d6e6; border-radius: 16px; background: transparent; color: var(--f-navy); cursor: pointer; font-weight: 600; min-height: 90px; display: grid; place-items: center; transition: all var(--f-t); padding: 16px; }
.fpe-add:hover { border-color: var(--f-cyan); background: #f0faff; }

/* ---------- selector de modo ---------- */
.fpe-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .fpe-modes { grid-template-columns: 1fr; } }
.fpe-mode { text-align: left; background: #fff; border: 2px solid var(--f-line); border-radius: 16px; padding: 18px; cursor: pointer; transition: all var(--f-t); position: relative; }
.fpe-mode:hover { border-color: var(--f-cyan); transform: translateY(-3px); box-shadow: var(--f-shadow); }
.fpe-mode.is-on { border-color: var(--f-cyan); background: #f0faff; box-shadow: 0 0 0 4px var(--f-cyan-soft); }
.fpe-mode .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--f-navy); display: grid; place-items: center; margin-bottom: 12px; }
.fpe-mode .ic svg { width: 22px; height: 22px; stroke: var(--f-cyan); }
.fpe-mode h3 { font-size: 16px; margin-bottom: 6px; }
.fpe-mode p { font-size: 13px; color: #52606f; }
.fpe-mode ul { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; color: #52606f; }

/* ---------- tablas ---------- */
.fpe-tw { overflow-x: auto; margin: 0 -2px; border-radius: 10px; }
.fpe-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.fpe-table th { text-align: right; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: #7a8696; font-weight: 700; padding: 9px 10px; border-bottom: 2px solid var(--f-line); white-space: nowrap; }
.fpe-table th:first-child, .fpe-table td:first-child { text-align: left; }
.fpe-table td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; text-align: right; font-variant-numeric: tabular-nums; }
.fpe-table td:first-child { color: #3b4a5c; font-weight: 500; position: sticky; left: 0; background: #fff; }
.fpe-table tr.sec td { background: var(--f-bg); font-weight: 700; color: var(--f-navy); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; }
.fpe-table tr.tot td { font-weight: 800; background: #f7fafd; color: var(--f-navy); }
.fpe-table tr.tot td:first-child { background: #f7fafd; }
.fpe-table .fpe-ctl input { padding: 6px 8px; font-size: 12.5px; min-width: 96px; border-radius: 8px; }
.fpe-table .fpe-ctl.money input { padding-left: 20px; } .fpe-table .fpe-ctl.money::before { left: 8px; font-size: 12px; }
.fpe-table .neg { color: var(--f-bad); }
.fpe-bar2 { height: 8px; border-radius: 8px; background: var(--f-line); overflow: hidden; min-width: 70px; }
.fpe-bar2 i { display: block; height: 100%; background: linear-gradient(90deg, var(--f-navy), var(--f-cyan)); border-radius: 8px; transition: width .4s ease; }

/* ---------- semáforos y avisos ---------- */
.fpe-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 100px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.fpe-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fpe-chip.Bien, .fpe-chip.OK { background: var(--f-ok-bg); color: var(--f-ok); }
.fpe-chip.Atención, .fpe-chip.Bajo { background: var(--f-warn-bg); color: var(--f-warn); }
.fpe-chip.Alerta, .fpe-chip.Caja { background: var(--f-bad-bg); color: var(--f-bad); }
.fpe-chip.Info { background: var(--f-info-bg); color: var(--f-info); }
.fpe-sug { display: grid; gap: 10px; margin-top: 4px; }
.fpe-sg { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.55; border: 1px solid transparent; animation: fpeIn .3s ease both; }
.fpe-sg .ico { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.fpe-sg b { display: block; margin-bottom: 2px; }
.fpe-sg.alerta { background: var(--f-bad-bg); border-color: #f5c9c4; color: #7a1d14; } .fpe-sg.alerta .ico { background: var(--f-bad); color: #fff; }
.fpe-sg.atencion { background: var(--f-warn-bg); border-color: #f1dfaa; color: #5c3f00; } .fpe-sg.atencion .ico { background: #d99a00; color: #fff; }
.fpe-sg.info { background: var(--f-info-bg); border-color: #cfe0f5; color: #0b3a6b; } .fpe-sg.info .ico { background: var(--f-navy-light); color: #fff; }
.fpe-sg.ok { background: var(--f-ok-bg); border-color: #bfe7cd; color: #0b4d27; } .fpe-sg.ok .ico { background: #25a35a; color: #fff; }
.fpe-empty { font-size: 13px; color: var(--f-muted); padding: 10px 0; }
.fpe-box { background: #fff8e1; border-radius: 10px; padding: 14px 16px; font-size: 12.5px; color: #7a5c00; line-height: 1.65; }
.fpe-box.blue { background: var(--f-info-bg); color: #0b3a6b; }
.fpe-box.red { background: var(--f-bad-bg); color: #7a1d14; }

/* ---------- panel en vivo ---------- */
.fpe-live-card { background: linear-gradient(160deg, var(--f-navy-deep), var(--f-navy)); color: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--f-shadow-lg); }
.fpe-live-card h3 { color: var(--f-cyan); font-family: 'DM Sans', sans-serif; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; margin-bottom: 12px; }
.fpe-kpi { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.fpe-kpi:last-of-type { border-bottom: 0; }
.fpe-kpi .k { font-size: 11.5px; color: rgba(255,255,255,.65); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fpe-kpi .v { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px; margin-top: 2px; word-break: break-word; }
.fpe-kpi .v.neg { color: #ff9a90; }
.fpe-live-card .fpe-chip { font-size: 10px; padding: 2px 8px; }
.fpe-live-chart { margin-top: 12px; }
.fpe-mini { font-size: 11.5px; color: rgba(255,255,255,.7); margin-top: 6px; }
.fpe-mobile-bar { display: none; }
@media (max-width: 1020px) {
  .fpe-mobile-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 10px; align-items: center; justify-content: space-between;
    background: var(--f-navy-deep); color: #fff; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(1,31,63,.3);
  }
  .fpe-mobile-bar .m { font-size: 11px; color: rgba(255,255,255,.65); }
  .fpe-mobile-bar .v { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px; }
  .fpe-wrap { padding-bottom: 100px; }
}

/* ---------- navegación inferior ---------- */
.fpe-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- gráficos ---------- */
.fpe-chart { width: 100%; height: auto; display: block; }
.fpe-chart text { font-family: 'DM Sans', sans-serif; }
.fpe-chart-box { background: #fff; border: 1px solid var(--f-line); border-radius: 14px; padding: 14px 16px 8px; }
.fpe-chart-box h4 { font-size: 13px; margin-bottom: 4px; font-family: 'DM Sans', sans-serif; }

/* ---------- ventanas flotantes ---------- */
.fpe-modal-root { position: fixed; inset: 0; z-index: 1000; display: none; }
.fpe-modal-root.on { display: block; }
.fpe-backdrop { position: absolute; inset: 0; background: rgba(1,31,63,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .22s ease; }
.fpe-modal-root.show .fpe-backdrop { opacity: 1; }
.fpe-dialog {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98); opacity: 0;
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto;
  background: #fff; border-radius: 20px; box-shadow: 0 24px 80px rgba(1,31,63,.45); transition: all .24s cubic-bezier(.2,.8,.3,1);
}
.fpe-dialog.wide { width: min(860px, calc(100vw - 24px)); }
.fpe-modal-root.show .fpe-dialog { transform: translate(-50%, -50%); opacity: 1; }
.fpe-dialog-h { padding: 22px 24px 4px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.fpe-dialog-h h2 { font-size: 19px; }
.fpe-dialog-h .sub { font-size: 13px; color: var(--f-muted); margin-top: 6px; }
.fpe-dialog-b { padding: 14px 24px 8px; }
.fpe-dialog-f { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.fpe-x { background: none; border: 0; cursor: pointer; color: #64748b; padding: 6px; border-radius: 8px; flex: none; }
.fpe-x:hover { background: var(--f-bg); }
@media (max-width: 640px) {
  .fpe-dialog { top: auto; bottom: 0; left: 0; width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; transform: translateY(40px); }
  .fpe-modal-root.show .fpe-dialog { transform: none; }
  .fpe-dialog-h, .fpe-dialog-b, .fpe-dialog-f { padding-left: 18px; padding-right: 18px; }
}
.fpe-list { display: grid; gap: 8px; }
.fpe-li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--f-line); border-radius: 12px; flex-wrap: wrap; }
.fpe-li.is-on { border-color: var(--f-cyan); background: #f0faff; }
.fpe-li .nm { flex: 1; min-width: 140px; font-weight: 600; color: var(--f-navy); }
.fpe-li .nm small { display: block; font-weight: 400; color: var(--f-muted); font-size: 11.5px; }
.fpe-resumen { font-size: 14px; line-height: 1.7; color: #1e293b; }
.fpe-resumen p { margin-bottom: 10px; }
.fpe-prio { counter-reset: p; list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.fpe-prio li { counter-increment: p; display: flex; gap: 10px; font-size: 13.5px; }
.fpe-prio li::before { content: counter(p); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--f-navy); color: var(--f-cyan); font-weight: 800; font-size: 12px; display: grid; place-items: center; }

/* ---------- aviso (toast) ---------- */
.fpe-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--f-navy-deep); color: #fff; z-index: 1100;
  padding: 10px 20px; border-radius: 100px; font-size: 13px; font-weight: 500; opacity: 0; transition: all .3s ease; pointer-events: none; max-width: calc(100vw - 24px); text-align: center;
  box-shadow: var(--f-shadow-lg); border: 1px solid var(--f-cyan-border);
}
.fpe-toast.on { opacity: 1; transform: translate(-50%, 0); }
.fpe-toast.warn { background: #6a4a00; }
@media (max-width: 1020px) { .fpe-toast { bottom: 84px; } }

/* ---------- CTA final ---------- */
.fpe-cta { background: linear-gradient(135deg, var(--f-navy-deep), var(--f-navy)); color: #fff; padding: 22px; border-radius: 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.fpe-cta h3 { color: #fff; font-size: 16px; } .fpe-cta p { font-size: 13px; color: rgba(255,255,255,.8); margin-top: 4px; max-width: 520px; }
.fpe-disclaimer { font-size: 12px; color: var(--f-muted); margin-top: 14px; line-height: 1.6; }

/* ---------- respeto a quien reduce el movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  .fpe *, .fpe *::before, .fpe *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ---------- impresión del resumen ---------- */
@media print {
  body * { visibility: hidden !important; }
  .fpe-modal-root.on, .fpe-modal-root.on * { visibility: visible !important; }
  .fpe-modal-root.on { position: absolute; inset: 0; }
  .fpe-backdrop, .fpe-dialog-f, .fpe-x { display: none !important; }
  .fpe-dialog { position: static; transform: none !important; width: 100%; max-height: none; box-shadow: none; opacity: 1; }
}

/* ---------- ajustes tras primera prueba ---------- */
.fpe-add svg { width: 26px; height: 26px; }
.fpe-add { grid-auto-flow: row; gap: 6px; align-content: center; justify-items: center; }

/* ---------- ajustes tras la revisión de diseño ---------- */
/* botones con ícono: tamaño explícito y área táctil */
.fpe-x { min-width: 44px; min-height: 44px; display: grid; place-items: center; color: #475569; }
.fpe-x svg { width: 20px; height: 20px; display: block; }
.fpe-card-h .rm { min-width: 44px; min-height: 44px; color: #64748b; }
.fpe-card-h .rm svg { width: 18px; height: 18px; display: block; }
.fpe-q { position: relative; color: var(--f-navy); }
.fpe-q::after { content: ''; position: absolute; inset: -13px; }
/* foco visible con contraste suficiente */
.fpe :focus-visible { outline: 3px solid var(--f-navy); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(0,204,255,.55); }
/* contraste de textos pequeños */
.fpe-table th { color: #52606f; font-size: 11px; }
.fpe-sg .ico { background-color: #8a5a00 !important; color: #fff !important; }
.fpe-sg.info .ico { background-color: #0b5cad !important; }
.fpe-sg.ok .ico { background-color: #0d6b34 !important; }
.fpe-sg.alerta .ico { background-color: #b42318 !important; }
.fpe-ctl::before, .fpe-ctl::after { color: #64748b; }
.fpe-save, .fpe-step-btn .l small { color: #52606f; }
/* cifras legibles: DM Sans con dígitos tabulares */
.fpe-step-btn .n, .fpe-mobile-bar .v, .fpe-live-card .v, .fpe-out, .fpe-kv b, .fpe-table td, .fpe-kpi .v { font-family: 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; }
.fpe-step-btn .n, .fpe-mobile-bar .v, .fpe-live-card .v, .fpe-out.big { font-weight: 800; }
/* gráficos */
.fpe-chart { display: block; width: 100%; height: auto; }
[data-r="chartEq"] .fpe-chart { max-width: 460px; }
/* ventana: no se desborda y la hoja inferior ocupa todo el ancho */
.fpe-dialog { max-height: calc(100dvh - 32px); overscroll-behavior: contain; display: flex; flex-direction: column; }
.fpe-dialog-b { overflow: auto; flex: 1 1 auto; }
.fpe-dialog-h, .fpe-dialog-f { flex: none; }
.fpe-dialog-f { border-top: 1px solid var(--f-line); padding-top: 12px; }
@media (max-width: 640px) {
  .fpe-dialog, .fpe-dialog.wide { width: 100%; max-height: 92dvh; }
  .fpe .fpe-btn, .fpe .fpe-btn.sm { min-height: 44px; }
  .fpe input, .fpe select, .fpe textarea, .fpe button { font-size: 16px; }
  .fpe-ctl input, .fpe-ctl select { min-height: 44px; }
  /* la barra fija pasa a ser compacta: solo números de paso; las herramientas no se quedan fijas */
  .fpe-bar, .fpe-bar-in { display: contents; }
  .fpe-steps { position: sticky; top: var(--f-nav-offset); z-index: 30; background: rgba(244,247,251,.96); padding: 8px 12px; }
  .fpe-step-btn { min-width: 0; flex: 1 1 0; padding: 8px 6px; justify-content: center; }
  .fpe-step-btn .l { display: none; }
  .fpe-step-btn.is-active .l { display: none; }
  .fpe-tools { flex-wrap: wrap; padding: 8px 12px; }
}
@media (max-width: 1020px) { .fpe-tools { flex-wrap: wrap; } .fpe-tools .fpe-btn.p { margin-left: auto; } }
.fpe-toast { bottom: auto; top: 16px; }
.fpe-tw:focus-visible { outline-offset: -2px; }
/* impresión: el resumen sale en una página limpia */
@media print {
  body * { visibility: visible !important; }
  .fpe-hero, #fpe-bar, #fpe-live, #fpe-mbar, .fpe-toast, .fpe-pop { display: none !important; }
  .fpe[data-modal] .fpe-wrap { display: none !important; }
  .fpe-modal-root.on { position: static; }
  .fpe-step, .fpe-panel, .fpe-sec { break-inside: avoid; }
  .fpe-dialog { display: block; overflow: visible; }
  .fpe-dialog-b { overflow: visible; }
}

/* ============================================================
   Orden visual: etiquetas, ayudas, grupos, colores y lista de insumos
   ============================================================ */
:root, .fpe {
  --f-label: #1e3a5f;      /* etiquetas: azul oscuro legible */
  --f-calc-bg: #eaf3fc;    /* valores calculados */
  --f-calc-bd: #cfe0f5;
}
/* etiqueta en frase normal, con el "?" pegado al texto */
.fpe-field > label, .fpe-lbl {
  display: block; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--f-label);
  margin-bottom: 6px; line-height: 1.35;
}
.fpe-field > label .fpe-q, .fpe-lbl .fpe-q, .fpe-kv .fpe-q, .fpe-ins-h .fpe-q { display: inline-grid; vertical-align: -4px; margin-left: 6px; }
/* los campos de una fila quedan alineados aunque una etiqueta ocupe dos líneas */
.fpe-grid > .fpe-field { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.fpe-grid > .fpe-field > .fpe-aux:empty { display: none; }
.fpe-aux { min-width: 0; }
.fpe-aux .fpe-btn { margin-top: 6px; }
.fpe-note { color: #5b6878; font-size: 12px; margin-top: 6px; line-height: 1.45; }
/* campos: valor en azul, símbolos en gris legible */
.fpe-ctl input, .fpe-ctl select, .fpe-ctl textarea { border-color: #cfd9e6; color: #0b2f5b; }
.fpe-ctl input::placeholder { color: #9aa7b8; }
.fpe-ctl.money::before, .fpe-ctl.pct::after { color: #64748b; }
.fpe-out { background: var(--f-calc-bg); border-color: var(--f-calc-bd); color: var(--f-navy); }
.fpe-out.link { background: #e8f6ee; border-color: #b9e6c8; }
/* paneles: título con letra, franja suave y separación clara */
.fpe-panel { border-color: #d6e0ee; }
.fpe-panel-h { padding: 16px 22px 14px; background: linear-gradient(#f6f9fd, #fff); border-bottom: 1px solid #e3eaf4; border-radius: 14px 14px 0 0; }
.fpe-panel-h h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; text-transform: none; letter-spacing: 0; font-weight: 800; }
.fpe-letter { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--f-navy); color: var(--f-cyan); display: grid; place-items: center; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 800; }
.fpe-panel-b { padding: 18px 22px 22px; }
/* grupos dentro de un panel */
.fpe-grp + .fpe-grp { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e8eef6; }
.fpe-grp-t { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: var(--f-navy); }
.fpe-grp-t::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--f-cyan); flex: none; }
.fpe-sec > h3.fpe-grp-t { color: var(--f-navy); font-size: 12px; margin-bottom: 12px; }
/* totales */
.fpe-sec > .fpe-kv:only-child, .fpe-sec > .fpe-kv:first-child:last-child { font-weight: 800; color: var(--f-navy); border-top: 2px solid var(--f-navy); border-bottom: 0; padding-top: 12px; font-size: 15px; }
.fpe-kv span:first-child { color: #3b4a5c; }

/* productos: uno debajo del otro, a todo el ancho */
.fpe-cards { display: flex; flex-direction: column; gap: 18px; }
.fpe-card { padding: 20px 22px 18px; border-color: #d6e0ee; }
.fpe-card .fpe-sec { margin-top: 20px; padding-top: 16px; border-top: 1px solid #e8eef6; }
.fpe-card-h { margin-bottom: 16px; }
.fpe-card-h .fpe-ctl input { font-family: 'Syne', 'DM Sans', sans-serif; font-weight: 700; font-size: 16px; color: var(--f-navy); }
.fpe-add { width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14.5px; border-radius: 14px; }
.fpe-add svg { width: 20px; height: 20px; }
/* lista de insumos, línea por línea */
.fpe-ins { border: 1.5px solid #dbe5f1; border-radius: 12px; background: #fafcff; padding: 4px 12px 12px; }
.fpe-ins-h, .fpe-ins-r { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 200px) 44px; gap: 10px; align-items: center; }
.fpe-ins-h { padding: 10px 0 6px; font-size: 12px; font-weight: 700; color: #3b4a5c; }
.fpe-ins-h span:nth-child(2) { text-align: right; padding-right: 4px; }
.fpe-ins-r { padding: 4px 0; }
.fpe-ins-r .fpe-ctl input { background: #fff; }
.fpe-ins-r .rm { background: none; border: 0; color: #64748b; cursor: pointer; border-radius: 8px; min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; }
.fpe-ins-r .rm:hover { color: var(--f-bad); background: var(--f-bad-bg); }
.fpe-ins-r .rm svg { width: 18px; height: 18px; }
.fpe-ins-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding-top: 10px; border-top: 1px dashed #c9d6e6; }
.fpe-add-line { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1.5px dashed #9ec3e8; color: var(--f-navy); font-weight: 700; font-size: 13px; padding: 10px 14px; border-radius: 10px; cursor: pointer; min-height: 44px; transition: all var(--f-t); }
.fpe-add-line:hover { border-color: var(--f-cyan); background: #f0faff; }
.fpe-add-line svg { width: 16px; height: 16px; }
.fpe-ins-f .tot { display: flex; align-items: baseline; gap: 12px; font-size: 13.5px; color: #3b4a5c; margin-left: auto; }
.fpe-ins-f .tot b { font-size: 16px; color: var(--f-navy); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .fpe-ins-h { display: none; }
  .fpe-ins-r { grid-template-columns: minmax(0, 1fr) 44px; }
  .fpe-ins-r .fpe-ctl:first-child { grid-column: 1 / -1; }
  .fpe-ins-r .fpe-ctl.money { grid-column: 1; }
  .fpe-ins-r { padding: 8px 0; border-bottom: 1px solid #e8eef6; }
  .fpe-panel-b, .fpe-card { padding-left: 14px; padding-right: 14px; }
  .fpe-panel-h { padding-left: 14px; padding-right: 14px; }
}
.fpe .nw { white-space: nowrap; }
.fpe .fpe-grp-t { margin: 0 0 12px; }


/* ===== tablas con productos en filas + % sin montarse ===== */
.fpe-table .fpe-ctl.pct input { padding-right: 24px; min-width: 84px; }
.fpe-table .fpe-ctl.pct::after { right: 9px; font-size: 12px; }
.fpe-table .fpe-ctl.num[data-suf] input { padding-right: 46px; }
.fpe-table .fpe-ctl.num[data-suf]::after { right: 8px; font-size: 11px; }
.fpe-table.by th { white-space: normal; line-height: 1.3; vertical-align: bottom; min-width: 104px; text-transform: none; letter-spacing: 0; font-size: 12px; color: #3b4a5c; }
.fpe-table.by th:first-child { min-width: 120px; }
.fpe-table.by td:first-child { font-weight: 700; color: var(--f-navy); }
.fpe-table.by td.tx { text-align: left; white-space: normal; min-width: 170px; font-size: 12.5px; color: #52606f; }
.fpe-table th .fpe-q { margin-left: 4px; vertical-align: middle; }
.fpe-table.by tr.tot td { border-top: 2px solid var(--f-line); }


/* ===== claridad para quien llega sin formación financiera ===== */
.fpe-ver { border: 1px solid var(--f-line); border-left: 6px solid #94a3b8; border-radius: 14px; padding: 16px 18px; background: #fff; }
.fpe-ver.Bien { border-left-color: #25a35a; background: #f4fbf7; } .fpe-ver.Atención { border-left-color: #e0a100; background: #fffaf0; } .fpe-ver.Alerta { border-left-color: #d6453a; background: #fff6f5; }
.fpe-ver-t { font-size: 17px; line-height: 1.45; color: var(--f-navy); font-weight: 600; margin: 8px 0 0; }
.fpe-ver h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: #52606f; margin: 14px 0 6px; }
.fpe-ver ol { margin: 0; padding-left: 22px; } .fpe-ver li { font-size: 14px; line-height: 1.5; color: #263445; margin-bottom: 6px; }
.fpe-learn { background: #f1f8ff; border: 1px solid #cfe6fb; border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
.fpe-learn summary { cursor: pointer; font-size: 14px; color: var(--f-navy); display: flex; gap: 10px; align-items: center; list-style: none; }
.fpe-learn summary::-webkit-details-marker { display: none; }
.fpe-learn-i { width: 22px; height: 22px; flex: none; color: #0a7fb5; display: inline-flex; } .fpe-learn-i svg { width: 22px; height: 22px; }
.fpe-learn ul { margin: 10px 0 6px; padding-left: 20px; } .fpe-learn li { font-size: 13.5px; line-height: 1.5; color: #263445; margin-bottom: 4px; }
.fpe-learn p { font-size: 13.5px; margin: 6px 0 0; color: #263445; }
.fpe-link { background: none; border: 0; padding: 0; color: #0a6ea8; text-decoration: underline; cursor: pointer; font: inherit; font-size: 12.5px; margin-left: 6px; }
.fpe-empty { background: #fff8e6; border: 1px solid #f1d98a; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; color: #5b4a10; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fpe-quick { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: linear-gradient(135deg, #f1f8ff, #fff); border: 1px solid #cfe6fb; border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; }
.fpe-quick h3 { margin: 0 0 4px; font-size: 16px; } .fpe-quick p { margin: 0; font-size: 13.5px; color: #3b4a5c; max-width: 520px; } .fpe-quick > span { display: flex; gap: 10px; flex-wrap: wrap; }
.fpe-adv { border: 1px dashed #c4d2e3; border-radius: 12px; padding: 10px 14px; margin-top: 14px; }
.fpe-adv summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--f-navy); } .fpe-adv summary small { font-weight: 500; color: #64748b; } .fpe-adv > .fpe-grid { margin-top: 12px; }
.fpe-gprog { height: 6px; background: #e6edf5; border-radius: 6px; overflow: hidden; margin-bottom: 8px; } .fpe-gprog i { display: block; height: 100%; width: 20%; background: var(--f-cyan); transition: width .3s; }
.fpe-gstep { font-size: 12px; color: #64748b; margin: 0 0 14px; }
.fpe-gq h3 { font-size: 20px; margin: 0 0 6px; line-height: 1.3; }
.fpe-glbl { display: block; font-size: 12.5px; font-weight: 700; color: #3b4a5c; margin: 10px 0 4px; }
.fpe-ctl.big input { font-size: 20px; padding: 12px 14px; min-height: 52px; }
.fpe-ctl.big.money input { padding-left: 32px; } .fpe-ctl.big.money::before { left: 14px; font-size: 18px; }
.fpe-gerr { color: var(--f-bad); font-size: 13px; margin: 8px 0 0; font-weight: 600; }
.fpe-gl dt { font-weight: 700; color: var(--f-navy); margin-top: 14px; font-size: 14px; } .fpe-gl dd { margin: 3px 0 0; font-size: 13.5px; color: #263445; line-height: 1.5; }
.fpe-gl dd span { display: block; color: #52606f; font-size: 12.5px; margin-top: 2px; }
#g-q { margin-bottom: 4px; }
@media (max-width: 700px) { .fpe-tw::before { content: 'Desliza para ver más →'; display: block; font-size: 11px; color: #64748b; margin-bottom: 4px; } }

/* el reset del sitio quita las viñetas: se restauran dentro de la herramienta */
.fpe-learn ul, .fpe-mode ul, .fpe-dialog ul, .fpe-sec ul { list-style: disc; }
