/* Campo · bloques de análisis (Ola 2): poder adquisitivo real y efectivo frente a la tasa libre de riesgo.
   Mismo lenguaje que Desempeño: paneles, cifras tabulares, color solo para ganancia/pérdida. */
.real-seg { font-size: 12.5px; }
/* cabecera de "Rendimiento por periodo": título y selector en una línea; la descripción debajo, a todo lo ancho */
.panel-head:has(> .pfd-realseg) { flex-wrap: wrap; align-items: center; row-gap: 6px; }
.pfd-realseg { margin-left: auto; }
.pfd-realseg + .muted { flex-basis: 100%; }
.pfd-cols-an { align-items: start; }

.an-s .gain { color: var(--gain); }
.an-s .loss { color: var(--loss); }
.an-note { margin-top: 12px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }

/* barra apilada: aportado · lo que pide la inflación · crecimiento real */
.an-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--s2); margin: 4px 0 16px; }
.an-bar i { display: block; height: 100%; flex: 0 0 var(--w); min-width: 0; }
.an-b0, .an-k0 { background: color-mix(in oklch, var(--text) 38%, var(--s1)); }
.an-b1, .an-k1 { background: color-mix(in oklch, var(--loss) 55%, var(--s1)); }
.an-b2, .an-k2 { background: var(--accent); }
.an-b2.neg { background: color-mix(in oklch, var(--loss) 80%, var(--s1)); }

.an-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.an-dl3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.an-dl > div { min-width: 0; }
.an-dl dt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.an-dl dt i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.an-dl dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.an-dl span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.an-dl .an-tot { padding-top: 12px; border-top: 1px solid var(--line); grid-column: 1 / -1; }

.an-tw { margin-top: 18px; overflow-x: auto; }
.an-tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.an-tb caption { text-align: left; font-weight: 600; color: var(--text); padding-bottom: 8px; }
.an-tb th, .an-tb td { padding: 9px 6px; text-align: right; border-top: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.an-tb thead th { border-top: 0; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.an-tb th:first-child, .an-tb td:last-child { text-align: left; }
.an-tb th:first-child { padding-left: 0; }
.an-tb td:last-child { padding-right: 0; white-space: normal; color: var(--text-2); min-width: 9em; }
.an-tb tbody th { font-weight: 600; }
.an-tb tbody th span { display: block; font-weight: 400; font-size: 12px; color: var(--text-3); }

@media (max-width: 720px) {
  .an-dl, .an-dl3 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 10 · tu mezcla de hoy, hacia atrás ---------- */
.an-hist .panel-head { flex-wrap: wrap; gap: 10px; }
.an-hy { margin-left: auto; font-size: 12.5px; }
.an-lead { margin: 0 0 14px; }
.an-hbody { min-height: 120px; }
.an-fig { margin: 18px 0 0; }
.an-fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.an-gl { stroke: var(--line); stroke-width: 1; }
.an-gl.z { stroke: color-mix(in oklch, var(--text) 35%, transparent); }
.an-ax { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.an-l1, .an-l2, .an-l3 { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.an-l1, .an-l1k { stroke: var(--accent); background: var(--accent); }
.an-l2, .an-l2k { stroke: color-mix(in oklch, var(--text) 70%, var(--s1)); background: color-mix(in oklch, var(--text) 70%, var(--s1)); }
.an-l3 { stroke: color-mix(in oklch, var(--text) 30%, var(--s1)); stroke-dasharray: 4 4; }
.an-l3k { background: color-mix(in oklch, var(--text) 30%, var(--s1)); }
.an-fig figcaption { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.an-fig figcaption i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.an-hm { margin-top: 18px; overflow-x: auto; }
.an-hmt { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.an-hmt caption { text-align: left; font-weight: 600; font-size: 13.5px; color: var(--text); padding-bottom: 8px; }
.an-hmt th { font-weight: 500; color: var(--text-3); padding: 4px; text-align: center; }
.an-hmt tbody th { text-align: left; color: var(--text-2); font-variant-numeric: tabular-nums; }
.an-hmt td { padding: 6px 4px; text-align: center; border-radius: 4px; color: var(--text); min-width: 3.2em; }
.an-hmt td[data-s="p"] { background: color-mix(in oklch, var(--gain) var(--a), var(--s1)); }
.an-hmt td[data-s="n"] { background: color-mix(in oklch, var(--loss) var(--a), var(--s1)); }
.an-hmt td.e { background: var(--s2); opacity: .5; }
.an-hmt td.an-y { font-weight: 600; background: none; }

/* ---------- 9 · hoja de trabajo fiscal ---------- */
.pff-s .panel-head { flex-wrap: wrap; gap: 10px; }
.pff-y { margin-left: auto; font-size: 12.5px; }
.pff-warn { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--r-md, 10px); background: var(--s2); color: var(--text-2); }
.pff-warn strong { color: var(--text); }
.pff-tlh { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md, 10px); }
.pff-tlh h3 { margin: 0 0 6px; font-size: 15px; }
.pff-tlh p { margin: 0 0 8px; color: var(--text-2); font-size: 13.5px; }
.pff-tlh ul { margin: 0 0 4px; padding-left: 18px; font-size: 13.5px; }
.pff-tlh .loss { color: var(--loss); }
.pff-acts { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.an-tb caption.an-vh { font-weight: 500; color: var(--text-3); font-size: 12.5px; }

/* ---------- 12 · radiografía de riesgo ---------- */
.an-xr h3 { margin: 20px 0 8px; font-size: 14.5px; }
.an-fx td:last-child { min-width: 8em; }
.an-sh { display: inline-block; width: 56px; height: 6px; margin-right: 8px; border-radius: 3px; vertical-align: middle;
  background: linear-gradient(to right, var(--accent) var(--w), var(--s2) var(--w)); }
.an-ccy .an-tb td, .an-ccy .an-tb th { white-space: nowrap; }
.an-ccy .an-tb td:last-child { color: var(--text); min-width: 0; text-align: right; }

/* ---------- 12 · Mercados: fundamentales, estacionalidad y rotación ---------- */
.mkf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--s-4, 16px); margin-top: var(--s-4, 16px); }
.mkf-row:has(> .mkf:not([hidden])) { margin-top: var(--s-4, 16px); }
.mkf-row .mkf[hidden] { display: none; }
.mkf-rot { margin-top: var(--s-4, 16px); }
.mkf .gain { color: var(--gain); } .mkf .loss { color: var(--loss); }
.mkf-t th:first-child { min-width: 9em; }
.mkf-seas { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; }
.mkf-sm { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-3); }
.mkf-bw { position: relative; display: block; width: 100%; height: 84px; border-bottom: 1px solid var(--line); }
.mkf-bw i { position: absolute; left: 18%; right: 18%; bottom: 0; height: var(--h); border-radius: 3px 3px 0 0; background: color-mix(in oklch, var(--gain) 65%, var(--s1)); }
.mkf-bw i.dn { background: color-mix(in oklch, var(--loss) 65%, var(--s1)); }
.mkf-sm b { font-size: 12px; font-weight: 600; }
.mkf-sm.now .mkf-ml { color: var(--text); font-weight: 600; }
.mkf-rs { white-space: nowrap; }
.mkf-rb { position: relative; display: inline-block; width: 70px; height: 6px; margin-right: 8px; vertical-align: middle; background: var(--s2); border-radius: 3px; }
.mkf-rb i { position: absolute; top: 0; bottom: 0; width: var(--w); border-radius: 3px; }
.mkf-rb i.up { left: 50%; background: var(--gain); } .mkf-rb i.dn { right: 50%; background: var(--loss); }
.mkf-ref th, .mkf-ref td { color: var(--text-2); font-weight: 600; }
.an-drip { margin-top: var(--s-4, 16px); }
.an-dA, .an-dAk { fill: color-mix(in oklch, var(--text) 45%, var(--s1)); background: color-mix(in oklch, var(--text) 45%, var(--s1)); }
.an-dB, .an-dBk { fill: var(--accent); background: var(--accent); }
.an-fig figcaption i.an-dAk, .an-fig figcaption i.an-dBk { height: 8px; width: 10px; }

/* ---------- 12 · cliente u hogar y objetivos guardados ---------- */
.tkl-hhs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.tkl-hhc { display: inline-flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md, 10px); font-size: 12.5px; color: var(--text-3); }
.tkl-hhc b { color: var(--text); font-size: 13px; }
.tkl-hhc .tkl-num { color: var(--text); font-weight: 600; font-size: 14px; }
.tkl-hh { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px; background: var(--s2); color: var(--text-2); font-size: 11.5px; }
.prb-save { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.prb-savem { font-size: 12.5px; color: var(--text-3); }

/* ---------- 12 · cliente u hogar y objetivos guardados ---------- */
.tkl-hhs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.tkl-hhc { display: inline-flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md, 10px); font-size: 12.5px; color: var(--text-3); }
.tkl-hhc b { color: var(--text); font-size: 13px; }
.tkl-hhc .tkl-num { color: var(--text); font-weight: 600; font-size: 14px; }
.tkl-hh { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px; background: var(--s2); color: var(--text-2); font-size: 11.5px; }
.prb-save { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.prb-savem { font-size: 12.5px; color: var(--text-3); }
.mkf-pp { white-space: nowrap; }

/* ---------- 11 · importar movimientos ---------- */
.tkl-imp { margin-top: 12px; }
.tkl-imp .tkl-sum b { color: var(--text); }
.tkl-map { margin: 10px 0; font-size: 13px; }
.tkl-map summary { cursor: pointer; color: var(--text-2); }
.tkl-mapg { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.tkl-mapg label { display: flex; flex-direction: column; gap: 4px; color: var(--text-3); font-size: 12px; }
.tkl-mapg select { min-height: 36px; }
.tkl-rt { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.tkl-rt caption { text-align: left; font-weight: 600; padding-bottom: 6px; color: var(--text); }
.tkl-rt th, .tkl-rt td { padding: 6px; border-top: 1px solid var(--line); text-align: left; }
.tkl-rt thead th { border-top: 0; color: var(--text-3); font-weight: 500; font-size: 12px; }
.tkl-rt input { width: 100%; min-height: 34px; padding: 4px 8px; font: inherit; color: var(--text); background: var(--s2); border: 1px solid var(--line); border-radius: var(--r-sm, 6px); text-transform: uppercase; }
.tkl-rt .gain { color: var(--gain); } .tkl-rt .loss { color: var(--loss); }
