
:root{--frame-gap:16px}

/* The outer grid owns spacing between its direct children. */
.grid{
  row-gap:var(--frame-gap) !important;
}

/* No additional vertical margin on wrappers or cards. */
section.card,
.analysis-top,
.left-stack,
.desktop-charts{
  margin-top:0 !important;
  margin-bottom:0 !important;
  padding-top:0 !important;
  padding-bottom:0 !important;
}

/* Inside the analysis wrapper, use exactly one 16px gap. */
.analysis-top{
  display:flex !important;
  flex-direction:column !important;
  gap:var(--frame-gap) !important;
  width:100% !important;
}
.left-stack{
  display:flex !important;
  flex-direction:column !important;
  gap:var(--frame-gap) !important;
  width:100% !important;
}
.analysis-top > section.card,
.left-stack > section.card{
  margin:0 !important;
}

/* Historical chart wrapper: same exact 16px gap, no extra top margin. */
.desktop-charts{
  display:flex !important;
  flex-direction:column !important;
  gap:var(--frame-gap) !important;
  width:100% !important;
}
.desktop-charts > section.card.chart,
.desktop-charts .chart{
  margin:0 !important;
}

/* Neutralize all old explicit card spacing rules. */
.analysis-top .power,
.analysis-top .fair,
.analysis-top .technical-analysis,
.analysis-top .fund,
.desktop-charts .chart{
  margin-top:0 !important;
  margin-bottom:0 !important;
}

/* Technical Analysis remains visible during prototype review. */
.technical-analysis{
  filter:none !important;
  pointer-events:auto !important;
  user-select:auto !important;
}
.technical-analysis .premium-lock-overlay{display:none !important}


/* Match every section title to the Power Bar title's distance from the top frame. */
section.card{
  padding-top:18px !important;
}
section.card > .section-title:first-child{
  margin-top:0 !important;
  padding-top:0 !important;
}

/* Historical-price card has content before its chart title; only normalize direct section headings. */
section.card.power > .section-title,
section.card.fair > .section-title,
section.card.technical-analysis > .section-title,
section.card.fund > .section-title,
section.card.chart > .section-title{
  margin-top:0 !important;
  padding-top:0 !important;
}


/* Optical correction for headings that share the row with an oval badge/pill. */
section.card.power > .section-title,
section.card.technical-analysis > .section-title{
  transform:translateY(-4px) !important;
  margin-bottom:10px !important;
}


/* 16px from the final visible content to the lower frame edge, everywhere. */
section.card{
  padding-bottom:16px !important;
}

/* Remove residual bottom margins on final direct children. */
section.card > *:last-child{
  margin-bottom:0 !important;
}

/* Historical chart cards: ensure wrappers/SVG containers don't add extra bottom space. */
section.card.chart{
  padding-bottom:16px !important;
}
section.card.chart > *:last-child,
section.card.chart .combo-wrap:last-child,
section.card.chart .debt-wrap:last-child,
section.card.chart .pe-line-wrap:last-child,
section.card.chart .eps-wrap:last-child{
  margin-bottom:0 !important;
  padding-bottom:0 !important;
}

/* Analytical Context box follows the same 16px internal-bottom rule. */
section.card.context,
section.card.notes,
.notes.card,
.context.card{
  padding-bottom:16px !important;
}
section.card.context > *:last-child,
section.card.notes > *:last-child,
.notes.card > *:last-child,
.context.card > *:last-child{
  margin-bottom:0 !important;
}

/* Existing explanatory endings also stay normalized. */
section.card.technical-analysis > .ta-disclaimer:last-child,
section.card.fund > div:last-child{
  margin-bottom:0 !important;
}


:root{--frame-gap:16px}

/* --- OUTER RHYTHM: exactly 16px between all section frames --- */

/* Main grid owns spacing between its direct children. */
.grid{
  row-gap:var(--frame-gap) !important;
}

/* Nested analysis stack */
.analysis-top{
  display:flex !important;
  flex-direction:column !important;
  gap:var(--frame-gap) !important;
  margin:0 !important;
  padding:0 !important;
  width:100% !important;
}
.left-stack{
  display:flex !important;
  flex-direction:column !important;
  gap:var(--frame-gap) !important;
  margin:0 !important;
  padding:0 !important;
  width:100% !important;
}

/* Historical charts stack */
.desktop-charts{
  display:flex !important;
  flex-direction:column !important;
  gap:var(--frame-gap) !important;
  margin:0 !important;
  padding:0 !important;
  width:100% !important;
}

/* Prevent any card-specific margins from altering frame-to-frame spacing. */
section.card,
.analysis-top > section.card,
.left-stack > section.card,
.desktop-charts > section.card{
  margin-top:0 !important;
  margin-bottom:0 !important;
}

/* --- INNER CHART COMPACTNESS: independent from outer spacing --- */

.desktop-charts > section.card.chart{
  height:auto !important;
  min-height:0 !important;
  display:block !important;
  padding-bottom:16px !important;
}

.desktop-charts .combo-wrap,
.desktop-charts .debt-wrap,
.desktop-charts .pe-line-wrap,
.desktop-charts .eps-wrap{
  height:auto !important;
  min-height:0 !important;
  flex:none !important;
  margin-bottom:0 !important;
}

.desktop-charts svg{
  height:220px !important;
  min-height:0 !important;
  display:block !important;
  width:100% !important;
}

/* Fullscreen can expand without changing inter-section spacing logic. */
:fullscreen .desktop-charts svg,
.fullscreen .desktop-charts svg,
.is-fullscreen .desktop-charts svg{
  height:100% !important;
  min-height:320px !important;
}


:root{--frame-gap:16px}

/* Critical: legacy .uniform-gap had higher specificity than section.card.
   Force every framed card to zero external margin; containers alone own the 16px gap. */
section.card.uniform-gap,
section.card.power,
section.card.fair,
section.card.technical-analysis,
section.card.fund,
section.card.chart,
aside.card.notes{
  margin-top:0 !important;
  margin-bottom:0 !important;
}

/* One and only one 16px separator inside each vertical stack. */
.left-stack{
  gap:var(--frame-gap) !important;
}
.analysis-top{
  gap:var(--frame-gap) !important;
}
.desktop-charts{
  gap:var(--frame-gap) !important;
}

/* Contexto analítico is a direct child of the main grid:
   don't add any explicit margin on top/bottom. */
aside.card.notes{
  margin:0 !important;
}

/* Final disclaimer: match the same 16px distance from Contexto Analítico.
   Remove the old 18px top margin. */
.disc{
  margin-top:16px !important;
  margin-bottom:0 !important;
}

/* Keep the disclaimer's own internal separator treatment, but no extra outer spacing. */


/* Power Bar, Fair Value, Technical Analysis and Fundamentals now share one flat stack. */
.analysis-top{
  display:flex !important;
  flex-direction:column !important;
  gap:16px !important;
  margin:0 !important;
  padding:0 !important;
  width:100% !important;
}

/* No card contributes its own external spacing. */
.analysis-top > section.card,
.analysis-top > section.card.uniform-gap,
.analysis-top > section.card.power,
.analysis-top > section.card.fair,
.analysis-top > section.card.technical-analysis,
.analysis-top > section.card.fund{
  margin:0 !important;
}

/* Free/visitor premium preview cards: use the Fair Value frame as the common baseline.
   Premium subscribers keep the original content-driven heights. */
body:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.fair,.technical-analysis).premium-module{
  height:240px!important;min-height:240px!important;max-height:240px!important;
  box-sizing:border-box!important;
}
@media(max-width:650px){
  body:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.fair,.technical-analysis).premium-module{
    height:270px!important;min-height:270px!important;max-height:270px!important;
  }
}

/* Free premium preview consistency: use Fair Value's layout for all three cards.
   Keep preview-only premium calculations hidden, with a harmless blurred placeholder. */
body:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.technical-analysis).premium-module{
  display:block!important;position:relative!important;
  padding:18px!important;overflow:hidden!important;
  border-radius:18px!important;isolation:isolate;
}
body:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.technical-analysis).premium-module > .section-title{
  display:block!important;position:relative!important;z-index:1!important;
  margin:0!important;padding:0!important;line-height:normal!important;
  align-self:auto!important;text-align:left!important;
}
/* Like the blurred Fair Value preview, without revealing or computing premium values. */
body:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.technical-analysis).premium-module::before{
  content:"";display:block;position:absolute;top:58px;left:18px;width:260px;
  max-width:calc(100% - 36px);height:9px;border-radius:8px;
  background:currentColor;opacity:.065;filter:blur(5px);pointer-events:none;
}
body:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.technical-analysis).premium-module > .visitor-premium-lock,
body.light-mode:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.technical-analysis).premium-module > .visitor-premium-lock{
  display:flex!important;position:absolute!important;
  inset:48px 0 0 0!important;width:auto!important;max-width:none!important;
  height:auto!important;min-height:0!important;margin:0!important;
  padding:18px!important;box-sizing:border-box!important;
  align-items:center!important;justify-content:center!important;
  overflow:hidden!important;border-radius:0 0 17px 17px!important;
  backdrop-filter:blur(1px)!important;
}
body.light-mode:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.technical-analysis).premium-module > .visitor-premium-lock{
  background:linear-gradient(to bottom,rgba(245,248,252,.15),rgba(245,248,252,.82))!important;
}
body:not(.light-mode):is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.technical-analysis).premium-module > .visitor-premium-lock{
  background:linear-gradient(to bottom,rgba(10,15,25,.12),rgba(10,15,25,.78))!important;
}
body:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.technical-analysis).premium-module .visitor-premium-lock-card,
body.light-mode:is([data-access='visitor'],[data-access='free']) .analysis-top > section.card:is(.power,.technical-analysis).premium-module .visitor-premium-lock-card{
  width:min(390px,calc(100% - 24px))!important;
  max-width:calc(100% - 24px)!important;min-width:0!important;
  margin:auto!important;padding:18px 20px!important;
  border:1px solid var(--line)!important;border-radius:14px!important;
  background:var(--card)!important;
  box-shadow:0 18px 50px rgba(0,0,0,.28)!important;
  box-sizing:border-box!important;text-align:center!important;
}

/* Legacy wrapper is no longer used; neutralize if any stale markup remains elsewhere. */
.left-stack{
  margin:0 !important;
  padding:0 !important;
  gap:0 !important;
}


/* Historical price: remove unnecessary empty space below the chart. */
section.card.price-card{
  height:auto !important;
  min-height:0 !important;
  padding-bottom:16px !important;
}

/* Last content block should not contribute extra spacing. */
section.card.price-card > *:last-child{
  margin-bottom:0 !important;
  padding-bottom:0 !important;
}

/* Prevent the chart container/SVG from stretching vertically beyond its content. */
section.card.price-card .chart-wrap,
section.card.price-card .price-chart-wrap,
section.card.price-card .price-chart,
section.card.price-card svg{
  margin-bottom:0 !important;
  padding-bottom:0 !important;
}


.access-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}
.access-actions button{font:inherit;font-size:11px;font-weight:750;border-radius:9px;padding:8px 11px;cursor:pointer}
.login-btn{background:transparent;color:var(--text);border:1px solid var(--line)}
.trial-btn{background:#4f74d8;color:#fff;border:1px solid #4f74d8}

.premium-module{position:relative;overflow:hidden}
.visitor-premium-lock{display:none}

/* Compact locked previews: never render blurred premium calculations for non-premium visitors. */
body:is([data-access='visitor'],[data-access='free']) section.card.power.premium-module,
body:is([data-access='visitor'],[data-access='free']) section.card.technical-analysis.premium-module{
  min-height:0!important;height:auto!important;padding:18px!important;display:flex!important;
  flex-direction:column!important;align-items:stretch!important;gap:10px!important;overflow:visible!important;
}
body:is([data-access='visitor'],[data-access='free']) section.card.power.premium-module > *:not(.section-title):not(.visitor-premium-lock),
body:is([data-access='visitor'],[data-access='free']) section.card.technical-analysis.premium-module > *:not(.section-title):not(.visitor-premium-lock){display:none!important}
body:is([data-access='visitor'],[data-access='free']) section.card.power.premium-module .visitor-premium-lock,
body:is([data-access='visitor'],[data-access='free']) section.card.technical-analysis.premium-module .visitor-premium-lock{
  position:static!important;inset:auto!important;min-height:0!important;padding:0!important;
  background:none!important;backdrop-filter:none!important;width:100%!important;
}
body:is([data-access='visitor'],[data-access='free']) section.card.power.premium-module .visitor-premium-lock-card,
body:is([data-access='visitor'],[data-access='free']) section.card.technical-analysis.premium-module .visitor-premium-lock-card{
  box-shadow:none!important;width:100%!important;max-width:420px!important;margin:auto!important;
}
/* Public visitor: premium content remains discoverable but its values are not readable. */
body:is([data-access='visitor'],[data-access='free']) .premium-module > *:not(.section-title):not(.visitor-premium-lock){
  filter:blur(7px);
  user-select:none;
  pointer-events:none;
}
body:is([data-access='visitor'],[data-access='free']) .premium-module .section-title{
  opacity:.92;
}
body:is([data-access='visitor'],[data-access='free']) .visitor-premium-lock{
  display:flex;
  position:absolute;
  inset:48px 0 0 0;
  z-index:20;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:linear-gradient(to bottom,rgba(10,15,25,.12),rgba(10,15,25,.78));
  backdrop-filter:blur(1px);
}
.visitor-premium-lock-card{
  width:min(390px,calc(100% - 24px));
  text-align:center;
  padding:18px 20px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card);
  box-shadow:0 18px 50px rgba(0,0,0,.28);
}
.lock-kicker{font-size:9px;letter-spacing:.12em;font-weight:850;color:#8fb0ff;margin-bottom:7px}
.visitor-premium-lock-card b{display:block;font-size:15px;margin-bottom:6px}
.visitor-premium-lock-card span{display:block;font-size:11px;line-height:1.5;color:var(--muted);margin-bottom:13px}
.visitor-premium-lock-card button{border:1px solid #4f74d8;background:#4f74d8;color:#fff;border-radius:9px;padding:9px 13px;font-size:11px;font-weight:800;cursor:pointer}

body.light-mode:is([data-access='visitor'],[data-access='free']) .visitor-premium-lock{
  background:linear-gradient(to bottom,rgba(245,248,252,.15),rgba(245,248,252,.82));
}

/* Auth entry shell for v0.81: visual entry points only in this release. */
.auth-preview{
  display:none;position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.58);
  align-items:center;justify-content:center;padding:20px
}
.auth-preview.open{display:flex}
.auth-check a{color:inherit;text-decoration:underline;text-underline-offset:2px}.auth-check a:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.auth-preview-card{width:min(420px,100%);background:var(--card);border:1px solid var(--line);border-radius:16px;padding:22px;box-shadow:0 24px 70px rgba(0,0,0,.35)}
.auth-preview-card h2{margin:0 0 8px;font-size:20px}
.auth-preview-card p{margin:0 0 16px;color:var(--muted);font-size:12px;line-height:1.55}
.auth-preview-card .auth-fields{display:grid;gap:9px}
.auth-preview-card input{width:100%;box-sizing:border-box;background:var(--panel);border:1px solid var(--line);color:var(--text);border-radius:9px;padding:10px 11px}
.auth-preview-card .auth-primary{width:100%;margin-top:12px;border:0;border-radius:9px;padding:10px;background:#4f74d8;color:#fff;font-weight:800}
.auth-preview-card .auth-secondary{width:100%;margin-top:8px;border:0;background:transparent;color:var(--muted);cursor:pointer}
.auth-preview-card .auth-meta{font-size:10px;color:var(--muted);margin-top:12px;line-height:1.5}
@media(max-width:900px){
  .access-actions{gap:5px}
  .access-actions button{padding:7px 8px;font-size:10px}
}


.auth-preview-card .forgot-password{
  display:none;width:100%;margin-top:8px;border:0;background:transparent;
  color:#8fb0ff;font-size:10px;cursor:pointer;
}
.auth-preview-card.login-mode .forgot-password{display:block}
.auth-check{
  display:flex;gap:8px;align-items:flex-start;
  font-size:10px;color:var(--muted);line-height:1.45;margin-top:10px
}
.auth-check input{width:auto;margin-top:2px}
.auth-message{
  display:none;margin-top:10px;padding:9px 10px;border:1px solid var(--line);
  border-radius:9px;font-size:10px;line-height:1.45;color:var(--muted)
}
.auth-message.show{display:block}


.theme-toggle{
  gap:3px !important;
  padding:2px !important;
}
.theme-toggle button{
  padding:4px 7px !important;
  font-size:10px !important;
  line-height:1.1 !important;
  min-height:0 !important;
}
.theme-toggle .theme-icon{
  font-size:9px !important;
}


body.light-mode:is([data-access='visitor'],[data-access='free']) .premium-module .visitor-premium-lock{
  inset:48px 0 0 0 !important;
  align-items:center !important;
  justify-content:center !important;
  padding:18px !important;
  background:linear-gradient(to bottom,rgba(245,248,252,.15),rgba(245,248,252,.82)) !important;
}
body.light-mode:is([data-access='visitor'],[data-access='free']) .premium-module .visitor-premium-lock-card{
  width:min(390px,calc(100% - 24px)) !important;
  min-width:0 !important;
  max-width:390px !important;
  box-sizing:border-box !important;
  padding:18px 20px !important;
  border:1px solid var(--line) !important;
  border-radius:14px !important;
  background:var(--card) !important;
  box-shadow:0 18px 50px rgba(0,0,0,.28) !important;
  text-align:center !important;
}


/* Día: todos los CTA Premium replican el aspecto claro/oscuro aprobado en Power Bar. */
body.light-mode:is([data-access='visitor'],[data-access='free']) .premium-module .visitor-premium-lock-card{
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#cfd8e3 !important;
}
body.light-mode:is([data-access='visitor'],[data-access='free']) .premium-module .visitor-premium-lock-card b{
  color:#172033 !important;
}
body.light-mode:is([data-access='visitor'],[data-access='free']) .premium-module .visitor-premium-lock-card span{
  color:#586477 !important;
}
body.light-mode:is([data-access='visitor'],[data-access='free']) .premium-module .visitor-premium-lock-card .lock-kicker{
  color:#4f74d8 !important;
}
body.light-mode:is([data-access='visitor'],[data-access='free']) .premium-module .visitor-premium-lock-card button{
  background:#4f74d8 !important;
  border-color:#4f74d8 !important;
  color:#ffffff !important;
}


.access-actions .account-active{border-color:#4f74d8!important;color:#8fb0ff!important}
body.light-mode .access-actions .account-active{color:#365fbf!important}


/* Authentication/account dialogs inherit the active page palette in light mode. */
body.light-mode .auth-preview-card{
  background:#fff;
  color:var(--text);
  border-color:var(--line);
}
body.light-mode .auth-preview-card h2,
body.light-mode .auth-preview-card .account-row b{color:var(--text)}
body.light-mode .auth-preview-card .account-row span,
body.light-mode .auth-preview-card .auth-meta,
body.light-mode .auth-preview-card .trial-timeline span{color:var(--muted)}
body.light-mode .auth-preview-card .account-grid,
body.light-mode .auth-preview-card .account-row,
body.light-mode .auth-preview-card .account-x{border-color:var(--line)}
body.light-mode .auth-preview-card .account-x{color:var(--text)}
body.light-mode .auth-preview-card .trial-price,
body.light-mode .auth-preview-card .trial-notice{background:var(--panel2)}


.account-card,.trial-card{width:min(470px,100%)}
.account-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}
.account-head h2{margin:1px 0 0}.account-x{border:1px solid var(--line);background:transparent;color:var(--muted);border-radius:8px;width:30px;height:30px;cursor:pointer;font-size:18px}
.account-grid{display:grid;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.account-row{display:flex;justify-content:space-between;gap:20px;padding:11px 12px;border-bottom:1px solid var(--line);font-size:11px}.account-row:last-child{border-bottom:0}.account-row span{color:var(--muted)}.account-row b{color:var(--text);text-align:right}
.account-actions{margin-top:14px}.account-actions .auth-primary{margin-top:0}.danger-link{color:#d86969!important}
.trial-price{padding:15px;border:1px solid var(--line);border-radius:12px;background:var(--panel);margin-bottom:14px}.trial-price strong{display:block;font-size:24px;margin-bottom:4px}.trial-price span{color:var(--muted);font-size:11px}
.trial-timeline{display:grid;gap:10px;margin:14px 0}.trial-timeline div{display:grid;grid-template-columns:54px 1fr;gap:10px;font-size:11px;line-height:1.5}.trial-timeline span{color:var(--muted)}
.trial-notice{font-size:10px;line-height:1.55;color:var(--muted);padding:10px 11px;border-left:3px solid #4f74d8;background:var(--panel);border-radius:7px;margin:14px 0}

.cancel-confirmation{margin-top:16px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--text)}.cancel-confirmation[hidden],.account-row[hidden]{display:none!important}


.tool-page{display:none;max-width:1220px;margin:0 auto 28px}.tool-page.active{display:block}.tool-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-end;margin-bottom:16px}.tool-head h1{margin:0 0 6px}.tool-sub{color:var(--muted);line-height:1.55}.tool-controls{display:flex;gap:9px;flex-wrap:wrap;margin:14px 0}.tool-controls input{background:var(--panel,#151f37);border:1px solid var(--line);border-radius:9px;color:var(--text);padding:10px 11px;min-width:150px}.tool-controls button{border:0;border-radius:9px;background:#4f74d8;color:white;font-weight:800;padding:10px 14px;cursor:pointer}.tool-status{color:var(--muted);font-size:12px;margin:8px 0 14px}.tool-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px}.tool-table{width:100%;border-collapse:collapse;min-width:980px}.tool-table th,.tool-table td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}.tool-table th:first-child,.tool-table td:first-child,.tool-table th:nth-child(2),.tool-table td:nth-child(2){text-align:left}.tool-table th{font-size:11px;color:var(--muted);background:var(--card);position:sticky;top:0}.tool-table tr:last-child td{border-bottom:0}.tool-lock{padding:28px;text-align:center;border:1px dashed var(--line);border-radius:12px;color:var(--muted)}nav [data-tool]{cursor:pointer}.stock-shell.tool-hidden{display:none!important}@media(max-width:800px){.tool-head{display:block}.tool-controls input{min-width:100%;width:100%}}

.etf-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0}.etf-kpi{border:1px solid var(--line);border-radius:11px;padding:12px;background:var(--panel)}.etf-kpi span{display:block;color:var(--muted);font-size:11px}.etf-kpi b{display:block;font-size:18px;margin-top:5px}.etf-cols{display:grid;grid-template-columns:1.2fr .8fr;gap:14px}.etf-holdings{width:100%;border-collapse:collapse}.etf-holdings td,.etf-holdings th{padding:8px;border-bottom:1px solid var(--line);text-align:left}.premium-panel{border:1px solid var(--line);border-radius:12px;padding:15px;margin-top:12px}.premium-panel h3{margin:0 0 7px}.etf-xray-input{display:flex;gap:8px;flex-wrap:wrap}.etf-xray-input input{flex:1;min-width:240px}.etf-free-badge{font-size:10px;font-weight:800;color:var(--muted)}@media(max-width:800px){.etf-grid{grid-template-columns:repeat(2,1fr)}.etf-cols{grid-template-columns:1fr}}


.launch-ad{display:none;margin:0;min-height:90px;border:1px dashed var(--line);border-radius:12px;align-items:center;justify-content:center;color:var(--muted);font-size:11px;text-align:center;padding:12px}body:is([data-tool='compare'],[data-tool='screener']) .wrap{padding-bottom:0}#comparePage,#screenerPage{margin-bottom:0}#launchAdHome,#launchAdEtf,#launchAdCompare,#launchAdScreener{margin-top:var(--frame-gap)}body:is([data-tool='etfs'],[data-tool='compare'],[data-tool='screener']) .site-footer{margin-top:var(--frame-gap)}.launch-ad.ready{display:block;grid-column:1 / -1;min-width:0;width:100%;box-sizing:border-box}.launch-ad::before{content:'Advertisement';display:block;margin-bottom:8px}html[lang='es'] .launch-ad::before{content:'Publicidad'}body[data-access="premium"] .launch-ad{display:none!important}.legal-page{display:none;max-width:900px;margin:0 auto 32px}.legal-page.active{display:block}.legal-page h1{margin-top:0}.legal-page h2{margin-top:26px;font-size:18px}.legal-page p,.legal-page li{color:var(--muted);line-height:1.7}.site-footer{max-width:1220px;margin:10px auto 30px;padding:18px 28px;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;color:var(--muted);font-size:11px}body[data-tool='stocks'].stockcharge-no-symbol .site-footer{margin-top:var(--frame-gap)}.site-footer a{color:var(--muted);text-decoration:none}.site-footer a:hover{color:var(--text)}.cookie-banner{position:fixed;z-index:9999;left:18px;right:18px;bottom:18px;max-width:820px;margin:auto;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:16px;box-shadow:0 16px 45px rgba(0,0,0,.35);display:none}.cookie-banner.open{display:block}.cookie-banner p{margin:0 0 12px;color:var(--muted);line-height:1.55}.cookie-actions{display:flex;gap:8px;flex-wrap:wrap}.cookie-actions button{border:1px solid var(--line);border-radius:9px;padding:9px 13px;background:transparent;color:var(--text);font-weight:700;cursor:pointer}.cookie-actions .primary{background:#4f74d8;border-color:#4f74d8;color:#fff}.founder-note{display:block;margin-top:6px;font-size:10px;color:var(--muted)}@media(max-width:700px){.site-footer{padding:16px 18px}.cookie-banner{left:10px;right:10px;bottom:10px}}


/* RC7.11 production QA fixes */
.welcome-caps{display:flex!important;flex-wrap:wrap!important;gap:10px!important;margin-top:16px!important;align-items:center!important}
.welcome-caps span{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:36px!important;padding:8px 14px!important;border:1px solid var(--line)!important;border-radius:10px!important;background:var(--panel,#151f37)!important;color:var(--text)!important;font-size:12px!important;font-weight:800!important;line-height:1.2!important;text-align:center!important}

/* First visit: only the simple search/welcome screen is visible until a symbol is selected. */
body.stockcharge-no-symbol #stockShell > :not(.stockcharge-welcome):not(#launchAdHome){display:none!important}
body.stockcharge-no-symbol .stockcharge-welcome{margin-bottom:0!important}
/* Stock detail routes use the header search only; preserve the landing welcome on / . */
body:not(.stockcharge-no-symbol) #stockShell > .stockcharge-welcome{display:none!important}
body:not(.stockcharge-no-symbol) #stockShell > .tool-note{display:none!important}

/* Cookie controls: maintain explicit contrast in light mode. */
body.light-mode #cookieReject{background:#182238!important;border-color:#182238!important;color:#fff!important}
body.light-mode #cookieReject:disabled{color:#dfe6f3!important}

/* Header logo must use the correct asset for each theme. */
@media(max-width:700px){.welcome-caps span{flex:1 1 calc(50% - 10px)!important}}


.welcome-search-wrap{position:relative;max-width:760px;margin:18px 0 4px}
.welcome-search{width:100%;height:48px;border:1px solid var(--line);border-radius:12px;background:var(--panel,#151f37);color:var(--text);padding:0 16px;font:inherit;font-size:14px;outline:none}
.welcome-search:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(79,116,216,.12)}
body.light-mode .welcome-search{background:#fff;color:#142033}
.welcome-search-suggestions{top:54px;left:0;right:0;width:100%}


.brand-logo{visibility:visible!important;opacity:1!important;filter:none!important}


/* Route rendering must work even if an earlier script fails. */
body[data-tool="etfs"] #stockShell,body[data-tool="compare"] #stockShell,body[data-tool="screener"] #stockShell,
body[data-tool="privacy"] #stockShell,body[data-tool="terms"] #stockShell,body[data-tool="disclaimer"] #stockShell{display:none!important}
body[data-tool="etfs"] #etfPage,body[data-tool="compare"] #comparePage,body[data-tool="screener"] #screenerPage,
body[data-tool="privacy"] #privacyPage,body[data-tool="terms"] #termsPage,body[data-tool="disclaimer"] #disclaimerPage{display:block!important}
body[data-tool="stocks"] #stockShell{display:block}
body.light-mode .search-item:hover,body.light-mode .search-item.active{background:#edf3ff!important}
body.light-mode .search-symbol{color:#142033!important}
body.light-mode .search-name{color:#334155!important}
body.light-mode .search-exchange{color:#64748b!important}
.brand-logo{height:34px!important;width:auto!important;object-fit:contain!important}


.brand-wordmark{display:inline-flex;align-items:flex-end;text-decoration:none;font-weight:900;font-size:20px;letter-spacing:-.7px;line-height:1;color:var(--text)}
.brand-stock{color:var(--text)}.brand-charge{color:#10b987}.brand-bars{display:inline-flex;align-items:flex-end;gap:2px;margin-left:3px;height:18px}.brand-bars i{display:block;width:3px;border-radius:2px;background:#10b987}.brand-bars i:nth-child(1){height:7px}.brand-bars i:nth-child(2){height:12px}.brand-bars i:nth-child(3){height:17px}


/* Negative financial amounts and percentage changes stay red in both themes. */
#fundamentalsTable .fundamental-negative,
body.light-mode #fundamentalsTable .fundamental-negative,
#fundamentalsTable .sector-vs.sector-negative,
body.light-mode #fundamentalsTable .sector-vs.sector-negative{
  color:#e34f5e !important;font-weight:700;
}


/* Absolute values remain neutral. Only YoY comparisons have red/green cues. */
#fundamentalsTable .fundamental-negative,
body.light-mode #fundamentalsTable .fundamental-negative{color:#e34f5e !important;font-weight:700}
#fundamentalsTable .fundamental-positive,
body.light-mode #fundamentalsTable .fundamental-positive{color:#2aa96b !important;font-weight:700}
#fundamentalsTable .sector-vs,
body.light-mode #fundamentalsTable .sector-vs{color:var(--text) !important;font-weight:normal}
#fundamentalsTable .sector-vs.sector-negative,
body.light-mode #fundamentalsTable .sector-vs.sector-negative{color:#e34f5e !important;font-weight:700}
#fundamentalsTable .sector-vs.sector-positive,
body.light-mode #fundamentalsTable .sector-vs.sector-positive{color:#2aa96b !important;font-weight:700}


/* Historical data tables need their own visible space below the plots. */
.desktop-charts .revenue-combo,
.desktop-charts .debt-chart{height:auto !important;min-height:300px}
.desktop-charts .revenue-combo .combo-wrap,
.desktop-charts .debt-chart .debt-wrap{flex:0 0 auto !important;height:auto !important;min-height:0 !important;overflow:visible !important}
.desktop-charts .revenue-combo .combo-wrap > svg,
.desktop-charts .debt-chart .debt-wrap > svg{height:230px !important;max-height:230px}
.desktop-charts .revenue-combo .dynamic-table-wrap,
.desktop-charts .debt-chart .dynamic-table-wrap{display:block;position:relative;flex:none;overflow-x:auto;overflow-y:visible;margin-top:12px;width:100%}


.pe-legend-note{text-align:left;line-height:1.5}
.pe-legend{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px 24px;margin:6px 0}
.pe-legend-item{display:inline-flex;align-items:center;gap:7px;white-space:normal}
.pe-legend-dot{display:inline-block;flex:0 0 9px;width:9px;height:9px;border-radius:50%}
.pe-company-dot{background:#7aa2ff}.pe-index-dot{background:#f2b84b}
.pe-legend-detail{margin:7px auto 0;max-width:900px;text-align:center}


/* Match the standard vertical gap between the main section cards. */
.stockcharge-welcome + .tool-note{display:block;margin:16px 0 16px;padding:0 4px;line-height:1.5}


/* Mobile only: keep theme and logo together, controls below and inside viewport. */
@media (max-width:700px){
  header{
    height:auto!important;min-height:0;position:relative;
    display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:10px 8px!important;align-items:center;
    padding:12px 14px!important;width:100%;max-width:100%;
  }
  header .theme-toggle{grid-column:1;grid-row:1;justify-self:start;max-width:100%;min-width:0}
  header .theme-toggle button{min-width:0!important;padding-left:9px!important;padding-right:9px!important}
  header .brand{grid-column:2;grid-row:1;min-width:0;justify-self:end;max-width:100%}
  header .brand a,header .brand-logo{max-width:100%}
  header .brand-logo{width:min(205px,100%);height:auto;max-height:42px}
  header nav{display:none!important}
  header .lang-switch{grid-column:1;grid-row:2;min-width:0;justify-self:start;margin:0}
  header .search-wrap{grid-column:2;grid-row:2;width:100%!important;min-width:0;margin:0!important}
  header .search-wrap .search{width:100%!important;min-width:0;padding:9px 10px}
  header .access-actions{grid-column:1 / -1;grid-row:3;display:flex;flex-wrap:wrap;justify-content:center;gap:8px;min-width:0;white-space:normal}
  header .access-actions button{max-width:100%;white-space:normal}
}


/* Mobile-only: avoid shrinking desktop SVG coordinates to unreadable phone width.
   Each plot scrolls horizontally within its own card; desktop remains unchanged. */
@media (max-width:700px){
  section.card.price-card, .desktop-charts > section.card.chart{min-width:0;max-width:100%;overflow:hidden}
  section.card.price-card .price-chart-wrap,
  .desktop-charts .combo-wrap,.desktop-charts .debt-wrap,
  .desktop-charts .pe-line-wrap,.desktop-charts .eps-wrap{
    display:block!important;width:100%!important;max-width:100%!important;
    height:auto!important;min-height:0!important;
    overflow-x:auto!important;overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
    padding:0 0 10px!important;margin-left:0!important;margin-right:0!important;
  }
  section.card.price-card .price-chart-wrap svg{
    width:720px!important;min-width:720px!important;max-width:none!important;
    height:260px!important;min-height:260px!important;
  }
  .desktop-charts .combo-wrap > svg,
  .desktop-charts .debt-wrap > svg,
  .desktop-charts .pe-line-wrap > svg,
  .desktop-charts .eps-wrap > svg{
    display:block!important;width:650px!important;min-width:650px!important;
    max-width:none!important;height:260px!important;min-height:260px!important;
  }
  .desktop-charts svg .chartlabel,.desktop-charts svg .svgx{font-size:15px!important}
  .desktop-charts svg .chartvalue,.desktop-charts svg .svgv{font-size:16px!important}
  .desktop-charts .pe-line-wrap svg text[font-size="12"]{font-size:16px!important}
  .desktop-charts .dynamic-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .desktop-charts .chart{min-width:0}
}


.fair .fvgrid{grid-template-columns:repeat(3,minmax(0,1fr));min-width:0}
.fair .fvgrid .fv{min-width:0}
.fair .fvgrid .value{overflow-wrap:anywhere}
@media(max-width:700px){
  .fair .fvgrid{gap:8px}
  .fair .fvgrid .fv{padding:12px 8px}
  .fair .fvgrid .value{font-size:clamp(13px,3.8vw,18px)}
  .fair .models{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
}


/* Keep metric names visible inside the table's horizontal scroll area. */
.fundamentals-mobile-scroll{isolation:isolate}
#fundamentalsTable th:first-child,
#fundamentalsTable td:first-child{
  position:sticky;left:0;z-index:1;background:var(--card);
  box-shadow:1px 0 0 var(--line);
}
#fundamentalsTable th:first-child{z-index:2}
body.light-mode #fundamentalsTable tbody td:first-child{background:#fff}
body.light-mode #fundamentalsTable tbody tr:nth-child(even) td:first-child{background:#fafbfd}
@media(max-width:700px){
  html,body{max-width:100%;overflow-x:clip}
  main.wrap,.stock-shell,.analysis-top,.left-stack,.desktop-charts,
  section.card.fund{min-width:0;max-width:100%;box-sizing:border-box}
  section.card.fund{overflow:hidden}
  section.card.fund .fundamentals-mobile-scroll{
    display:block;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;
    -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
  }
  section.card.fund .fundamentals-table{
    width:max-content!important;min-width:900px;max-width:none!important;
    table-layout:auto!important;
  }
  section.card.fund .fundamentals-table th,
  section.card.fund .fundamentals-table td{
    min-width:100px;white-space:normal;overflow-wrap:normal;
    vertical-align:middle;
  }
  section.card.fund .fundamentals-table th:first-child,
  section.card.fund .fundamentals-table td:first-child{min-width:110px}
}


@supports(width:1cqw){
  @media(max-width:700px){
    section.card.fund .fundamentals-mobile-scroll{container-type:inline-size}
    section.card.fund .fundamentals-table{
      width:270cqw!important;min-width:0;table-layout:fixed!important;
    }
    section.card.fund .fundamentals-table th,
    section.card.fund .fundamentals-table td{
      width:34cqw;min-width:0;padding:9px 4px;font-size:12px;
      white-space:normal;overflow-wrap:anywhere;text-align:center;
    }
    section.card.fund .fundamentals-table th:first-child,
    section.card.fund .fundamentals-table td:first-child{
      width:32cqw;min-width:0;font-size:11px;text-align:left;
    }
  }
}


/* Override historical table layout's overflow:visible on mobile plots only. */
@media(max-width:700px){
  .desktop-charts > section.card.revenue-combo,
  .desktop-charts > section.card.debt-chart{min-width:0!important;max-width:100%!important;overflow:hidden!important}
  .desktop-charts .revenue-combo .combo-wrap,
  .desktop-charts .debt-chart .debt-wrap{
    display:block!important;position:relative!important;box-sizing:border-box!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    overflow-x:auto!important;overflow-y:hidden!important;
    touch-action:pan-x pan-y;-webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
  }
  .desktop-charts .revenue-combo .combo-wrap > svg,
  .desktop-charts .debt-chart .debt-wrap > svg{
    display:block!important;width:650px!important;min-width:650px!important;
    max-width:none!important;height:260px!important;min-height:260px!important;
    max-height:none!important;flex:none!important;
  }
}


@media(max-width:700px){
  header{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
    grid-template-rows:auto auto auto!important;
    align-items:center!important;column-gap:8px!important;row-gap:12px!important;
    padding:12px 14px!important;width:100%;max-width:100%;
  }
  header .theme-toggle{grid-column:1!important;grid-row:1!important;justify-self:start!important;min-width:0}
  header .brand{grid-column:2!important;grid-row:1!important;justify-self:center!important;min-width:0;max-width:100%}
  header .brand-logo{width:clamp(150px,39vw,205px)!important;height:auto!important;max-height:42px!important}
  header .lang-switch{grid-column:3!important;grid-row:1!important;justify-self:end!important;display:flex;gap:4px;min-width:0}
  header .lang-switch button{min-width:0;padding-left:7px!important;padding-right:7px!important}
  header .search-wrap{grid-column:1 / -1!important;grid-row:2!important;width:100%!important;min-width:0!important;margin:0!important}
  header .search-wrap .search{display:block;width:100%!important;min-width:0!important}
  header .access-actions{grid-column:1 / -1!important;grid-row:3!important;justify-self:stretch!important;justify-content:flex-end!important;width:100%;gap:8px!important}
}
@media(max-width:370px){
  header{padding-left:9px!important;padding-right:9px!important;column-gap:4px!important}
  header .theme-toggle button{padding-left:5px!important;padding-right:5px!important;font-size:10px!important}
  header .brand-logo{width:150px!important}
  header .theme-toggle{gap:1px!important;padding:2px!important}
  header .theme-toggle button{font-size:0!important;min-width:30px!important;padding:5px!important}
  header .theme-toggle button .theme-icon{font-size:17px!important}
  header .lang-switch button{padding-left:5px!important;padding-right:5px!important;font-size:10px!important}
}


@media(max-width:700px){
  .tool-page,.tool-page > .card,.tool-page .premium-panel,
  .tool-page .compare-builder,.tool-page .etf-cols,.tool-page .etf-grid,
  .tool-page .etf-kpi{min-width:0;max-width:100%}
  .tool-page .tool-table-wrap{width:100%;max-width:100%;min-width:0;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
  .tool-page .tool-controls button,.tool-page .peer-chip,
  #screenerPage .screen-topbar button,#screenerPage .screen-workspace button,
  #screenerPage .screen-pagination button{min-height:44px;max-width:100%;white-space:normal}
  #screenerPage .screen-topbar select,
  #screenerPage .screen-workspace input,#screenerPage .screen-workspace select{min-width:0;max-width:100%;flex:1 1 140px}
  #screenerPage .screen-filter-menu{grid-template-columns:minmax(0,1fr)}
  #screenerPage .screen-meta,#screenerPage .screen-pagination{flex-wrap:wrap;gap:8px}
  .tool-page .etf-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tool-page .etf-kpi,.tool-page .tool-sub,.tool-page .peer-note{overflow-wrap:anywhere}
}


/* Keep all four destinations accessible on phones and small tablets. */
@media(max-width:800px){
  header nav{
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));
    gap:4px;width:100%;min-width:0;flex-basis:100%;order:10;
  }
  header nav > [data-tool]{
    display:flex;align-items:center;justify-content:center;min-height:44px;
    min-width:0;padding:6px 4px;text-align:center;font-size:11px;
    white-space:normal;overflow-wrap:anywhere;border:1px solid var(--line);
    border-radius:8px;cursor:pointer;
  }
  header nav .premium-mini{display:none}
  body.light-mode header nav > [data-tool]{color:#172033!important;border-color:#d9e1eb}
}
@media(max-width:700px){header nav{grid-column:1 / -1!important;grid-row:4!important}}
/* Only the selected tool is emphasized; applies to both EN/ES and both themes. */
header nav [data-tool]{font-weight:400}
body[data-tool="stocks"] header nav [data-tool="stocks"],
body[data-tool="etfs"] header nav [data-tool="etfs"],
body[data-tool="compare"] header nav [data-tool="compare"],
body[data-tool="screener"] header nav [data-tool="screener"]{font-weight:800;color:var(--text)}
/* Compare and Screener align to the established ETFs card top edge. */
/* A legacy section.card + section.card rule sets margin-top:20px !important on
   Compare and Screener because they follow another section; ETFs follows a div.
   Override that exact adjacency effect without changing any other cards. */
main.wrap > #etfPage,main.wrap > #comparePage,main.wrap > #screenerPage{margin-top:0 !important}


/* Share the Stocks frame spacing; the ETF page itself is an unframed layout. */
body[data-tool="etfs"] #etfPage{display:grid!important;gap:var(--frame-gap);padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;margin-bottom:0!important;min-width:0}
#etfPage #etfFree,#etfPage #etfPremium{display:contents}
#etfPage .etf-section{padding:18px!important;margin:0!important;border-radius:16px;min-width:0}
#etfPage .etf-identity{margin:0;min-width:0;gap:16px}
#etfPage .etf-metrics{margin:0;gap:12px}
#etfPage .etf-metrics .etf-kpi{border:0;border-right:1px solid var(--line);border-radius:0;background:transparent}
#etfPage .etf-metrics .etf-kpi:nth-child(4n){border-right:0}
#etfPage .section-title{font-size:17px;font-weight:750;margin:0 0 14px}
#etfPage .etf-source{margin:14px 0 0!important}
#etfPage .etf-search-section .tool-status:empty{display:none}
#etfPage .etf-holdings{width:100%}
@media(max-width:800px){#etfPage .etf-identity{align-items:flex-start;flex-wrap:wrap}#etfPage .etf-metrics .etf-kpi:nth-child(2n){border-right:0}#etfPage .etf-xray-input input{min-width:0;width:100%}}
