/* sec_canon — UI de estados financieros
   Tema claro por defecto, oscuro segun preferencia del sistema. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --side: #10151c;
  --side-fg: #aeb9c7;
  --side-fg-strong: #ffffff;
  --side-hover: #1b2531;
  --side-active: #22303f;
  --fg: #17202b;
  --fg-soft: #66727f;
  --line: #e3e7ec;
  --line-strong: #c9d1da;
  --accent: #2f6df6;
  --accent-soft: #e8effe;
  --neg: #c0392b;
  --derived: #8a6d1f;
  --derived-bg: #fdf6e3;
  --radius: 8px;

  /* Alias. Las vistas nuevas (resumen, valuacion, sectores, acceso) se
     escribieron con estos nombres; sin definirlos, `color: var(--text)` es una
     declaracion INVALIDA que el navegador descarta en silencio. El texto
     heredaba y en tema oscuro pasaba desapercibido, pero en claro quedaba mal.
     Se definen una vez aqui en vez de reescribir cada bloque. */
  --text: var(--fg);
  --muted: var(--fg-soft);
  --border: var(--line);
  --good: #1f8b5c;
  --bad: var(--neg);
  --warn: var(--derived);
  --panel-2: #fbfcfd;
  --input-bg: #ffffff;
  --chart-bg: #fafbfc;
  --row-hover: #f2f5f9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1016;
    --panel: #131922;
    --side: #090d12;
    --fg: #e6ebf1;
    --fg-soft: #8b97a5;
    --line: #222b36;
    --line-strong: #33404f;
    --accent: #5b8cff;
    --accent-soft: #17233b;
    --neg: #ff6b5b;
    --derived: #d8b44a;
    --derived-bg: #241f10;

    --good: #4ea87a;
    --panel-2: #171e28;
    --input-bg: #0e141c;
    --chart-bg: #0f151d;
    --row-hover: #1a2230;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- sidebar ---------------- */
.sidebar {
  width: 268px;
  flex: 0 0 268px;
  background: var(--side);
  color: var(--side-fg);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 4px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #7aa2ff);
  color: #fff; font-weight: 700; font-size: 13px;
  display: grid; place-items: center; letter-spacing: .3px;
}
.brand-name { color: var(--side-fg-strong); font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--side-fg); opacity: .75; }

.side-block { display: flex; flex-direction: column; gap: 8px; }
.side-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--side-fg); opacity: .65; padding: 0 4px; font-weight: 600;
}

/* combobox: el input filtra Y hace de desplegable (foco sin texto = lista
   completa). Una sola entrada cubre "escribir el ticker" y "elegir de una
   lista" sin duplicar el control. */
.combo { position: relative; }
.search {
  background: #0d131b; border: 1px solid #212c39; color: var(--side-fg-strong);
  border-radius: var(--radius); padding: 8px 30px 8px 10px; font-size: 13px; width: 100%;
}
.search:focus { outline: none; border-color: var(--accent); }
.search::placeholder { color: #55637a; }

.combo-clear {
  position: absolute; right: 6px; top: 6px; width: 22px; height: 22px;
  background: none; border: 0; color: var(--side-fg); font-size: 16px;
  cursor: pointer; border-radius: 5px; line-height: 1; display: none;
}
.combo-clear:hover { background: var(--side-hover); color: var(--side-fg-strong); }
.combo.has-text .combo-clear { display: block; }

.company-list.dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  background: #0d131b; border: 1px solid #212c39; border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
  list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto;
  display: none;
}
.combo.open .company-list.dropdown { display: block; }
.company-list li {
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.company-list li:hover { background: var(--side-hover); }
.company-list li.active { background: var(--side-active); color: var(--side-fg-strong); }
.company-list .tk { font-weight: 600; font-size: 13px; flex: 0 0 auto; }
.company-list .nm {
  font-size: 11px; opacity: .6; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1 1 auto; text-align: left;
}
.company-list .yr { font-size: 10.5px; opacity: .55; font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* ---------------- menu de navegacion: grupos colapsables ---------------- */
.stmt-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { display: flex; flex-direction: column; }
.nav-group-header {
  width: 100%; display: flex; align-items: center; gap: 9px;
  background: none; border: 0; color: var(--side-fg-strong); cursor: pointer;
  padding: 9px 8px; border-radius: 6px; font-size: 12px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .07em; font-family: inherit;
}
.nav-group-header:hover { background: var(--side-hover); }
.nav-group-header .nav-icon { font-size: 14px; }
.nav-group-header .chevron {
  margin-left: auto; font-size: 10px; opacity: .55; transition: transform .15s ease;
}
.nav-group.open .nav-group-header .chevron { transform: rotate(90deg); }
.nav-group-body {
  display: flex; flex-direction: column; gap: 2px; padding: 2px 0 8px 6px;
}
.nav-group:not(.open) .nav-group-body { display: none; }
.nav-group-body button {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: none; border: 0; color: var(--side-fg);
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px;
  font-family: inherit;
}
.nav-group-body button .nav-icon { font-size: 14.5px; width: 18px; text-align: center; }
.nav-group-body button:hover { background: var(--side-hover); }
.nav-group-body button.active { background: var(--accent); color: #fff; font-weight: 600; }

.seg { display: flex; background: #0d131b; border: 1px solid #212c39; border-radius: 7px; padding: 2px; }
.seg button {
  flex: 1; background: none; border: 0; color: var(--side-fg); cursor: pointer;
  padding: 6px 8px; border-radius: 5px; font-size: 12.5px; font-family: inherit;
}
.seg button.active { background: var(--side-active); color: var(--side-fg-strong); font-weight: 600; }

.side-foot { margin-top: auto; padding: 0 4px; }
.muted { font-size: 10.5px; color: var(--side-fg); opacity: .5; word-break: break-all; }

/* ---------------- main ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; padding: 20px 28px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.subtitle { font-size: 12.5px; color: var(--fg-soft); margin-top: 3px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right .seg { background: var(--bg); border-color: var(--line); }
.topbar-right .seg button { color: var(--fg-soft); }
.topbar-right .seg button.active { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.legend { font-size: 11.5px; color: var(--fg-soft); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-rep { background: var(--accent); }
.dot-der { background: var(--derived); margin-left: 6px; }

.content { padding: 22px 28px 60px; overflow-x: auto; }
.empty { color: var(--fg-soft); padding: 60px 0; text-align: center; }

/* ---------------- tabla ---------------- */
.stmt-table {
  width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.stmt-table th, .stmt-table td { padding: 7px 14px; text-align: right; white-space: nowrap; }
.stmt-table th:first-child, .stmt-table td:first-child {
  text-align: left; width: 42%; min-width: 240px; white-space: normal;
}
.stmt-table thead th {
  position: sticky; top: 0; background: var(--panel); z-index: 2;
  border-bottom: 1.5px solid var(--line-strong);
  font-size: 11.5px; font-weight: 600; color: var(--fg-soft);
  text-transform: uppercase; letter-spacing: .05em; padding-top: 12px; padding-bottom: 10px;
}
.sec-row td {
  background: var(--bg); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--fg-soft);
  padding-top: 11px; padding-bottom: 6px; border-top: 1px solid var(--line);
}
.stmt-table tbody tr:hover td { background: var(--accent-soft); }
.stmt-table tbody tr.sec-row:hover td { background: var(--bg); }
.row-sub td {
  font-weight: 650; border-top: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
/* componente de un subtotal que tambien se muestra: se indenta para que no
   se lea como una linea sumable al mismo nivel que su total */
.row-child td:first-child {
  padding-left: 32px; position: relative; color: var(--fg-soft);
}
.row-child td:first-child::before {
  content: ""; position: absolute; left: 18px; top: 12px;
  width: 7px; height: 1px; background: var(--line-strong);
}

.neg { color: var(--neg); }
.nil { color: var(--fg-soft); opacity: .45; }
.suf { color: var(--fg-soft); font-size: 11px; margin-left: 1px; }

.note {
  background: var(--derived-bg); color: var(--derived);
  border: 1px solid color-mix(in srgb, var(--derived) 28%, transparent);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px;
  font-size: 12.5px; line-height: 1.5;
}
.note b { font-weight: 650; }

.val-derived {
  background: var(--derived-bg); color: var(--derived);
  border-radius: 4px; padding: 2px 6px; margin: -2px -6px; cursor: help;
}
.code-hint { display: block; font-size: 10.5px; color: var(--fg-soft); opacity: .8; }

/* fila con datos: se puede pasar el mouse para ver la serie completa */
.stmt-table tbody tr[data-code] { cursor: crosshair; }

/* ---------------- popup de grafico de linea (hover sobre una fila) ---------------- */
.chart-pop {
  position: fixed; z-index: 300; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.22);
  padding: 12px 15px 11px; width: 340px; max-width: calc(100vw - 20px);
  opacity: 0; transform: translateY(4px);
  transition: opacity .1s ease, transform .1s ease;
  font-size: 12px; visibility: hidden;
}
.chart-pop.visible { opacity: 1; transform: translateY(0); visibility: visible; }
.chart-pop .cp-title { font-weight: 650; font-size: 12.5px; color: var(--fg); }
.chart-pop .cp-sub { color: var(--fg-soft); font-size: 10.5px; margin-top: 1px; margin-bottom: 8px; }
.chart-pop .cp-loading, .chart-pop .cp-error {
  color: var(--fg-soft); padding: 22px 0; text-align: center; font-size: 12px;
}
.chart-pop svg { display: block; overflow: visible; }
.chart-pop .cp-axis { fill: var(--fg-soft); font-size: 9px; font-variant-numeric: tabular-nums; }
.chart-pop .cp-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.chart-pop .cp-area { fill: var(--accent); opacity: .08; }
.chart-pop .cp-dot-last { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }
.chart-pop .cp-zero { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 2; }
.chart-pop .cp-foot {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 10.5px; color: var(--fg-soft);
}
.chart-pop .cp-last { font-weight: 700; color: var(--fg); font-size: 13px; }
.chart-pop .cp-last.neg { color: var(--neg); }
.chart-pop .cp-note {
  margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line);
  font-size: 10px; color: var(--derived); line-height: 1.4;
}

@media (max-width: 860px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .company-list.dropdown { max-height: 45vh; }
}

/* ============================================================
   ANALISIS DUPONT
   ============================================================ */
.dp-block {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
}
.dp-block .stmt-table { border: 0; margin-top: 4px; }
.dp-h {
  font-size: 13px; font-weight: 650; color: var(--fg);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.dp-h-sub { font-size: 11px; font-weight: 400; color: var(--fg-soft); }
.dp-none, .dp-foot {
  font-size: 11.5px; color: var(--fg-soft); line-height: 1.5;
}
.dp-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-warn {
  margin-top: 10px; background: var(--derived-bg); color: var(--derived);
  border: 1px solid color-mix(in srgb, var(--derived) 28%, transparent);
  border-radius: 6px; padding: 8px 11px; font-size: 11.5px; line-height: 1.45;
}

/* punto de lectura del factor: verde sano, ambar riesgo, gris neutro */
.dp-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 7px; vertical-align: middle;
}
.dp-good { background: #17a673; }
.dp-risk { background: var(--derived); }
.dp-neutral { background: var(--fg-soft); opacity: .5; }

.dp-identity {
  font-size: 11.5px; color: var(--fg-soft); margin: -6px 0 16px;
  padding: 8px 12px; background: var(--bg); border-radius: 6px;
  border-left: 3px solid #17a673;
}
.dp-identity.bad { border-left-color: var(--neg); color: var(--neg); }
.dp-approx {
  display: block; margin-top: 4px; color: var(--derived); font-size: 10.5px;
}

/* atribucion: barras divergentes desde el centro */
.dp-delta { font-size: 12px; color: var(--fg-soft); margin-bottom: 12px; line-height: 1.5; }
.dp-bars { display: flex; flex-direction: column; gap: 7px; }
.dp-bar-row { display: grid; grid-template-columns: 190px 1fr 150px; align-items: center; gap: 12px; }
.dp-bar-lbl { font-size: 12px; }
.dp-bar-track { position: relative; height: 16px; background: var(--bg); border-radius: 4px; }
.dp-bar-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.dp-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.dp-bar.pos { left: 50%; background: #17a673; }
.dp-bar.neg { right: 50%; background: var(--neg); }
.dp-bar-val { font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dp-bar-val.neg { color: var(--neg); }
.dp-bar-share { color: var(--fg-soft); font-weight: 400; font-size: 10.5px; margin-left: 5px; }

/* separacion operativo / apalancamiento */
.dp-split-bar {
  height: 26px; border-radius: 6px; overflow: hidden;
  background: var(--derived); position: relative;
}
.dp-split-op { height: 100%; background: #17a673; }
.dp-split-legend {
  display: flex; gap: 22px; margin-top: 9px; font-size: 12px; flex-wrap: wrap;
  color: var(--fg-soft);
}
.dp-split-legend .sw {
  display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px;
}
.dp-split-legend .sw.op { background: #17a673; }
.dp-split-legend .sw.lev { background: var(--derived); }
.dp-split-legend b { color: var(--fg); }

/* ---------------- score ---------------- */
.sc-top { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.sc-badge {
  flex: 0 0 118px; border-radius: 10px; padding: 14px 10px; text-align: center;
  border: 1.5px solid var(--line-strong); background: var(--bg);
}
.sc-num { font-size: 30px; font-weight: 700; line-height: 1; }
.sc-grade { font-size: 11px; margin-top: 5px; color: var(--fg-soft); font-weight: 600; }
.grade-A { border-color: #17a673; color: #17a673; }
.grade-B { border-color: #4a9d5f; color: #4a9d5f; }
.grade-C { border-color: var(--derived); color: var(--derived); }
.grade-D { border-color: #d98324; color: #d98324; }
.grade-E { border-color: var(--neg); color: var(--neg); }
.sc-badge.grade-A .sc-num, .sc-badge.grade-B .sc-num,
.sc-badge.grade-C .sc-num, .sc-badge.grade-D .sc-num,
.sc-badge.grade-E .sc-num { color: inherit; }

.sc-parts { flex: 1 1 380px; display: flex; flex-direction: column; gap: 6px; }
.sc-row { display: grid; grid-template-columns: 230px 1fr 34px; align-items: center; gap: 11px; }
.sc-lbl { font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.sc-w { color: var(--fg-soft); font-size: 10.5px; }
.sc-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.sc-fill { height: 100%; border-radius: 4px; }
.sc-fill.g0 { background: var(--neg); }
.sc-fill.g1 { background: #d98324; }
.sc-fill.g2 { background: var(--derived); }
.sc-fill.g3 { background: #4a9d5f; }
.sc-fill.g4 { background: #17a673; }
.sc-val { font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================
   RANKING
   ============================================================ */
.rk-bar {
  display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.rk-bar .seg { background: var(--panel); border-color: var(--line); }
.rk-bar .seg button { color: var(--fg-soft); }
.rk-bar .seg button.active { background: var(--bg); color: var(--fg); font-weight: 600; }
.rk-hint { font-size: 11px; color: var(--fg-soft); }
.rk-table td, .rk-table th { padding: 6px 10px; }
.rk-table th:first-child, .rk-table td:first-child { width: 46px; min-width: 0; text-align: right; }
.rk-table tbody tr { cursor: pointer; }
.rk-pos { color: var(--fg-soft); font-variant-numeric: tabular-nums; }
.rk-tk { font-weight: 650; text-align: left !important; }
.rk-table th:nth-child(2), .rk-table td:nth-child(2) { text-align: left; }
.rk-grade {
  display: inline-block; width: 19px; height: 19px; line-height: 18px;
  border-radius: 5px; border: 1.5px solid; font-size: 11px; font-weight: 700;
  text-align: center; margin-right: 7px;
}
.rk-score { font-variant-numeric: tabular-nums; }
.rk-part { color: var(--fg-soft); font-size: 12px; }
.rk-me td { background: var(--accent-soft) !important; }

/* ============================================================
   CELDAS COMPLETADAS — cinco niveles de confianza
   ============================================================
   La intensidad de la marca es INVERSA a la confianza: un despeje por
   identidad es exacto y casi no se destaca; un arrastre es la conjetura mas
   debil y lleva la marca mas visible. Asi el ojo va primero a lo que hay
   que mirar con reserva. */
:root {
  --est-solved:  #2f6df6;   --est-solved-bg:  #eaf1fe;
  --est-zero:    #7b8794;   --est-zero-bg:    transparent;
  --est-interp:  #6b46c1;   --est-interp-bg:  #f3eefc;
  --est-carried: #b45309;   --est-carried-bg: #fdf1e0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --est-solved:  #7aa2ff;  --est-solved-bg:  #16233c;
    --est-zero:    #8b97a5;  --est-zero-bg:    transparent;
    --est-interp:  #b794f6;  --est-interp-bg:  #241a35;
    --est-carried: #f0a35e;  --est-carried-bg: #2e2113;
  }
}

.est { border-radius: 4px; padding: 2px 6px; margin: -2px -6px; cursor: help; }
.est-solved      { background: var(--est-solved-bg);  color: var(--est-solved); }
.est-zero_event,
.est-zero_pre    { color: var(--est-zero); opacity: .7;
                   border-bottom: 1px dotted var(--line-strong); }
.est-interpolated{ background: var(--est-interp-bg);  color: var(--est-interp);
                   border-bottom: 1px dashed var(--est-interp); border-radius: 4px 4px 0 0; }
.est-carried     { background: var(--est-carried-bg); color: var(--est-carried);
                   border-bottom: 2px dotted var(--est-carried); border-radius: 4px 4px 0 0; }

.est-note {
  margin-top: 14px; padding: 12px 15px; background: var(--panel);
  border: 1px solid var(--line); border-left: 3px solid var(--est-interp);
  border-radius: var(--radius); font-size: 11.5px; color: var(--fg-soft);
  line-height: 1.55;
}
.est-legend {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 7px;
  font-weight: 600; color: var(--fg); font-size: 11px;
}
.est-legend .sw {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: -1px;
}
.est-legend .sw.est-solved      { background: var(--est-solved-bg); border: 1px solid var(--est-solved); }
.est-legend .sw.est-zero_event,
.est-legend .sw.est-zero_pre    { background: var(--bg); border: 1px dotted var(--line-strong); }
.est-legend .sw.est-interpolated{ background: var(--est-interp-bg); border: 1px dashed var(--est-interp); }
.est-legend .sw.est-carried     { background: var(--est-carried-bg); border: 2px dotted var(--est-carried); }

.chart-pop .cp-est { color: var(--interp); font-weight: 600; }

/* ---------------- ciclo de conversion de efectivo ---------------- */
.cc-head { display: flex; flex-wrap: wrap; gap: 26px; align-items: flex-start; }
.cc-big { flex: 0 0 auto; text-align: center; padding: 4px 20px 4px 0;
          border-right: 1px solid var(--line); }
.cc-num { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.cc-big.good .cc-num { color: #17a673; }
.cc-cap { font-size: 10.5px; color: var(--fg-soft); margin-top: 6px;
          text-transform: uppercase; letter-spacing: .07em; }
.cc-facts { flex: 1 1 340px; display: grid;
            grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 22px; }
.cc-facts div { display: flex; flex-direction: column; gap: 2px; }
.cc-facts span { font-size: 10.5px; color: var(--fg-soft);
                 text-transform: uppercase; letter-spacing: .06em; }
.cc-facts b { font-size: 15px; font-weight: 650; }
.cc-note-good {
  flex: 1 1 100%; margin-top: 4px; padding: 9px 12px; font-size: 11.5px;
  background: color-mix(in srgb, #17a673 10%, transparent);
  border: 1px solid color-mix(in srgb, #17a673 30%, transparent);
  border-radius: 6px; color: #17a673; line-height: 1.45;
}
.cc-fromto { display: block; font-size: 10.5px; color: var(--fg-soft); }
.cc-owc td { border-top: 1px solid var(--line-strong); color: var(--fg-soft); font-size: 12.5px; }

/* barras del ciclo: la direccion sigue el SIGNO, el color indica si conviene */
.cc-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.cc-right { left: 50%; }
.cc-left  { right: 50%; }
.cc-bad   { background: var(--neg); }
.cc-good  { background: #17a673; }

/* ratio no definido para el ejercicio: distinto de un dato faltante */
.val-nm { color: var(--fg-soft); opacity: .55; font-size: 11.5px; cursor: help;
          font-style: italic; }
/* ratio calculado sobre al menos un valor completado */
.est-ratio { background: var(--est-interp-bg); color: var(--est-interp);
             border-bottom: 1px dashed var(--est-interp);
             border-radius: 4px 4px 0 0; }

/* ---------------- Company Score ---------------- */
/* El area de graficado lleva fondo PROPIO: en tema oscuro las bandas tenues
   sobre el panel oscuro se fundian en una mancha negra, y un <rect> sin fill
   resuelto cae a negro por defecto. */
.cs-svg { display: block; }
.cs-plot { fill: var(--bg); }
.cs-band-A { fill: #17a673; }
.cs-band-B { fill: #4a9d5f; }
.cs-band-C { fill: var(--derived); }
.cs-band-D { fill: #d98324; }
.cs-band-E { fill: var(--neg); }
.cs-band { opacity: .12; }
.cs-rule { stroke: var(--line); stroke-width: 1; }
.cs-band-lbl { fill: var(--fg-soft); font-size: 9.5px; text-anchor: end; font-weight: 600; }
.cs-x { fill: var(--fg-soft); font-size: 9px; text-anchor: middle; }
.cs-area { fill: var(--accent); opacity: .14; }
.cs-line { fill: none; stroke: var(--accent); stroke-width: 2.4;
           stroke-linejoin: round; stroke-linecap: round; }
.cs-dot { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }
.cs-last { fill: var(--accent); font-size: 11px; font-weight: 700; text-anchor: end; }

@media (prefers-color-scheme: dark) {
  /* sobre fondo oscuro hace falta mas opacidad para que la banda se lea */
  .cs-band { opacity: .22; }
  .cs-area { opacity: .20; }
}

.cs-table td, .cs-table th { padding: 6px 12px; }
.cs-table td:first-child { width: 38%; }
.cs-actual { font-weight: 600; }
.cs-met { color: #17a673; }
.cs-in {
  width: 68px; text-align: right; font-family: inherit; font-size: 12px;
  padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 5px;
  background: var(--bg); color: var(--fg); font-variant-numeric: tabular-nums;
}
.cs-in:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.cs-pin { width: 46px; }
.cs-pw { font-weight: 400; text-transform: none; letter-spacing: 0;
         color: var(--fg-soft); margin-left: 10px; font-size: 11px; }
.cs-pscore { float: right; font-weight: 700; color: var(--fg); }
.cs-pts { width: 130px; }
.cs-mini { display: inline-block; width: 62px; height: 6px; background: var(--bg);
           border-radius: 3px; overflow: hidden; margin-right: 7px; vertical-align: middle; }
.cs-mini-fill { height: 100%; border-radius: 3px; }
.cs-mini-fill.g0 { background: var(--neg); }
.cs-mini-fill.g1 { background: #d98324; }
.cs-mini-fill.g2 { background: var(--derived); }
.cs-mini-fill.g3 { background: #4a9d5f; }
.cs-mini-fill.g4 { background: #17a673; }
.cs-reset {
  margin-left: auto; font-family: inherit; font-size: 11px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--fg-soft);
  border-radius: 5px; padding: 4px 10px;
}
.cs-reset:disabled { opacity: .4; cursor: default; }
.cs-reset:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- DCF / Intrinsic Value ---------------- */
.dcf-hero { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.dcf-big { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.dcf-big.dcf-mkt { color: var(--fg-soft); }
.dcf-big.good { color: #17a673; }
.dcf-big.bad { color: var(--neg); }
.dcf-cap { font-size: 10.5px; color: var(--fg-soft); margin-top: 6px;
           text-transform: uppercase; letter-spacing: .07em; }
.dcf-vs { color: var(--fg-soft); font-size: 12px; }
.dcf-mos { margin-left: auto; text-align: right; padding-left: 22px;
           border-left: 1px solid var(--line); }
.dcf-mos-num { font-size: 30px; font-weight: 700; line-height: 1; }
.dcf-mos.good .dcf-mos-num { color: #17a673; }
.dcf-mos.bad .dcf-mos-num { color: var(--neg); }
.dcf-verdict { margin-top: 6px; font-size: 11px; font-weight: 700;
               text-transform: uppercase; letter-spacing: .06em; }
.dcf-verdict.good { color: #17a673; }
.dcf-verdict.bad { color: var(--neg); }
.dcf-noprice .dcf-ask { margin-left: auto; max-width: 380px; font-size: 12px;
                        color: var(--fg-soft); line-height: 1.5; }
.dcf-rev { display: flex; gap: 40px; flex-wrap: wrap; }

.dcf-bridge td:last-child { font-variant-numeric: tabular-nums; }
.dcf-final td { font-size: 15px; border-top: 2px solid var(--line-strong); }
.dcf-sens td { text-align: right; }
.dcf-up { color: #17a673; font-weight: 600; }
.dcf-down { color: var(--neg); }

.dcf-in { width: 92px; text-align: right; font-family: inherit; font-size: 12px;
          padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 5px;
          background: var(--bg); color: var(--fg); font-variant-numeric: tabular-nums; }
.dcf-in:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.dcf-unit { color: var(--fg-soft); font-size: 11px; margin-left: 5px; }
.dcf-price-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
                 padding: 11px 13px; margin-bottom: 12px; border-radius: var(--radius);
                 background: var(--accent-soft); border: 1px solid var(--accent); }
.dcf-price-row label { font-size: 12.5px; font-weight: 650; }
.dcf-price { width: 110px; font-size: 14px; }
.dcf-price-note { font-size: 11px; color: var(--fg-soft); flex: 1 1 260px; line-height: 1.45; }
.dcf-src { font-size: 10px; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.dcf-src-derived { background: color-mix(in srgb, #17a673 16%, transparent); color: #17a673; }
.dcf-src-market { background: var(--derived-bg); color: var(--derived); }
.dcf-src-user { background: var(--accent-soft); color: var(--accent); }
.dcf-wacc { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line);
            font-size: 12px; color: var(--fg-soft); }
.dcf-wacc b { color: var(--fg); }

/* ===== Valuacion: precio de mercado y metodos alternativos ===== */
/* El precio va arriba de todo y con su hora: es el unico dato de la pantalla
   que cambia solo, y una valuacion contra un precio viejo no dice nada. */
.val-price {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px; margin-bottom: 14px;
}
.val-price-main { display: flex; align-items: baseline; gap: 10px; }
.val-price-num { font-size: 26px; font-weight: 650; color: var(--text); }
.val-price-cap {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}
.val-price-meta { font-size: 12px; color: var(--muted); flex: 1; }
.val-price button { margin-left: auto; }

.val-intro {
  color: var(--muted); font-size: 13.5px; line-height: 1.6;
  margin-bottom: 14px; max-width: 90ch;
}
.val-in {
  width: 92px; text-align: right; padding: 4px 7px;
  background: var(--input-bg, rgba(255,255,255,.04));
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums;
}
.val-in:focus { outline: none; border-color: var(--accent); }

/* ===== Grafico de lineas reutilizable ===== */
.lc-svg { display: block; width: 100%; margin: 6px 0 2px; }
/* relleno EXPLICITO: un <rect> sin fill resuelto cae a negro */
.lc-plot { fill: var(--chart-bg, rgba(255,255,255,.03)); }
.lc-rule { stroke: var(--border); stroke-width: 1; opacity: .5; }
.lc-zero { stroke: var(--muted); stroke-width: 1.2; opacity: .8; }
.lc-mark { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.lc-mark-lbl { fill: var(--muted); font-size: 10px; }
.lc-y, .lc-x { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.lc-y { text-anchor: end; }
.lc-x { text-anchor: middle; }
.lc-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.lc-dash { stroke-dasharray: 6 4; }
.lc-area { opacity: .13; stroke: none; }
.lc-dot { stroke: none; }
/* La linea y el punto NO pueden compartir regla: el punto necesita `fill` y
   la linea necesita `fill: none`. Al combinarlos, `.lc-line.lc-c0` ganaba por
   especificidad al `.lc-line { fill: none }` de arriba y TODAS las series se
   dibujaban rellenas hasta la base, como si fueran areas. */
.lc-line.lc-c0 { stroke: var(--accent); fill: none; }
.lc-dot.lc-c0 { fill: var(--accent); stroke: none; }
.lc-area.lc-c0 { fill: var(--accent); stroke: none; }
.lc-line.lc-c1 { stroke: var(--derived); fill: none; }
.lc-dot.lc-c1 { fill: var(--derived); stroke: none; }
.lc-area.lc-c1 { fill: var(--derived); stroke: none; }
.lc-line.lc-c2 { stroke: #7d5bd6; fill: none; }
.lc-dot.lc-c2 { fill: #7d5bd6; stroke: none; }
.lc-area.lc-c2 { fill: #7d5bd6; stroke: none; }
.lc-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.lc-key { display: inline-flex; align-items: center; gap: 6px; }
.lc-key i { width: 16px; height: 2.5px; border-radius: 2px; display: inline-block; }
.lc-key i.lc-c0 { background: var(--accent); }
.lc-key i.lc-c1 { background: var(--derived); }
.lc-key i.lc-c2 { background: #7d5bd6; }
.lc-key i.lc-dash-key {
  background: repeating-linear-gradient(90deg,
    var(--fg-soft) 0 5px, transparent 5px 9px);
}
/* celda base de la matriz: el valor que la pantalla muestra arriba */
.sens-base { outline: 1px solid var(--accent); font-weight: 650; }

/* ===== Resumen de empresa ===== */
.ov-head { display: flex; justify-content: space-between; align-items: flex-start; }
.ov-name { font-size: 22px; font-weight: 650; color: var(--text); }
.ov-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.ov-scales {
  display: flex; gap: 28px; flex-wrap: wrap;
  margin: 16px 0 4px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.ov-scale-v { font-size: 19px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ov-scale-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 2px; }
.ov-facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 12px; }
.ov-fact { font-size: 12.5px; color: var(--muted); }
.ov-fact b { color: var(--text); font-weight: 550; margin-left: 6px; }

/* cajas de valuacion: una por metodo, mas el precio de mercado */
.ov-boxes { display: flex; gap: 12px; flex-wrap: wrap; }
.ov-box {
  flex: 1 1 120px; min-width: 120px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2, rgba(255,255,255,.02)); cursor: pointer;
  transition: border-color .12s ease, transform .12s ease;
}
.ov-box:hover { border-color: var(--accent); transform: translateY(-1px); }
.ov-box-price { cursor: default; border-style: dashed; }
.ov-box-price:hover { border-color: var(--border); transform: none; }
.ov-box-none { cursor: default; opacity: .55; }
.ov-box-none:hover { border-color: var(--border); transform: none; }
.ov-box-m { font-size: 10px; letter-spacing: .07em; color: var(--muted); text-transform: uppercase; }
.ov-box-v { font-size: 20px; font-weight: 650; color: var(--text); margin: 5px 0 3px; font-variant-numeric: tabular-nums; }
.ov-box-s { font-size: 11.5px; color: var(--muted); }
.ov-box-s.good { color: var(--good, #4ea87a); }
.ov-box-s.bad { color: var(--bad, #d1665f); }

/* metricas: rejilla de grupos que se reordena sola segun el ancho */
.ov-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px 26px; }
.ov-metric-h {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 6px; padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}
.ov-metric-table td, .ov-metric-table th { padding: 5px 4px; font-size: 12.5px; }
.ov-metric-table th { font-size: 10px; color: var(--muted); font-weight: 500; }
.ov-metric-table td:first-child { color: var(--muted); }
.ov-v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 550; }
.ov-v.up { color: var(--good, #4ea87a); }
.ov-v.down { color: var(--bad, #d1665f); }
.ov-med { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }

/* ===== Analisis sectorial ===== */
.sec-table th, .sec-table td { font-size: 12.5px; white-space: nowrap; }
.sec-table td:not(:first-child), .sec-table th:not(:first-child) { text-align: right; }
.sec-row { cursor: pointer; }
.sec-row:hover { background: var(--row-hover, rgba(255,255,255,.04)); }
.sec-name { font-weight: 550; color: var(--text); }
/* el detalle nace plegado: la tabla de arriba responde "que sector" y solo
   si el usuario pregunta se abre el "cual dentro del sector" */
.sec-detail { display: none; }
.sec-detail.on {
  display: block; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px; margin-top: 14px;
}
.sec-detail-h { font-weight: 600; color: var(--text); margin-bottom: 10px; }
.sec-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.sec-list-h {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 7px;
}
.sec-tks { display: flex; flex-wrap: wrap; gap: 7px; }
.sec-tk {
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 7px;
  background: transparent; color: var(--text); cursor: pointer;
  font-size: 12.5px; font-weight: 550;
}
.sec-tk:hover { border-color: var(--accent); }
.sec-tk span { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ===== Pantalla de acceso ===== */
body.locked { overflow: hidden; }
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 30px; overflow-y: auto;
  /* La foto se sirve tal cual, encuadrada al centro. El color de debajo solo
     se ve el instante que tarda en cargar y en el borde de relaciones de
     aspecto raras; se eligio oscuro para que ese parpadeo no deslumbre. */
  background: #0b1a2e url("/static/login-bg.webp") center / cover no-repeat;
}
/* `display:flex` en una clase gana por especificidad al `display:none` que el
   navegador aplica a [hidden]: sin esto la puerta seguia interceptando clicks
   estando "oculta". */
.gate[hidden], .gate-form[hidden], .whoami[hidden] { display: none; }

.gate-shell {
  display: grid; grid-template-columns: 1.15fr 1fr;
  width: 100%; max-width: 1040px;
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(4, 12, 24, .45);
}

/* --- columna de producto --- */
.gate-pitch {
  /* Translucida sobre el fondo, no opaca: asi la imagen se ve DEBAJO del
     texto y la pantalla se lee como una sola pieza. El desenfoque mantiene
     legible el texto aunque el fondo tenga detalle. */
  background: linear-gradient(135deg, rgba(9,20,36,.90), rgba(12,32,58,.82));
  backdrop-filter: blur(3px);
  color: #c6d6e8; padding: 52px 46px; display: flex; flex-direction: column;
}
.gate-eyebrow {
  font-size: 11px; font-weight: 650; letter-spacing: .16em;
  text-transform: uppercase; color: #7fb3ea; margin-bottom: 18px;
}
.gate-pitch h2 {
  margin: 0 0 16px; color: #fff; font-size: 30px; line-height: 1.24;
  font-weight: 640; letter-spacing: -.022em;
}
.gate-lede { margin: 0 0 34px; font-size: 14px; line-height: 1.68; color: #b3c6da; }
.gate-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; margin: 0;
  padding-top: 26px; border-top: 1px solid rgba(255,255,255,.13);
}
.gate-stats div { margin: 0; }
.gate-stats dt {
  font-size: 27px; font-weight: 660; color: #fff; line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.gate-stats dd {
  margin: 4px 0 0; font-size: 11px; line-height: 1.4;
  text-transform: uppercase; letter-spacing: .07em; color: #8ba6c2;
}
.gate-foot {
  margin: 32px 0 0; font-size: 11.5px; line-height: 1.65; color: #7f95ad;
}

/* --- columna del formulario --- */
.gate-panel {
  background: var(--panel); padding: 46px 44px 38px;
  display: flex; flex-direction: column;
}
.gate-brand {
  font-size: 17px; font-weight: 660; color: var(--fg);
  letter-spacing: -.015em; margin-bottom: 34px;
}
.gate-brand span { color: var(--fg-soft); font-weight: 500; }

.gate-form { display: flex; flex-direction: column; gap: 15px; }
.gate-h { margin: 0; font-size: 21px; font-weight: 640; color: var(--fg); letter-spacing: -.015em; }
.gate-sub { margin: -9px 0 4px; font-size: 13px; color: var(--fg-soft); }

.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld-l { font-size: 12px; font-weight: 550; color: var(--fg); }
.fld input {
  width: 100%; box-sizing: border-box;
  padding: 11px 12px; font-size: 14px; font-family: inherit;
  background: var(--input-bg); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 9px;
  transition: border-color .12s, box-shadow .12s;
}
.fld input::placeholder { color: var(--fg-soft); opacity: .6; }
.fld input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.fld-pw { position: relative; display: block; }
.fld-pw input { padding-right: 62px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  padding: 5px 9px; font-size: 11.5px; font-weight: 550;
  background: transparent; border: none; border-radius: 5px;
  color: var(--fg-soft); cursor: pointer; font-family: inherit;
}
.pw-eye:hover { color: var(--fg); background: var(--bg); }

.gate-go {
  margin-top: 8px; padding: 12px 0; font-size: 14px; font-weight: 600;
  background: var(--accent); color: #fff; border: none; border-radius: 9px;
  cursor: pointer; transition: filter .12s;
}
.gate-go:hover { filter: brightness(1.08); }
.gate-go:disabled { opacity: .55; cursor: default; }
.gate-err {
  font-size: 12.5px; line-height: 1.5; color: var(--neg);
  background: color-mix(in srgb, var(--neg) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--neg) 32%, transparent);
  border-radius: 8px; padding: 9px 12px;
}

/* separador con etiqueta: marca que abajo empieza otra accion, no un campo */
.gate-divider {
  display: flex; align-items: center; gap: 12px; margin: 26px 0 16px;
  color: var(--fg-soft); font-size: 12px;
}
.gate-divider::before, .gate-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.gate-create {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 0; font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--fg); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 9px;
  transition: border-color .12s, color .12s, background .12s;
}
.gate-create:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.gate-legal {
  margin: auto 0 0; padding-top: 24px;
  font-size: 11px; line-height: 1.6; color: var(--fg-soft);
}

/* en pantallas estrechas la columna de producto estorba mas de lo que aporta */
@media (max-width: 880px) {
  .gate { padding: 0; }
  .gate-shell { grid-template-columns: 1fr; max-width: 460px; border-radius: 14px; }
  .gate-pitch { display: none; }
  .gate-panel { padding: 34px 26px 28px; }
}

/* usuario en el pie de la barra lateral */
.whoami { margin-bottom: 10px; }
.who-name { font-size: 12.5px; color: var(--text); font-weight: 550; }
.who-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.who-tier {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 5px;
}
.who-tier.is-free { color: var(--muted); border: 1px solid var(--border); }
.who-tier.is-premium { color: #d9a441; border: 1px solid rgba(217,164,65,.45); }
.who-out {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 11.5px; text-decoration: underline;
}
.who-out:hover { color: var(--text); }

/* aviso de nivel sobre los supuestos bloqueados */
.tier-lock {
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
  background: rgba(217,164,65,.07); border: 1px solid rgba(217,164,65,.28);
  border-radius: 8px; padding: 10px 13px; margin: 4px 0 12px;
}
.tier-lock b { color: #d9a441; }
input.dcf-in:disabled, input.val-in:disabled, input.cs-in:disabled {
  opacity: .5; cursor: not-allowed;
}

/* ===== Rating: Quality / Value / Growth ===== */
.rt-head { display: grid; grid-template-columns: auto 1fr; gap: 22px 26px; align-items: center; }
.rt-grade { display: flex; align-items: center; gap: 13px; }
.rt-letter {
  width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center;
  font-size: 34px; font-weight: 700; color: #fff;
}
.rt-letter.gA { background: #1f8b5c; }
.rt-letter.gB { background: #4a9d5f; }
.rt-letter.gC { background: #c9a227; }
.rt-letter.gD { background: #d2802f; }
.rt-letter.gE { background: #c0392b; }
.rt-cap { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-soft); line-height: 1.7; }
.rt-cap span { font-size: 15px; color: var(--fg); font-weight: 600; letter-spacing: 0; text-transform: none; }
.rt-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rt-card { min-width: 0; }
.rt-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-soft); }
.rt-v { font-size: 25px; font-weight: 650; color: var(--fg); font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.rt-v span { font-size: 12px; color: var(--fg-soft); font-weight: 400; }
.sc-meter { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; }
.sc-meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.sc-meter i.gA { background: #1f8b5c; } .sc-meter i.gB { background: #4a9d5f; }
.sc-meter i.gC { background: #c9a227; } .sc-meter i.gD { background: #d2802f; }
.sc-meter i.gE { background: #c0392b; }
.rt-chips { grid-column: 1 / -1; display: flex; gap: 9px; flex-wrap: wrap; }
.rt-chip {
  font-size: 12px; padding: 5px 11px; border-radius: 7px;
  border: 1px solid var(--line); color: var(--fg-soft);
}
.rt-chip b { color: var(--fg); }
.rt-chip.ok { border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.rt-chip.mid { border-color: color-mix(in srgb, var(--derived) 45%, transparent); }
.rt-chip.bad { border-color: color-mix(in srgb, var(--neg) 40%, transparent); }
.rt-lede { margin-bottom: 10px; }
.rt-table td { vertical-align: middle; }
.rt-w { text-align: right; color: var(--fg-soft); font-variant-numeric: tabular-nums; width: 60px; }
.rt-s { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; width: 66px; }
.rt-b { width: 150px; }

/* Piotroski */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.pf-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-soft); margin-bottom: 7px; }
.pf-row { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; padding: 4px 0; color: var(--fg); }
.pf-mark { width: 16px; font-weight: 700; flex: 0 0 auto; }
.pf-row.ok .pf-mark { color: var(--good); }
.pf-row.no .pf-mark { color: var(--neg); }
.pf-row.na { color: var(--fg-soft); }

/* Altman */
.z-zone { font-size: 11px; padding: 2px 9px; border-radius: 5px; text-transform: uppercase; letter-spacing: .05em; }
.z-safe { color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); }
.z-grey { color: var(--derived); border: 1px solid color-mix(in srgb, var(--derived) 45%, transparent); }
.z-distress { color: var(--neg); border: 1px solid color-mix(in srgb, var(--neg) 40%, transparent); }

/* ===== Rango de valor razonable ===== */
.fv-bar { position: relative; height: 78px; margin: 22px 0 8px; }
.fv-outer, .fv-core { position: absolute; top: 30px; height: 16px; border-radius: 8px; }
.fv-outer { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.fv-core { background: color-mix(in srgb, var(--accent) 48%, transparent); }
.fv-mid, .fv-price { position: absolute; top: 18px; height: 40px; width: 2px; }
.fv-mid { background: var(--accent); }
.fv-mid span, .fv-price span {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fv-mid span { color: var(--accent); }
.fv-price { background: var(--fg); }
.fv-price.out { background: var(--neg); }
.fv-price span { top: 44px; color: var(--fg); }
.fv-price.out span { color: var(--neg); }
.fv-ends {
  position: absolute; left: 0; right: 0; top: 62px;
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--fg-soft); font-variant-numeric: tabular-nums;
}
.fv-verdict {
  font-size: 13px; padding: 10px 13px; border-radius: 8px; margin-bottom: 10px;
  border: 1px solid var(--line); color: var(--fg-soft);
}
.fv-verdict b { color: var(--fg); }
.fv-verdict.bad { border-color: color-mix(in srgb, var(--neg) 35%, transparent); }
.fv-verdict.mid { border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.fv-off { opacity: .5; }
.report-btn {
  background: var(--panel); color: var(--fg); cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 6px 14px; font-size: 12.5px; font-weight: 550; font-family: inherit;
}
.report-btn:hover { border-color: var(--accent); color: var(--accent); }
