:root {
  color: #18212f;
  background: #f4f6f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* `hidden` tiene que ganar a cualquier `display` de las filas. El [hidden] de la hoja
 * del navegador es `display: none` con especificidad de atributo, y .data-row /
 * .position-row / .follow-row / .candidate-row / .analysis-row declaran `display: grid`
 * despues: ganaban ellas. Consecuencia: tables.js marcaba las filas como ocultas y se
 * seguian viendo TODAS, asi que ni el buscador ni el "cargar 10 mas" hacian nada
 * visible en ninguna tabla del sitio. */
[hidden] {
  display: none !important;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.section-inner {
  margin: 0 auto;
  max-width: 1120px;
  padding: 24px;
}

.site-nav-bar {
  margin-bottom: 8px;
}

.site-nav-inner {
  align-items: center;
  background: rgba(15, 23, 42, 0.92);
  border-radius: 10px;
  display: flex;
  gap: 10px 16px;
  justify-content: space-between;
  padding: 10px 16px;
  position: relative;
}

.site-nav-bar .brand {
  color: #fff;
  white-space: nowrap;
}

.site-nav-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.language-chip,
.site-nav-menu summary {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  min-height: 38px;
}

.language-chip {
  font-size: 20px;
  justify-content: center;
  padding: 6px 10px;
  text-decoration: none;
  width: 46px;
}

.language-chip:hover,
.site-nav-menu summary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.site-nav-menu {
  position: relative;
}

.site-nav-menu summary {
  cursor: pointer;
  gap: 8px;
  list-style: none;
  padding: 8px 14px;
  user-select: none;
}

.site-nav-menu summary::-webkit-details-marker {
  display: none;
}

.menu-chevron {
  font-size: 16px;
  line-height: 1;
  transform: translateY(-1px);
}

.site-nav-menu[open] .menu-chevron {
  transform: rotate(180deg) translateY(1px);
}

.site-nav-links {
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
}

.site-nav-links a {
  border-radius: 6px;
  color: #0f172a;
  display: block;
  font-weight: 650;
  padding: 10px 12px;
}

.site-nav-links a:hover {
  background: #ecfeff;
  color: #155e75;
}

.site-nav-links a.active {
  background: #155e75;
  color: #fff;
}

/* Entradas de segundo nivel del menu (Crash Hunter: seleccionadas / descartadas). */
.site-nav-links a.site-nav-sublink {
  font-size: 14px;
  font-weight: 600;
  padding-left: 26px;
}

.brand {
  font-weight: 800;
}

.nav-button,
.primary-button,
.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  display: inline-flex;
  font-weight: 750;
  padding: 10px 14px;
}

.primary-button {
  background: #fff;
  color: #0f3f4d !important;
  margin-left: 0;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.seo-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seo-grid article {
  border-top: 4px solid #155e75;
  padding-top: 14px;
}

.seo-grid p {
  color: #425466;
  line-height: 1.6;
}

.keyword-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 24px;
}

.keyword-links a {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #155e75;
  padding: 8px 12px;
}

.search-intent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.search-intent-list span,
.search-intent-list a {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #e0f2fe;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
  text-decoration: none;
}

.faq-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.faq-list article {
  border-top: 3px solid #0f766e;
  padding-top: 12px;
}

.faq-list h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.faq-list p {
  color: #425466;
  line-height: 1.6;
  margin: 0;
}

.two-column {
  display: grid;
  gap: 48px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-list {
  display: grid;
  gap: 14px;
  line-height: 1.6;
  padding-left: 20px;
}

.disclaimer {
  color: #425466;
  font-size: 16px;
  line-height: 1.6;
  max-width: 940px;
}

.site-footer {
  background: #0f172a;
  color: #cbd5e1;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  justify-content: space-between;
  padding-bottom: 36px;
  padding-top: 36px;
}

.footer-brand {
  max-width: 360px;
}

.footer-brand .brand {
  color: #fff;
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.footer-brand p {
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.footer-nav {
  align-content: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.footer-nav a {
  color: #cbd5e1;
  font-weight: 650;
}

.footer-nav a:hover {
  color: #fff;
}

.risk-panel {
  background: #fff;
  border: 1px solid #fecaca;
  border-left: 6px solid #dc2626;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  margin-bottom: 20px;
  padding: 22px;
}

.risk-panel h2 {
  margin-top: 0;
}

body {
  margin: 0;
}

body.app-shell {
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(245, 158, 11, 0.22), transparent 26%),
    linear-gradient(135deg, #08111f 0%, #102033 42%, #f5f7fb 42%, #eef2f7 100%);
  color: #101827;
  min-height: 100vh;
}

a {
  color: #155e75;
  font-weight: 650;
  text-decoration: none;
}

.container {
  margin: auto;
  max-width: 1400px;
  padding: 24px;
}

.opportunity-container {
  max-width: 1180px;
}

.app-layout {
  margin: auto;
  max-width: 1480px;
  padding: 28px;
}

header {
  margin-bottom: 24px;
}

.app-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.app-nav a {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #334155;
  padding: 8px 12px;
}

.app-nav a.active {
  background: #155e75;
  border-color: #155e75;
  color: #fff;
}

.product-header {
  align-items: flex-start;
  color: #fff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0 0 24px;
  padding: 8px 0 10px;
}

.product-header h1 {
  font-size: clamp(38px, 6vw, 78px);
  line-height: 0.95;
  margin: 0;
}

.product-header p {
  color: #dbeafe;
  font-size: 18px;
  max-width: 720px;
}

.app-kicker {
  color: #f59e0b;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.product-nav a {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
}

.app-nav .site-nav-links {
  justify-content: flex-end;
}

.app-nav .language-link {
  gap: 6px;
}

.market-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.market-strip article {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  padding: 18px;
}

.market-strip span,
.run-pill,
.muted-copy {
  color: #64748b;
}

.market-strip strong {
  color: #0f172a;
  display: block;
  font-size: 38px;
  line-height: 1;
  margin: 6px 0;
}

.market-strip p {
  margin: 0;
}

.dashboard-section {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.14);
  margin-bottom: 18px;
  padding: 22px;
}

.section-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(25px, 3vw, 38px);
  margin: 0;
}

.compact-heading {
  margin-top: 8px;
}

.compact-heading h3 {
  font-size: 20px;
  margin: 0;
}

.run-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.daily-report-card {
  background:
    linear-gradient(135deg, rgba(8, 47, 73, 0.94), rgba(15, 118, 110, 0.86)),
    url("https://images.unsplash.com/photo-1611974789855-9c2a0a7236a3?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
  color: #fff;
  min-height: 260px;
  padding: 22px;
}

.daily-report-card h3 {
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  margin: 22px 0 12px;
  max-width: 760px;
}

.daily-report-card p {
  color: #dffdfa;
  font-size: 18px;
  line-height: 1.55;
  max-width: 820px;
}

.daily-report-card a {
  color: #fff;
  font-weight: 900;
}

.report-feed {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  overflow: hidden;
}

.report-day-card {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  color: #0f172a;
  display: flex;
  flex: 0 0 148px;
  flex-direction: column;
  gap: 6px;
  padding: 16px 12px;
  text-align: center;
  text-decoration: none;
}

.report-day-card:hover {
  border-color: #0f766e;
}

.report-day-date {
  font-size: 15px;
  font-weight: 900;
}

.report-day-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.report-archive-link {
  color: #0f766e;
  font-weight: 800;
}

.report-archive-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: 18px;
}

.focus-board {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.focus-card,
.source-panel,
.opportunity-card,
.empty-state,
.portfolio-teaser {
  border-radius: 8px;
}

.focus-card {
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  min-height: 210px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.report-post-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  text-decoration: none;
}

.report-post-card h3 {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.3;
  margin: 4px 0;
}

.report-post-card p {
  color: #475569;
  flex-grow: 1;
  font-size: 15px;
  line-height: 1.55;
}

.report-article {
  margin-top: 18px;
}

.report-article p {
  color: #1f2937;
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.report-article p:first-of-type {
  color: #0f172a;
  font-size: 18px;
  font-weight: 600;
}

.risk-badge {
  align-items: center;
  border-radius: 8px;
  border: 1px solid;
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.risk-badge-emoji {
  font-size: 30px;
  line-height: 1;
}

.risk-badge strong {
  display: block;
  font-size: 16px;
}

.risk-badge p {
  color: inherit;
  font-size: 14px;
  margin: 4px 0 0;
  opacity: 0.85;
}

.risk-bajo {
  background: #ecfdf5;
  border-color: #34d399;
  color: #065f46;
}

.risk-medio {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.risk-alto {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.report-summary {
  font-size: 18px !important;
  font-weight: 600;
}

.report-subheading {
  font-size: 20px;
  margin: 28px 0 14px;
}

.report-event-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.report-event-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
}

.report-event-card h3 {
  color: #0f172a;
  font-size: 17px;
  line-height: 1.35;
  margin: 8px 0;
}

.report-event-card p {
  color: #334155;
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 10px;
}

.report-event-cta {
  color: #0f766e !important;
  font-weight: 700;
}

.report-event-top {
  min-height: 22px;
}

.relevance-badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  text-transform: uppercase;
}

.relevance-alta {
  background: #fee2e2;
  color: #991b1b;
}

.relevance-media {
  background: #fef3c7;
  color: #92400e;
}

.relevance-baja {
  background: #e2e8f0;
  color: #475569;
}

.impact-tags {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.impact-tags li {
  color: #334155;
  font-size: 13px;
}

.impact-tags strong {
  color: #0f172a;
}

.report-table-wrap {
  overflow-x: auto;
}

.report-table {
  border-collapse: collapse;
  width: 100%;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  padding: 10px 12px;
  text-align: left;
}

.report-table th {
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
}

.report-risk-list,
.report-focus-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.report-focus-list {
  list-style: none;
  padding-left: 0;
}

.report-risk-list li,
.report-focus-list li {
  color: #334155;
  font-size: 15px;
  line-height: 1.5;
}

.report-risk-list strong,
.report-focus-list strong {
  color: #0f172a;
}

.report-conclusion-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.conclusion-col {
  border-radius: 8px;
  padding: 14px 16px;
}

.conclusion-col h4 {
  font-size: 14px;
  margin: 0 0 8px;
}

.conclusion-col ul {
  margin: 0;
  padding-left: 18px;
}

.conclusion-col li {
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.conclusion-good {
  background: #ecfdf5;
}

.conclusion-bad {
  background: #fef2f2;
}

.conclusion-watch {
  background: #eff6ff;
}

.report-footnote {
  border-top: 1px solid #e2e8f0;
  color: #94a3b8 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  margin-top: 24px !important;
  padding-top: 14px;
}

.focus-card::after {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  content: "";
  height: 120px;
  position: absolute;
  right: -36px;
  top: -44px;
  width: 120px;
}

.color-0 { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.color-1 { background: linear-gradient(135deg, #1d4ed8, #38bdf8); }
.color-2 { background: linear-gradient(135deg, #9333ea, #f472b6); }
.color-3 { background: linear-gradient(135deg, #c2410c, #f59e0b); }
.color-4 { background: linear-gradient(135deg, #be123c, #fb7185); }

.focus-top {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.ticker-badge {
  background: #0f172a;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  padding: 6px 9px;
}

.focus-card h3,
.opportunity-card h3 {
  margin: 14px 0 8px;
}

.focus-card p,
.opportunity-card p {
  line-height: 1.5;
}

.focus-card a {
  color: #fff;
  font-weight: 900;
}

.source-panel {
  background: #0f172a;
  color: #fff;
  padding: 18px;
}

.source-link {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  display: block;
  padding: 12px 0;
}

.source-link span {
  color: #93c5fd;
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-link strong {
  display: block;
  line-height: 1.35;
  margin-top: 3px;
}

.radar-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.table-tools {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.instant-search {
  background: #fff;
  border-color: #cbd5e1;
  max-width: 520px;
  width: 100%;
}

.data-table {
  display: grid;
  gap: 8px;
}

/* La columna "Que ha pasado" trae texto libre del LLM: sin recortar, una sola tesis
   larga estiraba su fila hasta triplicar la altura del resto de la tabla. La ficha
   completa sigue mostrandola entera. */
.cell-clamp {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  line-clamp: 3;
  overflow: hidden;
}

/* Boton de "cargar mas" que inyecta /static/tables.js debajo de cada tabla. */
.load-more {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #155e75;
  display: block;
  font-weight: 850;
  margin: 12px auto 0;
  padding: 9px 18px;
}

.load-more[hidden] {
  display: none;
}

.table-empty {
  margin-top: 12px;
  text-align: center;
}

/* Explicacion en lenguaje llano encima de cada tabla o panel tecnico. */
.plain-note {
  color: #475569;
  font-size: 14px;
  margin: 0 0 12px;
}

.plain-panel h2 {
  margin-bottom: 6px;
}

.plain-panel .plain-block {
  border-top: 1px solid #e2e8f0;
  padding: 14px 0 0;
}

.plain-panel .plain-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.plain-panel .plain-block h3 {
  font-size: 15px;
  margin: 0 0 6px;
}

.plain-panel .plain-block p,
.plain-panel .plain-block li {
  color: #1f2937;
  font-size: 15px;
  line-height: 1.55;
}

/* Desglose del score: una barra por factor, con su peso maximo. */
.score-breakdown {
  display: grid;
  gap: 10px;
}

.score-factor {
  display: grid;
  gap: 4px;
}

.score-factor-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.score-factor-head strong {
  font-size: 15px;
}

.score-factor-hint {
  color: #64748b;
  font-size: 13px;
}

.score-bar {
  background: #e2e8f0;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.score-bar span {
  background: #155e75;
  display: block;
  height: 100%;
}

.score-total {
  align-items: baseline;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 12px;
}

.score-total strong {
  font-size: 22px;
}

.data-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 0.34fr 0.78fr 0.24fr 0.42fr 0.38fr 0.32fr 1.35fr;
  padding: 12px;
}

/* La tabla de Crash Hunter lleva una columna mas (Confianza) que el resto de las que
   usan .data-row, asi que redefine su rejilla en vez de descuadrar las demas. */
#crash-table .data-row {
  grid-template-columns: 0.32fr 0.72fr 0.22fr 0.4fr 0.36fr 0.3fr 0.28fr 1.2fr;
}

/* Cabecera con leyenda: el subrayado punteado avisa de que hay algo que leer al pasar
   el raton. En movil no hay hover, pero el `title` sigue siendo texto accesible. */
.col-legend {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* Termino tecnico del texto del modelo, explicado al pasar el raton. La frase se deja
   tal cual (ver explain_jargon): aqui solo se marca que hay una explicacion detras. */
.jargon {
  cursor: help;
  text-decoration: underline dotted #94a3b8;
  text-underline-offset: 3px;
}

.data-row small {
  color: #64748b;
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-top: 3px;
}

.opportunity-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #dbe4ef;
  display: grid;
  gap: 14px;
  grid-template-columns: 86px 1fr;
  padding: 16px;
}

.score-ring {
  align-items: center;
  background:
    radial-gradient(circle at center, #fff 0 54%, transparent 55%),
    conic-gradient(#22c55e calc(var(--score) * 1%), #e2e8f0 0);
  border-radius: 50%;
  display: flex;
  height: 78px;
  justify-content: center;
  width: 78px;
}

.score-ring span {
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
}

.status-dot {
  background: #e0f2fe;
  border-radius: 999px;
  color: #075985;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.mini-bars {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.mini-bars span {
  background:
    linear-gradient(90deg, #38bdf8 var(--bar), #e2e8f0 0);
  border-radius: 999px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
}

.follow-table {
  display: grid;
  gap: 8px;
}

.position-table,
.candidate-table,
.analysis-table {
  display: grid;
  gap: 8px;
}

.follow-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 0.45fr 0.45fr 0.55fr 1.8fr;
  padding: 12px;
}

.position-row,
.candidate-row,
.analysis-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.position-row {
  grid-template-columns: 0.38fr 0.85fr 0.34fr 0.34fr 0.34fr 0.34fr 1.45fr;
}

.candidate-row {
  grid-template-columns: 0.48fr 0.36fr 0.82fr 0.48fr 0.3fr 0.42fr 1.1fr 0.5fr;
}

.analysis-row {
  grid-template-columns: 0.5fr 0.36fr 0.78fr 0.42fr 0.9fr 0.3fr 0.38fr 1fr 0.48fr;
}

/* Va DESPUES de todas las filas a proposito. `.data-head` y `.position-row` tienen la
 * misma especificidad, asi que decide el orden: cuando estaba declarado arriba, el
 * `background` claro de .position-row/.candidate-row/.analysis-row ganaba y se quedaba
 * el `color: #fff` de la cabecera -> texto blanco sobre fondo casi blanco, ilegible en
 * /cartera y /analisis. En el dashboard no se notaba porque .data-row si esta declarado
 * antes que .data-head. */
.data-head {
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.data-head span,
.data-head a,
.data-head strong {
  color: #fff;
}

.follow-row small,
.position-row small,
.candidate-row small,
.analysis-row small {
  color: #64748b;
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 3px;
}

.follow-head {
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.positive {
  color: #15803d;
  font-weight: 900;
}

.negative {
  color: #b91c1c;
  font-weight: 900;
}

.empty-state {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 20px;
}

.empty-state.wide {
  grid-column: 1 / -1;
}

.portfolio-teaser {
  align-items: center;
  background: linear-gradient(135deg, #0f172a, #14532d);
  color: #fff;
  display: flex;
  justify-content: space-between;
}

.about-teaser {
  align-items: center;
  background: linear-gradient(135deg, #0f172a, #164e63);
  color: #fff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.about-teaser p {
  color: #ede9fe;
  line-height: 1.6;
  max-width: 860px;
}

.portfolio-teaser p {
  color: #dcfce7;
  max-width: 760px;
}

.big-action {
  background: #fff;
  border-radius: 8px;
  color: #14532d;
  display: inline-flex;
  font-weight: 900;
  padding: 14px 18px;
}

h1,
h2 {
  letter-spacing: 0;
}

.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 20px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

select,
input,
button {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #18212f;
  font: inherit;
  min-height: 38px;
  padding: 7px 10px;
}

button {
  background: #155e75;
  color: #fff;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  font-size: 14px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e8eaed;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
}

.opportunity-main-grid {
  align-items: stretch;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  margin-bottom: 20px;
}

.thesis-panel,
.analysis-side-grid {
  min-height: 100%;
}

.analysis-side-grid {
  display: grid;
  gap: 20px;
  grid-template-rows: minmax(0, 1fr) minmax(130px, auto);
}

.chart-panel {
  overflow: hidden;
}

.sources-panel {
  overflow: auto;
}

.sources-panel ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.company-summary {
  color: #425466;
  line-height: 1.6;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.company-summary li + li {
  margin-top: 4px;
}

.company-summary span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-right: 6px;
  text-transform: uppercase;
}

.indicator-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-top: 14px;
}

.indicator-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}

.indicator-tile span {
  color: #64748b;
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.indicator-tile strong {
  color: #18212f;
  display: block;
  font-size: 18px;
  margin-top: 4px;
}

/* Verde/rojo en tres intensidades segun cuanto se aleje de cero (_indicator_tone).
 * Tonos suaves a proposito: son 30 casillas juntas y un color saturado convertiria el
 * panel en un semaforo ilegible. El valor ya lleva su signo delante, asi que el color
 * refuerza, no informa por si solo. */
.indicator-pos-1 {
  background: #f3fbf6;
  border-color: #d3eede;
}

.indicator-pos-2 {
  background: #e6f7ed;
  border-color: #aee0c3;
}

.indicator-pos-3 {
  background: #d5f1e0;
  border-color: #84cfa3;
}

.indicator-neg-1 {
  background: #fef5f5;
  border-color: #f7d9d9;
}

.indicator-neg-2 {
  background: #fdeaea;
  border-color: #f2bcbc;
}

.indicator-neg-3 {
  background: #fbdcdc;
  border-color: #e79f9f;
}

.indicator-pos-2 strong,
.indicator-pos-3 strong {
  color: #12683c;
}

.indicator-neg-2 strong,
.indicator-neg-3 strong {
  color: #a12a2a;
}

.chart-toolbar {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-toolbar strong {
  font-size: 28px;
}

.chart-range-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.chart-range-controls button {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
  min-height: 34px;
  padding: 6px 10px;
}

.chart-range-controls button.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.chart-range-controls button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.price-chart-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.price-chart-wrap canvas {
  display: block;
  height: 300px;
  max-width: 100%;
  width: 100%;
}

.meta {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: max-content 1fr;
}

pre {
  overflow-x: auto;
  white-space: pre-wrap;
}

.advisor-panel {
  max-width: 860px;
}

.advisor-form fieldset {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 0;
  padding: 18px 0;
}

.advisor-form fieldset:first-child {
  border-top: 0;
  padding-top: 0;
}

.advisor-form legend {
  font-weight: 800;
  margin-bottom: 10px;
}

.choice {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  line-height: 1.45;
  padding: 7px 0;
}

.choice input {
  margin-top: 4px;
}

.result-hero {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 1fr);
}

.score {
  font-size: 56px;
  font-weight: 850;
  line-height: 1;
  margin: 12px 0;
}

.score span {
  color: #64748b;
  font-size: 24px;
  font-weight: 650;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 10px;
}

.status-good {
  background: #dcfce7;
  color: #166534;
}

.status-warning {
  background: #fef3c7;
  color: #92400e;
}

.status-serious {
  background: #fee2e2;
  color: #991b1b;
}

.meter-track,
.allocation-bar {
  background: #e2e8f0;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
}

.meter-good {
  background: #16a34a;
}

.meter-warning {
  background: #f59e0b;
}

.meter-serious {
  background: #ef4444;
}

.summary-grid {
  display: grid;
  gap: 6px 16px;
  grid-template-columns: max-content 1fr;
}

.summary-grid dt {
  color: #64748b;
  font-weight: 700;
}

.summary-grid dd {
  margin: 0;
}

.allocation-bar {
  display: flex;
  height: 18px;
  margin: 18px 0;
}

.allocation-liquidity {
  background: #2563eb;
}

.allocation-fixed {
  background: #059669;
}

.allocation-equity {
  background: #d97706;
}

.allocation-grid,
.tool-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.allocation-grid article,
.tool-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
}

.allocation-grid p,
.tool-card p,
.fine-print {
  color: #64748b;
  line-height: 1.5;
}

.swatch {
  border-radius: 3px;
  display: inline-block;
  height: 12px;
  margin-right: 7px;
  width: 12px;
}

.tool-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tool-card h3 {
  margin: 7px 0;
}

.tool-card.highlighted {
  border-color: #155e75;
  box-shadow: inset 0 3px 0 #155e75;
}

.risk-1 {
  border-left: 4px solid #ca8a04;
}

.risk-2 {
  border-left: 4px solid #ea580c;
}

.risk-3 {
  border-left: 4px solid #dc2626;
}

.risk-4 {
  border-left: 4px solid #9f1239;
}

.faq-item {
  border-top: 1px solid #e2e8f0;
  padding: 12px 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 800;
}

.button-link {
  background: #155e75;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-weight: 750;
  padding: 10px 14px;
}

@media (max-width: 900px) {
  .container {
    padding: 12px;
  }

  .panel {
    overflow-x: auto;
  }

  .chart-panel {
    overflow-x: hidden;
  }

  .detail-grid,
  .opportunity-main-grid,
  .analysis-side-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .app-header,
  .result-hero,
  .product-header,
  .section-heading,
  .portfolio-teaser,
  .about-teaser {
    grid-template-columns: 1fr;
  }

  .app-header,
  .product-header,
  .section-heading,
  .portfolio-teaser,
  .about-teaser {
    display: grid;
  }

  .allocation-grid,
  .tool-grid,
  .market-strip,
  .report-archive-grid,
  .focus-board,
  .radar-grid {
    grid-template-columns: 1fr;
  }

  .follow-row,
  .position-row,
  .candidate-row,
  .analysis-row {
    grid-template-columns: 1fr;
  }

  .data-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .table-tools {
    align-items: stretch;
    display: grid;
  }

  .opportunity-card {
    grid-template-columns: 1fr;
  }

  .public-nav {
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8vh;
  }

  .public-nav,
  .two-column,
  .seo-grid {
    grid-template-columns: 1fr;
  }

  .site-nav-links {
    justify-content: flex-start;
  }

  .two-column,
  .seo-grid {
    display: grid;
  }

  .hero,
  .seo-hero {
    min-height: auto;
  }

  .app-layout {
    padding: 16px;
  }

  .dashboard-section,
  .panel {
    padding: 16px;
  }

  .product-header h1 {
    font-size: clamp(36px, 12vw, 56px);
  }

  .product-header p,
  .hero-lead {
    font-size: 16px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .site-footer p {
    text-align: left;
  }

  .chart-toolbar {
    align-items: flex-start;
    display: grid;
  }

  .chart-toolbar strong {
    font-size: 24px;
  }

  .chart-range-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .price-chart-wrap canvas {
    height: 300px;
  }
}

@media (max-width: 520px) {
  .container,
  .app-layout,
  .hero-inner,
  .section-inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .dashboard-section,
  .panel {
    border-radius: 6px;
    padding: 14px;
  }

  .market-strip strong {
    font-size: 30px;
  }

  .run-pill,
  .app-nav a,
  .big-action,
  .chart-range-controls button {
    width: 100%;
  }

  .chart-range-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-chart-wrap canvas {
    height: 260px;
  }

  .report-feed {
    display: none;
  }
}
