/* Estrategias additions on top of the Critso template (css/styles.css).
   Every rule reuses template tokens (var(--Primary), var(--Gainsboro)...) and is documented in /estilos. */

/* Benchmark comparison: catalogue selects, dialog, cards and loading ring. */
#benchmark-app .benchmark-selects { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
#benchmark-app .benchmark-selects label { flex: 1 1 220px; min-width: 0; }
#benchmark-app .benchmark-selects .asset-select { display: block; width: 100%; max-width: none; margin-top: 8px; }
#benchmark-app .benchmark-work { position: relative; min-height: 72px; }
#benchmark-app .benchmark-work[aria-busy="true"] > .benchmark-work-content { filter: blur(4px); opacity: .55; pointer-events: none; }
#benchmark-app .benchmark-busy { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; gap: 12px; background: color-mix(in srgb, var(--White) 65%, transparent); }
#benchmark-app .benchmark-busy .cs-loading { position: static; }
#benchmark-app .benchmark-busy .cs-loading span { width: 24px; height: 24px; }
#benchmark-app .benchmark-busy[hidden], #benchmark-app [hidden] { display: none !important; }
#benchmark-modal .cs-modal-backdrop { backdrop-filter: blur(4px); }
#benchmark-statistics .te-stat { height: 100%; }
#benchmark-statistics h6 { overflow-wrap: anywhere; }

/* Simulaciones > Plantilla: TS presentation classes with a native three-filter row and local monthly popup. */
[data-sim-template] .sim-filters .asset-select { flex: 1 1 180px; max-width: none; min-width: 0; }
[data-sim-template] .sim-logo { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; }
[data-sim-template] .sim-pop { top: 8px; left: 12px; }
[data-sim-template] #sim-chart[hidden] + .sim-pop { position: static; max-height: 380px; }
[data-sim-template] #sim-months { padding-top: 12px; }
/* /oscilador chart: Lightweight Charts navigated like Velas (/estilos › Gráficos de velas): vertical page scroll on touch,
   the Velas focus outline, the Velas legend and tools (hidden with the chart), the mean's value in --Khaki. */
[data-sim-template] #sim-chart { touch-action: pan-y; }
[data-sim-template] #sim-chart:focus { outline: none; }
[data-sim-template] #sim-chart:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: 4px; }
[data-sim-template] #sim-legend[hidden], [data-sim-template] .sim-tools[hidden], #benchmark-app .velas-legend[hidden], #benchmark-app .sim-tools[hidden] { display: none; }
[data-sim-template] .sim-tools { margin-top: 12px; }
[data-sim-template] .velas-mean { color: var(--Khaki); }
[data-sim-template] #sim-chart:not([hidden]) ~ .sim-pop { top: 36px; overscroll-behavior: contain; }   /* off-view list: under the legend */
/* /oscilador «Actualizar» (card kmwf7k9fdbqzf): the page opens empty and this primary .tf-button.style-1 beside «Restablecer»
   loads the chosen strategy, as tall and round as it, with the thinking circle .wn-bf-spin inside while it loads (and the
   table's .te-busy); narrower select bases so both buttons fit its filter row (.osc-filters: /oscilador only, not Macrotécnica). */
[data-osc-panel] .osc-filters .asset-select { flex-basis: 120px; }
[data-osc-panel] .osc-filters .te-update { align-self: stretch; height: 56px; min-height: 56px; padding: 8px 16px; border-radius: 8px; }
[data-sim-template] #sim-table tr:focus td { background: var(--LightSkyBlue); }
[data-sim-template] #sim-table tr:focus { outline: 2px solid var(--YellowGreen); outline-offset: -2px; }

/* Header user menu: logout is a POST form, so its button must look like the template's .user-item link. */
.user-item-button { width: 100%; border: 0; background: none; padding: 0; text-align: left; }
.popup-wrap.user .dropdown-menu.show form .user-item { display: flex; }

/* Login */
.login-logo { display: block; margin-bottom: 12px; }
.login-error { margin-bottom: 16px; padding: 12px 16px; border-radius: 8px; background: #FFE9E8; color: #B3261E; }

/* Inicio, Simulaciones, CandleScanner, Patternsz: intentionally empty for now */
.empty-dashboard { min-height: 60vh; }

/* Activos: counters */
.asset-stat { min-height: 96px; }
.asset-stat h6 { margin-bottom: 4px; }
@media (max-width: 767px) { .asset-stat { min-height: 0; padding: 16px !important; } .asset-stat h6 { font-size: 16px; } }

/* Activos: filters, built on .topbar-search + .tf-select */
.asset-filters .right { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0; }
.asset-select {
  height: 46px; padding: 0 36px 0 14px; border-radius: 8px; border: 0; max-width: 260px;
  background-color: var(--Gainsboro); color: var(--Black); font-size: 12px; font-weight: 500;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M5.24 5.32L8.57.96C8.82.63 8.59.16 8.17.16H1.51C1.1.16.86.63 1.11.96l3.33 4.36c.2.26.6.26.8 0z' fill='%23161326'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.asset-select:focus { outline: 2px solid var(--YellowGreen); }

/* Activos: the template's row-card table (dark header, Gainsboro rows) as a real <table>, so header and cells always
   share the column widths. Only the visible columns are rendered (see .asset-columns); a wide table scrolls. */
.table-list-activos { overflow-x: auto; }
.list-activos-content { width: 100%; table-layout: auto; border-collapse: separate; border-spacing: 0 8px; margin-top: -8px; }
.list-activos-content th { background-color: var(--Primary); padding: 16px 10px; white-space: nowrap; text-align: left; }
.list-activos-content td { background-color: var(--Gainsboro); height: 60px; padding: 0 10px; white-space: nowrap; vertical-align: middle; }
.list-activos-content th:first-child, .list-activos-content td:first-child { padding-left: 16px; }
.list-activos-content th:last-child, .list-activos-content td:last-child { padding-right: 16px; }
.list-activos-content th:first-child, .list-activos-content td:first-child { border-radius: 8px 0 0 8px; }
.list-activos-content th:last-child, .list-activos-content td:last-child { border-radius: 0 8px 8px 0; }
.list-activos-content th:only-child, .list-activos-content td:only-child { border-radius: 8px; }
.list-activos-content .num { text-align: right; }
.list-activos-content td.asset-empty { white-space: normal; }
.list-activos-content .asset-name { max-width: 170px; }   /* full name in its title; 11 columns fit 1440 px */
.list-activos-content .wrap-image { display: flex; align-items: center; gap: 6px; }      /* as .tf-table-item .wrap-image */
.list-activos-content .wrap-image .image { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.asset-logo { background: var(--White); }
.asset-logo img { width: 28px; height: 28px; object-fit: contain; }
.asset-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-isin { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.asset-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.asset-change.up { color: var(--Green); }
.asset-change.down { color: var(--Salmon); }
.asset-change.flat { color: var(--GrayDark); }
.table-list-activos .box-status { display: inline-flex; padding: 4px 8px; font-size: 10px; }

/* Activos: «Columnas», one .tf-check switch per column inside the template's filter dropdown (.dropdown.default.style-fill) */
.asset-columns .dropdown-menu { min-width: 220px; padding: 8px 0; }
.asset-columns .asset-col-title { padding: 8px 16px 4px; }
.asset-col-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; cursor: pointer; }
.asset-col-item:hover { color: var(--LimeGreen); }
.asset-col-item .tf-check { flex-shrink: 0; }
.asset-columns .asset-col-state { padding: 4px 16px 6px; }
.asset-columns .asset-col-state:empty { display: none; }
.box-status.source-eodhd { background-color: var(--YellowGreen); }
.box-status.source-massive { background-color: var(--LightSkyBlue); }
.box-status.source-fmp { background-color: var(--Khaki); }

.asset-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 28px 0 8px; flex-wrap: wrap; }

/* Sidebar collapse button: the header's hamburger (.icon-menu), in the sidebar's colours */
.section-menu-left .box-logo .button-show-hide { background-color: var(--Orange); color: var(--YellowGreen); }
.section-menu-left .box-logo .button-show-hide:hover i { color: var(--White); }

/* Header search: live suggestions in the template's .box-content-search (static/app/search.js) */
.header-dashboard .wrap .header-left .box-content-search.asset-suggest { height: auto; max-height: 420px; overflow-y: auto; padding: 8px; z-index: 30; }
.header-dashboard .wrap .header-left .box-content-search.asset-suggest.active:empty { opacity: 0; visibility: hidden; }
.asset-suggest .product-item { justify-content: flex-start; gap: 12px; padding: 8px; color: var(--Black); }
.asset-suggest .product-item:focus { background-color: var(--Gainsboro); border-radius: 10px; outline: none; }
.asset-suggest .product-item .image.small { width: 36px; height: 36px; background: var(--White); }
.asset-suggest .product-item .image img { width: 28px; height: 28px; object-fit: contain; }
.asset-suggest .product-item > div:last-child { min-width: 0; }
.asset-suggest-foot { display: block; padding: 10px 8px 4px; border-top: 1px solid var(--Gainsboro); margin-top: 4px; }
.asset-suggest-empty { padding: 10px 8px; }
.asset-suggest.is-stale a { opacity: .5; pointer-events: none; }   /* previous query's rows while the new ones load */

/* Configuración: fields stacked inside the template's .account-security-item */
.config-fields { display: flex; flex-direction: column; gap: 16px; }
.config-fields .config-hint { margin-top: -10px; }

/* ---------------------------------------------------------------- CandleScanner (/candlescanner)
   One page with the Mac app's screens (static/app/candlescanner.js + cs-chart.js). Built on the template's
   .wg-box, .widget-tabs, .tf-button, .tf-check and .asset-select; documented in /estilos. */
.cs-toolbar { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px !important; }
.cs-toolbar-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cs-find { gap: 8px; white-space: nowrap; }
.cs-kbd { padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--White) 18%, transparent); font-size: 10px; }
.cs-screens { overflow-x: auto; }
.cs-screens .widget-menu-tab.style-1 { padding: 6px; gap: 2px; min-width: max-content; }
.cs-screens .widget-menu-tab.style-1 .item-title { width: auto; padding: 9px 12px; white-space: nowrap; }
.cs-screens .widget-menu-tab .item-title:focus-visible, .cs-subtabs .item-title:focus-visible { outline: 2px solid var(--YellowGreen); border-radius: 10px; }
.cs-sync { margin-left: auto; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.cs-sync .cs-progress-bar { width: 120px; height: 6px; }
.cs-mark { color: var(--Green); font-weight: 700; }
.cs-alert { margin-bottom: 16px; }
.cs-subtabs .widget-menu-tab { flex-wrap: wrap; gap: 20px; }
.cs-subtabs .widget-menu-tab .item-title { padding-bottom: 2px; }
.cs-subtabs .widget-menu-tab .item-title.active span { color: var(--Primary); border-bottom: 2px solid var(--YellowGreen); padding-bottom: 12px; }

.cs-input { height: 40px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--Gainsboro); color: var(--Black); font-size: 12px; font-weight: 500; min-width: 0; }
.cs-input:focus, #cs-app .asset-select:focus-visible { outline: 2px solid var(--YellowGreen); }
.cs-app .asset-select { height: 40px; }
.cs-custom { width: 96px; }
.cs-color { width: 34px; height: 30px; padding: 0; border: 1px solid var(--LightGray); border-radius: 8px; background: none; cursor: pointer; }
.cs-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cs-row-end { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; }
.cs-spacer { flex: 1 1 auto; }
.cs-grow { flex: 1 1 180px; min-width: 160px; }
.cs-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cs-field > label { color: var(--GrayDark); }
.cs-hint { max-width: 520px; }
.cs-square { width: 40px; height: 40px; padding: 0 !important; justify-content: center; }
.cs-square i { margin: 0 !important; }
.cs-app .tf-button { gap: 6px; }
.cs-app .tf-button:disabled { opacity: .45; cursor: not-allowed; }
.cs-check { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 4px 0; }
.cs-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--Gainsboro); }
.cs-seg-item { border: 0; background: none; padding: 8px 12px; border-radius: 8px; color: var(--GrayDark); }
.cs-seg-item.active { background: var(--White); color: var(--Primary); box-shadow: 0 1px 2px color-mix(in srgb, var(--Primary) 8%, transparent); }
.cs-seg-item:focus-visible { outline: 2px solid var(--YellowGreen); }
.cs-menu-wrap { position: relative; }
.cs-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 280px; padding: 14px; border-radius: 14px;
  background: var(--White); box-shadow: 0 12px 32px color-mix(in srgb, var(--Primary) 16%, transparent); display: flex; flex-direction: column; gap: 8px; }
.cs-menu hr { margin: 4px 0; border-color: var(--LightGray); }
.cs-menu-item { display: block; padding: 8px 10px; border-radius: 8px; color: var(--Black); white-space: nowrap; }
.cs-menu-item:hover, .cs-menu-item:focus { background: var(--Gainsboro); }
.cs-warn { padding: 6px 10px; border-radius: 8px; background: var(--Khaki); color: var(--Black); }
.cs-bull { color: var(--Green); }
.cs-bear { color: var(--Salmon); }
.cs-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cs-link { border: 0; background: none; padding: 0; color: var(--Primary); text-decoration: underline; }
.cs-empty { padding: 48px 16px; text-align: center; }
.cs-section { padding: 16px; border-radius: 12px; background: var(--Gainsboro); margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.cs-controls { padding-bottom: 16px; border-bottom: 1px solid var(--LightGray); }
.cs-progress { display: flex; flex-direction: column; gap: 6px; }
.cs-progress-bar { height: 8px; border-radius: 99px; background: var(--Gainsboro); overflow: hidden; }
.cs-progress-fill { height: 100%; width: 0; background: var(--YellowGreen); transition: width .3s ease; }

/* Price chart + pattern list */
.cs-chart-box { padding: 16px !important; }
.cs-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cs-title { max-width: 200px; min-width: 90px; }
.cs-colors { display: flex; align-items: center; gap: 6px; }
.cs-chart-body { height: calc(100vh - 400px); min-height: 440px; }
.cs-chart-host { position: relative; height: 100%; min-height: 300px; border-radius: 12px; border: 1px solid var(--LightGray); background: var(--White); overflow: hidden; }
.cs-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.cs-canvas:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: -2px; }
.cs-readout { position: absolute; top: 8px; left: 8px; padding: 4px 8px; border-radius: 6px; background: color-mix(in srgb, var(--White) 94%, transparent);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--Primary) 12%, transparent); pointer-events: none; font-variant-numeric: tabular-nums; max-width: calc(100% - 90px); }
.cs-loading { position: absolute; top: 12px; right: 84px; z-index: 5; }
.cs-loading span { display: block; width: 18px; height: 18px; border: 2px solid var(--LightGray); border-top-color: var(--Primary); border-radius: 50%; animation: cs-spin 0.8s linear infinite; }
@keyframes cs-spin { to { transform: rotate(360deg); } }
/* The pattern table under the chart: the /patternsz table structure (.pz-table-box + .cs-table + .pz-table-wrap + .pz-sort) with CandleScanner columns. */
.cs-otable-head { align-items: center; gap: 8px; padding-bottom: 10px; }
.cs-otable-head .cs-input { flex: 0 1 220px; }
.cs-otable-box .cs-otable-wrap { max-height: max(420px, calc(100vh - 260px)); }   /* scrolled to, the table fills the screen */
.cs-otable:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: -2px; }
.cs-otable thead th { position: sticky; top: 0; z-index: 1; }
.cs-otable th, .cs-otable td { padding-left: 8px !important; padding-right: 8px !important; }
.cs-otable td.cs-wrap { white-space: normal; min-width: 104px; }
.cs-otable td.cs-wrap .cs-pat { white-space: normal; }
.cs-rated { white-space: nowrap; }
.cs-rated-gain { display: block; padding-left: 14px; }
.cs-rated .cs-dot { vertical-align: middle; }
.cs-otable-foot { padding-top: 8px; }
.cs-otable-box .cs-otable tr.cs-click:hover td { background: color-mix(in srgb, var(--LightSkyBlue) 30%, transparent); }   /* the .cs-dash-table hover */
.cs-otable-box .cs-otable tr.cs-click.active td { background: color-mix(in srgb, var(--LightSkyBlue) 45%, transparent); }   /* the selection wins over hover */
@media (max-width: 1599px) { .cs-otable th, .cs-otable td { padding-left: 6px !important; padding-right: 6px !important; } }
@media (max-width: 1439px) {
  .cs-otable th, .cs-otable td { padding-left: 4px !important; padding-right: 4px !important; }
  .cs-otable .pz-sort { white-space: normal; text-align: left; }
  .cs-otable td.cs-wrap { min-width: 68px; }
}
.cs-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--Primary) 15%, transparent); }
.cs-r0 { background: var(--Gray); }
.cs-r1 { background: var(--Salmon); }
.cs-r2 { background: var(--Khaki); }
.cs-r3 { background: var(--YellowGreen); }
.cs-r4 { background: var(--Green); }
.cs-rating { padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.cs-rt0 { background: var(--Gainsboro); }
.cs-rt1 { background: color-mix(in srgb, var(--Salmon) 25%, transparent); }
.cs-rt2 { background: var(--Khaki); }
.cs-rt3 { background: var(--YellowGreen); }
.cs-rt4 { background: color-mix(in srgb, var(--Green) 30%, transparent); }
.cs-pat { white-space: nowrap; }
.cs-ind-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.cs-ind-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--Gainsboro); }
.cs-ind-row .cs-check { margin: 0; }
.cs-swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cs-icon-button { border: 0; background: none; padding: 4px; color: var(--GrayDark); line-height: 1; }
.cs-icon-button:hover { color: var(--Salmon); }
.cs-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

/* Tables: the template's row-card pattern (dark head, light rows) */
.cs-table-wrap { overflow-x: auto; }
.cs-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; table-layout: auto; }
.cs-table thead th { background: var(--Primary); color: var(--White); padding: 11px 12px; white-space: nowrap; }
.cs-table thead th:first-child { border-radius: 8px 0 0 8px; }
.cs-table thead th:last-child { border-radius: 0 8px 8px 0; }
.cs-table tbody td { background: var(--Gainsboro); padding: 9px 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs-table tbody td:first-child { border-radius: 8px 0 0 8px; }
.cs-table tbody td:last-child { border-radius: 0 8px 8px 0; }
.cs-table .num { text-align: right; }
.cs-table tr.cs-click { cursor: pointer; }
.cs-table tr.cs-click:hover td { background: var(--Gainsboro); }
.cs-table tr.active td { background: color-mix(in srgb, var(--LightSkyBlue) 45%, transparent); }

/* Statistics */
.cs-stats-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cs-stats-head .cs-row { align-items: center; }
.cs-occ-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.cs-report { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }

/* Backtester */
.cs-bt-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.cs-bt-symbols { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cs-symlist { max-height: 560px; overflow-y: auto; border: 1px solid var(--LightGray); border-radius: 12px; padding: 6px; }
.cs-symrow { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; cursor: pointer; margin: 0; }
.cs-symrow:hover { background: var(--Gainsboro); }
.cs-symrow .asset-name { min-width: 0; }
.cs-range { display: flex; flex-direction: column; gap: 8px; }
.cs-bt-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cs-trade-host { height: 380px; }
.cs-editor { display: flex; flex-direction: column; gap: 12px; }

/* Dictionary, settings */
.cs-dict, .cs-prof { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.cs-prof { grid-template-columns: 220px minmax(0, 1fr); }
.cs-dict-list { display: flex; flex-direction: column; gap: 8px; }
.cs-dict-items { max-height: 70vh; overflow-y: auto; }
.cs-dict-sec { padding: 12px 8px 4px; }
.cs-dict-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 8px; }
.cs-dict-item:hover, .cs-dict-item.active { background: var(--Gainsboro); }
.cs-dict-item:focus-visible { outline: 2px solid var(--YellowGreen); }
.cs-dict-basic { padding: 4px 10px; }
.cs-dict-host { height: 300px; margin-top: 16px; }
.cs-patlist { columns: 2 340px; column-gap: 32px; }
.cs-patlist .cs-dict-sec { break-after: avoid; }
.cs-patrow { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; break-inside: avoid; cursor: pointer; margin: 0; }
.cs-patrow:hover { background: var(--Gainsboro); }

/* ⌘F symbol search and dialogs */
.cs-modal { position: fixed; inset: 0; z-index: 1000; }
.cs-modal-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--Primary) 35%, transparent); }
.cs-search-box { position: relative; width: min(640px, 92vw); margin: 12vh auto 0; border-radius: 16px; background: var(--White);
  box-shadow: 0 24px 64px color-mix(in srgb, var(--Primary) 30%, transparent); overflow: hidden; }
.cs-search-field { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--LightGray); }
.cs-search-field i { color: var(--GrayDark); }
.cs-search-field input { flex: 1; border: 0; outline: none; font-size: 18px; background: none; }
.cs-search-list { height: min(420px, 60vh); overflow-y: auto; padding: 6px; }
.cs-search-row { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.cs-search-row.active { background: var(--Gainsboro); }
.cs-search-row .image.small { width: 36px; height: 36px; flex-shrink: 0; }
.cs-search-row .image img { width: 28px; height: 28px; object-fit: contain; }
.cs-search-text { flex: 1 1 auto; min-width: 0; }
.cs-search-grp { white-space: nowrap; }
.cs-search-hint { padding: 16px; }
.cs-dialog { position: relative; width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; margin: 6vh auto 0; }
.cs-dialog.wide { width: min(780px, 94vw); }
.cs-dialog-head { margin-bottom: 12px; }

/* Oportunidades (first screen): the /activos row-card table (.table-list-activos) with CandleScanner cells */
.cs-dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cs-dash-head h6 { margin-bottom: 4px; }
.cs-dash-prog:not(:empty) { margin-bottom: 16px; max-width: 520px; }
.cs-dash-controls { margin-bottom: 16px; align-items: center; }
.cs-dash-controls .cs-check { margin: 0; }
.cs-dash-q { flex: 1 1 200px; max-width: 320px; }
.cs-dash-table td.cs-dash-tf { white-space: normal; vertical-align: top; min-width: 190px; padding-top: 10px; padding-bottom: 10px; }
.cs-dash-table td { height: auto; padding-top: 10px; padding-bottom: 10px; }
.cs-dash-table tr.cs-click { cursor: pointer; }
.cs-dash-table tr.cs-click:hover td { background: color-mix(in srgb, var(--LightSkyBlue) 30%, transparent); }
.cs-dash-asset { min-width: 0; }
.cs-dash-code { text-decoration: none; }
.cs-dash-code:hover, .cs-dash-code:focus-visible { text-decoration: underline; }
.cs-dash-asset .asset-name { max-width: 170px; }
.cs-dash-grp { white-space: nowrap; }
.cs-dash-score { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.cs-dash-num { display: flex; align-items: center; gap: 8px; }
.cs-dash-num .cs-progress-bar { flex: 1 1 auto; height: 6px; background: var(--White); }
.cs-progress-fill.cs-bear-fill { background: var(--Salmon); }
.cs-dash-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cs-dash-sigs { display: flex; flex-direction: column; gap: 6px; }
.cs-dash-sig { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 0; border-radius: 8px;
  padding: 5px 8px; background: var(--White); }
.cs-dash-sig:hover { box-shadow: inset 0 0 0 1px var(--Primary); }
.cs-dash-sig:focus-visible { outline: 2px solid var(--Primary); outline-offset: 2px; }
.cs-dash-sig .cs-pat { white-space: normal; }
.cs-dash-against { background: color-mix(in srgb, var(--White) 55%, transparent); }
.cs-dash-gone .cs-pat { text-decoration: line-through; color: var(--GrayDark); }
.cs-dash-stat { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-dot.cs-prov { background: transparent; box-shadow: inset 0 0 0 2px var(--Gray); }
.cs-dot.cs-prov.cs-r1 { box-shadow: inset 0 0 0 2px var(--Salmon); }
.cs-dot.cs-prov.cs-r2 { box-shadow: inset 0 0 0 2px var(--Khaki); }
.cs-dot.cs-prov.cs-r3 { box-shadow: inset 0 0 0 2px var(--YellowGreen); }
.cs-dot.cs-prov.cs-r4 { box-shadow: inset 0 0 0 2px var(--Green); }
.cs-dash-why td { white-space: normal; background: var(--White); box-shadow: inset 0 0 0 1px var(--LightGray); }
.cs-dash-reasons { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cs-dash-pts { display: inline-block; min-width: 52px; margin-right: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.cs-dash-help summary { cursor: pointer; }
.cs-dash-help p { max-width: 900px; }

@media (max-width: 1199px) {
  .cs-chart-body { height: auto; }
  .cs-chart-body .cs-chart-host { height: 460px; }
  .cs-occ-grid, .cs-bt-grid, .cs-bt-detail, .cs-dict, .cs-prof { grid-template-columns: minmax(0, 1fr); }
  .cs-sync { margin-left: 0; }
}
/* ---------------------------------------------------------------- end CandleScanner */

/* Asset page /activos/<id> (historico_web.py + activo.js): header, filters (.cs-seg), tabs (.widget-tabs), chart on
   .wg-box.bg-Primary (the template's candlestick-3 look), data/statistics/coverage tables (.list-activos-content) */
.asset-link { color: inherit; text-decoration: none; }
a.asset-name { display: block; }
.asset-link:hover .asset-ticker, a.asset-link.asset-name:hover { color: var(--LimeGreen); }
.hist-head { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.hist-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hist-idtext { min-width: 0; }
.hist-logo { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.hist-logo img { width: 48px; height: 48px; object-fit: contain; }
.hist-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.hist-tag { padding: 4px 10px; background: var(--Gainsboro); }
.hist-quote { text-align: right; }
.hist-filters { flex-direction: row; flex-wrap: wrap; gap: 16px 24px; }
.hist-filters .cs-seg { flex-wrap: wrap; }
.hist-save { flex-basis: 100%; }
.hist-save:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }   /* kept for screen readers */
.hist-tabs .widget-menu-tab.style-1 { overflow-x: auto; }
.hist-tabs .widget-menu-tab.style-1 .item-title { white-space: nowrap; }
.list-activos-content.hist-cover td > div { white-space: normal; min-width: 90px; }
.hist-tabs .widget-menu-tab .item-title:focus-visible { outline: 2px solid var(--YellowGreen); }
.hist-chart { padding: 16px 8px 8px; gap: 0; }
.hist-empty { padding: 64px 16px; text-align: center; }
.hist-data-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.hist-notes { margin-top: 16px; padding-left: 18px; list-style: disc; }
.hist-notes li + li { margin-top: 6px; }
@media (max-width: 767px) { .hist-quote { text-align: left; } }

/* ---------------------------------------------------------------- Patternz (/patternsz)
   The Mac app Patternz (static/app/patternz.js): toolbar, chart with the details panel, pattern table, ⌘F search
   with kind chips, and the Settings tabs. Reuses CandleScanner's generic pieces (.cs-toolbar, .cs-seg, .cs-menu,
   .cs-table, .cs-modal, .cs-search-*, .cs-chart-host, .cs-canvas, .cs-readout) and the template's .wg-box,
   .tf-button, .widget-tabs, .tf-check; documented in /estilos. */
.pz-title { min-width: 0; flex: 1 1 240px; }
.pz-title h5 { line-height: 1.2; }
.pz-update { display: inline-flex; }
.pz-screens { margin-left: auto; }
.pz-screens .widget-menu-tab.style-1 { padding: 4px; }
.pz-warn { color: var(--Salmon) !important; }
.pz-inline-spin { position: static; display: inline-block; }
.pz-controls .cs-square { width: 40px; height: 40px; }
.pz-inline-spin span { width: 14px; height: 14px; }
.pz-controls { align-items: center; }
.pz-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.pz-presets .tf-button { padding: 6px 10px; }
.pz-keys { max-width: 320px; line-height: 1.6; white-space: normal; }
.pz-chart-box { padding: 16px !important; }
.pz-notice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--Khaki); color: var(--Black); }
.pz-notice span { flex: 1 1 auto; }
.pz-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.pz-body.no-details { grid-template-columns: minmax(0, 1fr); }
.pz-chart-host { height: calc(100vh - 480px); min-height: 300px; }
.pz-state { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: var(--White); }
.pz-details { display: flex; flex-direction: column; gap: 0; min-width: 0; max-height: calc(100vh - 480px); min-height: 300px; overflow-y: auto; }
.pz-details .cs-section { gap: 8px; }
.pz-dname { overflow-wrap: anywhere; }
.pz-kv { display: flex; justify-content: space-between; gap: 12px; }
.pz-kv > span:last-child { text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pz-table-box { padding: 12px 16px !important; }
.pz-table-wrap { max-height: 360px; overflow: auto; }
.pz-table thead th { position: sticky; top: 0; z-index: 1; }
.pz-sort { border: 0; background: none; padding: 0; color: inherit; font: inherit; white-space: nowrap; }
.pz-table tr.cs-click:focus-visible td { outline: 2px solid var(--YellowGreen); outline-offset: -2px; }
.pz-table td:nth-child(2) { white-space: normal; min-width: 200px; }
.pz-table th, .pz-table td { padding-left: 10px !important; padding-right: 10px !important; }
/* Below 1920px the 10 columns (last one «Resultado») only fit without sideways scrolling if the long text cells wrap. */
@media (max-width: 1919px) {
  .pz-table td:nth-child(2) { min-width: 150px; }
  .pz-table td:nth-child(5), .pz-table td:nth-child(9) { white-space: normal; min-width: 90px; }
  .pz-table td:nth-child(7), .pz-table td:nth-child(8) { white-space: normal; }
  .pz-table th, .pz-table td { padding-left: 6px !important; padding-right: 6px !important; }
}
@media (max-width: 1439px) {
  .pz-table td:nth-child(2) { min-width: 110px; }
  .pz-controls { gap: 8px; }
  .pz-controls .cs-square { width: 36px; height: 36px; }
}
.pz-row-icon { display: inline-block; width: 16px; margin-right: 6px; color: var(--GrayDark); text-align: center; }
.pz-search-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0; }
.pz-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--LightGray); }
.pz-chip { border: 0; padding: 5px 12px; border-radius: 99px; background: var(--Gainsboro); color: var(--Black); }
.pz-chip.active { background: var(--Primary); color: var(--White); }
.pz-chip:focus-visible { outline: 2px solid var(--YellowGreen); }
.pz-chip-add { margin-left: auto; padding: 5px 12px !important; }
.pz-search-row { display: grid; grid-template-columns: 22px 120px minmax(0, 1fr) auto 110px auto; }
.pz-sr-icon { color: var(--GrayDark); text-align: center; }
.pz-sr-sym, .pz-sr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-sr-where { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-settings-body { display: flex; flex-direction: column; max-width: 760px; }
.pz-stepper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.pz-stepper .cs-input { width: 96px; }
.pz-color-row { display: flex; align-items: center; gap: 10px; margin: 0; }
.pz-color-row .cs-color { width: 34px; flex: 0 0 34px; }
.pz-list-head { align-items: center; margin-bottom: 12px; }
.pz-list-head .cs-input { width: 240px; }
.pz-list { columns: 2 300px; column-gap: 24px; margin-bottom: 16px; }
.pz-list .cs-check { break-inside: avoid; }
.pz-off { opacity: .45; }
.pz-gap { width: 96px; }
.pz-dictionary-layout { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 20px; }
.pz-dictionary-list { max-height: 620px; overflow: auto; border: 1px solid var(--LightGray); border-radius: 8px; }
.pz-dictionary-item { display: block; width: 100%; padding: 9px 12px; border: 0; background: transparent; color: var(--Black); text-align: left; }
.pz-dictionary-item:hover, .pz-dictionary-item.active { background: var(--Gainsboro); }
.pz-dictionary-item:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: -2px; }
.pz-dictionary-detail { max-width: 650px; }
.pz-dictionary-detail .pz-kv { padding: 7px 0; border-bottom: 1px solid var(--LightGray); }
@media (max-width: 1199px) {
  .pz-body { grid-template-columns: minmax(0, 1fr); }
  .pz-chart-host { height: 460px; }
  .pz-details { max-height: none; min-height: 0; }
  .pz-search-row { grid-template-columns: 22px 90px minmax(0, 1fr) auto auto; }
  .pz-sr-kind { display: none; }
  .pz-dictionary-layout { grid-template-columns: minmax(0, 1fr); }
  .pz-dictionary-list { max-height: 220px; }
}
/* Herramientas: the original program's windows (pz_tools.js) */
.pz-tools-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.pz-tools-side { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 16px; max-height: calc(100vh - 32px); }
.pz-side-row2, .pz-side-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pz-side-select { width: 100%; }
.pz-side-count { margin-left: auto; }
.pz-side-list { display: flex; flex-direction: column; gap: 2px; min-height: 60px; max-height: 360px; overflow-y: auto; padding: 6px; border-radius: 10px; background: var(--Gainsboro); }
.pz-tools-side .pz-side-list { flex: 1 1 auto; max-height: none; }
.pz-side-row { padding: 4px 6px; border-radius: 6px; }
.pz-side-row:hover { background: var(--White); }
.pz-side-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pz-side-more { padding: 6px; }
.tf-button.pz-mini { padding: 5px 10px; }
.pz-mt { margin-top: 12px; }
.pz-tools-main { min-width: 0; }
.pz-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pz-tool-card { display: flex; flex-direction: column; gap: 8px; text-align: left; border: 0; cursor: pointer; }
.pz-tool-card:hover, .pz-tool-card:focus-visible { outline: 2px solid var(--YellowGreen); }
.pz-tool-card-head { display: flex; align-items: center; gap: 10px; }
.pz-tool-card-head i { font-size: 20px; color: var(--Primary); }
.pz-tool-window { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pz-tool-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pz-tool-title { min-width: 0; flex: 1 1 240px; }
.pz-tool-head-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pz-tool-body, .pz-tool-group { display: flex; flex-direction: column; gap: 10px; }
.pz-tool-section { margin-bottom: 0; }
.pz-tool-section .pz-tool-section { background: var(--White); }
.pz-tool-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; }
.pz-field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.pz-num { width: 110px; }
.pz-date { width: 150px; }
.pz-text { width: 220px; }
.pz-textarea { width: 100%; min-height: 90px; height: auto; padding: 8px 12px; }
.pz-select { max-width: 320px; }
.pz-range { width: 220px; accent-color: var(--Primary); }
.pz-tool-check { margin: 0; }
.pz-tool-info { max-width: 900px; }
.pz-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.pz-link { border: 0; background: none; padding: 0; color: var(--Primary); text-decoration: underline; }
.pz-listfield { min-width: 220px; }
.pz-tool-list { max-height: 220px; }
.pz-tool-checks { columns: 4 200px; margin-bottom: 0; }
.pz-tool-checks > .cs-check { margin-bottom: 4px; }
.pz-working { display: inline-flex; align-items: center; gap: 8px; color: var(--GrayDark); }
.pz-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--YellowGreen); animation: pz-blink 1s infinite alternate; }
@keyframes pz-blink { to { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pz-dot { animation: none; } }
.pz-tool-rich { max-height: 520px; overflow-y: auto; padding: 12px 16px; border-radius: 10px; background: var(--Gainsboro); }
.pz-grid-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.pz-tool-grid-box { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pz-tool-table-wrap { max-height: 520px; overflow: auto; }
.pz-tool-table thead th { position: sticky; top: 0; z-index: 1; }
.pz-tool-table td { white-space: nowrap; }
.pz-tool-table th, .pz-tool-table td { padding-left: 8px !important; padding-right: 8px !important; }
.pz-tool-table tr.cs-click:focus-visible td { outline: 2px solid var(--YellowGreen); outline-offset: -2px; }
.pz-tool-chart { height: 460px; }
.pz-tool-dialog { width: min(980px, 96vw); }
.pz-tool-dialog .pz-tool-chart { height: 380px; }
.pz-notice-error { background: color-mix(in srgb, var(--Salmon) 30%, var(--White)); }
.pz-chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.pz-chosen .pz-chip { display: inline-flex; align-items: center; gap: 4px; }
.pz-chosen .cs-icon-button { color: inherit; }
.tf-button.pz-pick { justify-content: flex-start; text-align: left; padding: 6px 10px; }
.pz-copy-area { width: 100%; height: 220px; padding: 8px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 991px) {
  .pz-tools-layout { grid-template-columns: minmax(0, 1fr); }
  .pz-tools-side { position: static; max-height: none; }
  .pz-tools-side .pz-side-list { max-height: 260px; }
  .pz-tool-chart { height: 340px; }
}
/* Panel (first screen): the site's opportunity list (.cs-dash, .table-list-activos.cs-dash-table, .cs-dash-sig) fed by
   the daily Patternz scan; above the pattern table, the Figuras / Velas / Todos filter (.pz-table-head > .cs-seg). */
.pz-table-head { align-items: center; gap: 8px; padding-bottom: 10px; }
/* Patternz «Estadísticas»: the «Stop loss» dropdown (label + .asset-select) and the loading circle shown only after 0.2 s */
.pz-stats-sl { display: flex; align-items: center; gap: 8px; margin: 0; }
.pz-stats-sl .asset-select { height: 40px; }
.pz-wait { display: inline-flex; flex-direction: column; align-items: center; opacity: 0; animation: pz-wait-in 0s linear 0.2s forwards; }
.pz-wait-ring { display: block; width: 28px; height: 28px; border: 3px solid var(--LightGray); border-top-color: var(--Primary); border-radius: 50%; animation: cs-spin 0.8s linear infinite; }
@keyframes pz-wait-in { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pz-wait-ring { animation-duration: 2.4s; } }
/* ---------------------------------------------------------------- end Patternz */

/* ------------------------------------------- Activos: pestañas y «Conexión para estrategias» (historico_doc.py) */
.asset-tabs .widget-menu-tab.style-1 { overflow-x: auto; }
.asset-tabs .widget-menu-tab.style-1 .item-title { white-space: nowrap; }
.asset-tabs .widget-menu-tab .item-title:focus-visible { outline: 2px solid var(--YellowGreen); }
.doc-toc { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; }
.doc-toc a { color: var(--Primary); text-decoration: underline; font-size: 14px; }
.doc-toc a:hover { color: var(--YellowGreen); }
.doc-section { scroll-margin-top: 110px; }
.doc-section + .doc-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--Gainsboro); }
.doc-list { margin: 0 0 12px; padding-left: 18px; list-style: disc; }
.doc-list li { list-style: disc; }
.doc-list li + li { margin-top: 6px; }
.doc-code { background: var(--Primary); color: var(--White); padding: 20px; border-radius: 12px; font-size: 12px; line-height: 18px;
  overflow: auto; white-space: pre; margin: 0 0 12px; max-width: 100%; border: 0; }
.doc-code code { background: none; color: inherit; padding: 0; margin: 0; border: 0; font-size: inherit; white-space: inherit; overflow: visible; }
.doc-inline { background: var(--Gainsboro); color: var(--Primary); margin: 0; padding: 1px 6px; border-radius: 6px; font-size: 0.9em; overflow-wrap: anywhere; }
.list-activos-content.doc-table td { height: auto; padding-top: 12px; padding-bottom: 12px; }
.list-activos-content.doc-table td > div { white-space: normal; min-width: 120px; }
.doc-table .doc-inline { background: var(--White); }
/* ---------------------------------------------------------------- end Conexión */

/* ---------------------------------------------------------------- Cartera (/carteras, /cartera/<n>; cartera.js)
   The portfolios of cartera.pau.ninja in the site's kit: .wg-box.style-1 cards, .table-list-activos table, .cs-seg,
   .cs-menu, .cs-modal/.cs-dialog, .cs-input/.asset-select fields, .box-status pills. Colours only from the template. */
.pf-head, .pf-titlebar { display: flex; flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px !important; }
.pf-head h4, .pf-titlebar h4 { margin: 0; }
.pf-head h4 { flex: 1 1 auto; }
.pf-title { min-width: 0; overflow-wrap: anywhere; }
.pf-new { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 100%; }
.pf-new .cs-input { flex: 1 1 240px; }
.pf-error:empty { display: none; }
.pf-error { margin-bottom: 16px; }
.pf-card { position: relative; height: 100%; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding-right: 52px !important; transition: box-shadow .15s; }
.pf-card:hover, .pf-card:focus-visible { box-shadow: 0 8px 24px color-mix(in srgb, var(--Primary) 10%, transparent); }
.pf-card:focus-visible { outline: 2px solid var(--YellowGreen); }
.pf-card-title { margin: 0; overflow-wrap: anywhere; }
.pf-card-edit { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--Primary); }
.pf-card-x, .pf-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--Gainsboro); color: var(--GrayDark); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; }
.pf-card-x:hover, .pf-x:hover { background: var(--Salmon); color: var(--White); }
.pf-card-x:focus-visible, .pf-x:focus-visible { outline: 2px solid var(--YellowGreen); }
.pf-conns { display: flex; flex-direction: column; gap: 8px; }
.pf-conn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--YellowGreen) 45%, var(--White)); }
.pf-conn.is-error { background: color-mix(in srgb, var(--Salmon) 25%, var(--White)); }
.pf-conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--Green); }
.pf-conn.is-error .pf-conn-dot { background: var(--Salmon); }
.pf-danger, .pf-danger-link { color: var(--Salmon) !important; }
.pf-chart-box { height: 100%; }
.pf-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pf-chart-head h5 { margin: 0 0 2px; }
.pf-chart-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-chart-tools .cs-seg-item, .pf-chart-head .cs-seg-item { padding: 6px 10px; }
.pf-alloc { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 16px; align-items: center; }
.pf-donut-wrap { position: relative; min-height: 240px; }
.pf-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.pf-donut-center h6 { margin: 0; }
.pf-legend { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.pf-legend-row { display: flex; justify-content: space-between; gap: 8px; }
.pf-legend-left { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pf-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pf-stat { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.pf-stat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: baseline; gap: 8px; }
.pf-stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-stat-pct { text-align: right; }
.pf-pnl { display: flex; flex-direction: column; gap: 2px; }
.pf-pnl h5 { margin: 0; }
.pf-pnl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.pf-chart-wait { min-height: 300px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; text-align: center; }
.pf-chart-note { min-height: 240px; display: flex; align-items: center; justify-content: center; text-align: center; margin: 0; }
.pf-toolbar { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px !important; }
.pf-toolbar-top { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-filter-btn { display: none !important; }
.pf-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pf-search { flex: 1 1 220px; min-width: 180px; }
.pf-search .form-search { position: relative; }
.pf-search input[type=search] { padding-right: 64px; }
.pf-search input[type=search]::-webkit-search-cancel-button { display: none; }
.pf-search-clear { position: absolute; top: 50%; right: 40px; transform: translateY(-50%); z-index: 2; border: 0; background: none; color: var(--GrayDark); font-size: 18px; line-height: 1; }
.pf-dates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-dates .cs-input { width: 150px; }
.pf-table-wrap { margin-bottom: 8px; }
.pf-table th { padding: 0; }
.pf-sort { width: 100%; border: 0; background: none; padding: 16px 10px; text-align: inherit; white-space: nowrap; }
.pf-table th:first-child .pf-sort { padding-left: 16px; }
.pf-table th:last-child .pf-sort { padding-right: 16px; }
.pf-sort:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: -2px; border-radius: 8px; }
.pf-sort-ind { margin-left: 4px; font-size: 9px; }
.pf-row { cursor: pointer; }
.pf-row:hover td, .pf-row:focus-visible td { background: color-mix(in srgb, var(--LightSkyBlue) 30%, var(--Gainsboro)); }
.pf-row:focus-visible { outline: none; }
.pf-sub { font-size: 10px; line-height: 14px; }
.pf-status { display: flex; align-items: center; gap: 6px; }
.box-status.pf-st-open { background: var(--LightSkyBlue); color: var(--Primary); }
.box-status.pf-st-win { background: var(--YellowGreen); color: var(--Primary); }
.box-status.pf-st-loss { background: var(--Salmon); color: var(--White); }
.box-status.pf-hold { background: var(--White); color: var(--Primary); }
.pf-empty { text-align: center; padding: 24px 0; }
.pf-foot { display: flex; justify-content: flex-end; margin: 16px 0 32px; }
/* Dialogs: position editor, settings, import/export, connect */
body.pf-modal-open { overflow: hidden; }
.pf-dialog-wide { width: min(980px, 96vw) !important; }
.cs-dialog .pf-dialog-head, #pf-dialog .pf-dialog-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding-right: 44px; }
.pf-dialog-head h5 { margin: 0; }
.pf-dialog-head .pf-x { top: 50%; right: 0; transform: translateY(-50%); }
.pf-pos-head { display: grid; grid-template-columns: 160px 1fr 180px; gap: 12px; margin-bottom: 12px; }
.pf-pos .cs-input, .pf-pos .asset-select { width: 100%; }
.pf-sym-field { position: relative; }
.pf-verified { font-style: normal; }
.cs-input.is-verified { outline: 2px solid var(--YellowGreen); }
.pf-sym-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 70; margin: 4px 0 0; padding: 6px; list-style: none; border-radius: 12px; background: var(--White);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--Primary) 18%, transparent); max-height: 280px; overflow-y: auto; }
.pf-sym-list li { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.pf-sym-list li[data-pick]:hover { background: var(--Gainsboro); }
.pf-sym-status { flex-direction: row !important; align-items: center; gap: 8px; cursor: default !important; }
.pf-notes { height: 72px; min-height: 72px; padding-top: 10px; padding-bottom: 10px; resize: vertical; }
.pf-add-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.pf-calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pf-trades { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; }
.pf-trades-head, .pf-trade { display: grid; grid-template-columns: 28px 88px minmax(170px, 1.4fr) minmax(90px, 1fr) minmax(90px, 1fr) 96px minmax(70px, .7fr) 36px; gap: 8px; align-items: center; min-width: 760px; }
.pf-trade { padding: 6px; border-radius: 10px; background: var(--Gainsboro); }
.pf-trade.is-new { background: color-mix(in srgb, var(--Khaki) 35%, var(--Gainsboro)); }
.pf-trade .cs-input, .pf-trade .asset-select { background: var(--White); height: 36px; }
.pf-trade-x, .pf-note-btn { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--GrayDark); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.pf-trade-x:hover { color: var(--Salmon); }
.pf-note-btn.has-note { background: var(--YellowGreen); color: var(--Primary); }
.pf-action { border: 0; width: 100%; padding: 8px 6px; cursor: pointer; }
.pf-action.is-buy { background: var(--YellowGreen); color: var(--Primary); }
.pf-action.is-sell { background: var(--Salmon); color: var(--White); }
.pf-trade-note { min-width: 760px; padding: 0 6px 6px 44px; }
.pf-trade-note textarea { width: 100%; height: 64px; min-height: 64px; padding: 8px 12px; resize: vertical; }
.pf-delpos { margin-top: 16px; }
.pf-armed { background: var(--Salmon) !important; color: var(--White) !important; }
.pf-json { width: 100%; height: auto; min-height: 220px; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; resize: vertical; }
.pf-cn-grid { display: flex; flex-direction: column; gap: 12px; }
.pf-cn-grid .cs-input { width: 100%; }
@media (max-width: 991px) {
  .pf-alloc { grid-template-columns: 1fr; }
  .pf-filter-btn { display: inline-flex !important; }
  .pf-filters { display: none; }
  .pf-filters.is-open { display: flex; }
}
@media (max-width: 767px) {
  .pf-pos-head, .pf-calc-grid { grid-template-columns: 1fr; }
  .pf-dates .cs-input { width: 100%; flex: 1 1 130px; }
}
/* ---------------------------------------------------------------- end Cartera */

/* ---------------------------------------------------------------- Velas (velas.js; /estilos › Gráficos de velas)
   TradingView-style candlestick chart on a .wg-box.bg-Primary: legend over the plot, tool bar (.tf-button.style-3,
   .cs-seg LOG / AUTO), «Ir a fecha» row and «Atajos» table. */
.velas { position: relative; display: flex; flex-direction: column; gap: 12px; }
.velas[hidden] { display: none; }
.velas-chart { position: relative; width: 100%; border-radius: 8px; touch-action: pan-y; }
.velas-chart table { table-layout: auto; width: auto; margin: 0; }   /* the engine's own layout table: undo the template's table rules */
.velas-chart:focus { outline: none; }
.velas-chart:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: 4px; }
.velas-legend { position: absolute; top: 6px; left: 8px; right: 72px; z-index: 3; pointer-events: none; display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--White); }
.velas-legend .up { color: var(--Green); }
.velas-legend .down { color: var(--Salmon); }
.velas-k { color: var(--Gray); }
.velas-paper .velas-chart { background: var(--Gainsboro); }   /* paper: true, a light chart (Tops) */
.velas-paper .velas-legend { color: var(--Black); }
.velas-paper .velas-k { color: var(--GrayDark); }
.velas-bar, .velas-tools, .velas-goto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.velas-bar { justify-content: space-between; }
.velas-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.velas-scale .cs-seg-item { padding: 6px 10px; }
.velas-scale .cs-seg-item:disabled { opacity: .45; cursor: not-allowed; }
.velas-goto[hidden] { display: none; }
.velas-goto .cs-input { height: 36px; }
.velas-msg, .velas-note { color: var(--Khaki); }
.velas-tools { position: relative; }   /* «Atajos» opens from the row's left edge, so it never leaves the screen */
.velas-keys > summary { list-style: none; cursor: pointer; }
.velas-keys > summary::-webkit-details-marker { display: none; }
.velas-keys[open] > summary { background-color: var(--White); color: var(--Black); }
.velas-keys-table { position: absolute; z-index: 20; left: 0; bottom: calc(100% + 8px); width: auto; table-layout: auto; margin: 0; min-width: 380px; padding: 8px 12px; border-radius: 12px; background: var(--White); color: var(--Black); box-shadow: 0 8px 24px color-mix(in srgb, var(--Primary) 30%, transparent); }
.velas-keys-table td { padding: 4px 8px 4px 0; vertical-align: top; }
.velas-keys-table td + td { white-space: nowrap; }
.velas-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 767px) { .velas-keys-table { min-width: 0; width: min(380px, 100%); } .velas-keys-table td + td { white-space: normal; } .velas-legend { right: 56px; } }
.estilos-charts.estilos-velas { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }   /* /estilos: the six looks */
.estilos-velas .estilos-chart .wg-box { justify-content: flex-start; }
/* ---------------------------------------------------------------- end Velas */

/* ---------------------------------------------------------------- Categorías (Forest to the Trees)
   Ficha de activo: fila propia bajo el nombre con Sector › Subsector › Grupo (.box-status de la plantilla). */
.hist-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.hist-cat { padding: 4px 10px; background: var(--Gainsboro); }
.hist-cat.is-grupo { background: var(--YellowGreen); }
.hist-cat.is-none { background: var(--Khaki); }
.hist-cat-sep { color: var(--GrayDark); }
/* end Categorías */

/* ---------------------------------------------------------------- Weinstein (/weinstein; weinstein.js)
   The only tabs on top (.wn-global). Full-width breadth chart (.wn-breadth on the .wg-box.bg-Primary of the asset charts:
   legend chips .wn-br-key, unit and period segments .wn-dark-seg, month/day inputs .wn-month (weekly: days), «Medias:» select .wn-ma-of, SMA/EMA switches and months
   .wn-br-ma, readout .wn-br-read). Then the semáforo row: four cards Todos · Acciones · Cripto · Materias primas (.wn-sems >
   .wn-sem on .asset-stat.bg-Primary: lamps .wn-lamp, tag .wn-sem-tag, the projection dashed .wn-dash, share bar
   .wn-shares, the tab's card .wn-on). Then the four stage cards in 2×2 (.wn-stage: text left, bars of entries per close
   .wn-strip right; the card filters the table), sortable headers (.wn-sort) and the asset's stay table (.wn-stays).
   Colours only from the template. */
.wn-global { margin-bottom: 20px; }
.wn-sem { display: flex; flex-direction: column; gap: 10px; height: 100%; cursor: pointer; }
.wn-sem:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: 2px; }
.wn-sem.wn-on { box-shadow: inset 0 0 0 3px var(--YellowGreen); cursor: default; }
.wn-sem-head { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; justify-content: space-between; gap: 4px 8px; }
.wn-sem-head > :first-child { white-space: nowrap; }
@media (min-width: 1200px) { .wn-sem-head { min-height: 46px; } }   /* a wrapped tag («Materias primas») keeps the four lamp rows aligned */
.wn-sem-tag { padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--White) 12%, transparent); white-space: nowrap; }
.wn-sem-tag.wn-dash { background: none; outline: 1px dashed var(--White); outline-offset: 0; }
.wn-sem-main { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.wn-sem-main.wn-dim .wn-light { opacity: .5; }
.wn-light { display: flex; gap: 6px; flex-shrink: 0; }
.wn-lamp { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 700; color: var(--Gray); }
.wn-lamp:not(.on) { background-color: color-mix(in srgb, var(--White) 8%, transparent); }
.wn-lamp.on { width: 34px; height: 34px; font-size: 14px; color: var(--Primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--White) 35%, transparent); }
.wn-lamp.on.bg-Primary { color: var(--Primary); background-color: var(--White) !important; }
.wn-light-sm { gap: 4px; }
.wn-light-sm .wn-lamp { width: 20px; height: 20px; font-size: 10px; }
.wn-light-sm .wn-lamp.on { width: 24px; height: 24px; font-size: 11px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--White) 35%, transparent); }
.wn-br-msg:empty { display: none; }
.wn-sem-conf { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.wn-lamp.wn-dash { box-shadow: none; outline: 2px dashed var(--White); outline-offset: 2px; }
.wn-mix { padding: 2px 8px; border-radius: 99px; outline: 2px dashed var(--White); outline-offset: 1px; }
.wn-breadth input.wn-month[aria-invalid="true"] { outline: 2px solid var(--Salmon); }
.wn-sem-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wn-shares { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--White) 8%, transparent); }
.wn-shares span { display: block; height: 100%; }
.wn-shares.wn-dash { outline: 1px dashed var(--White); outline-offset: 2px; }
.wn-shares .bg-Primary { background: var(--White) !important; opacity: .55; }
.wn-shares-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.wn-sem-foot { opacity: .7; }
.wn-breadth { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.wn-br-top, .wn-br-dates { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.wn-br-dates { justify-content: flex-start; }
.wn-br-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.wn-br-key { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; color: var(--White); cursor: pointer;
  background: transparent; border: 1px solid color-mix(in srgb, var(--White) 20%, transparent); }
.wn-br-key[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.wn-br-key:hover { color: var(--White); }     /* the template's button:hover colour is the dark --primary */
.wn-br-key:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: 2px; }
span.wn-br-key { cursor: default; }     /* a static legend chip (Haller yield tabs), not a switch */
.wn-dark-seg { background: color-mix(in srgb, var(--White) 12%, transparent); }
.wn-dark-seg .cs-seg-item { padding: 4px 8px; color: var(--White); }
.wn-dark-seg .cs-seg-item.active { color: var(--Primary); }
.wn-br-lab { display: inline-flex; align-items: center; gap: 6px; }
.wn-breadth input.wn-month { width: 170px; padding: 4px 8px; font-size: 12px; color: var(--White); color-scheme: dark; border: 0;
  background: color-mix(in srgb, var(--White) 12%, transparent); }
.wn-br-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.wn-br-ma { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.wn-ma { display: inline-flex; align-items: center; gap: 8px; }
.wn-ma .cs-seg-item { display: inline-flex; align-items: center; gap: 6px; }
.wn-ma-swatch { display: inline-block; width: 18px; border-top: 2px dotted currentColor; }
.wn-ma-swatch.wn-ma-ema { border-top: 2px dashed currentColor; }   /* the stroke of each average line (the lines are --Khaki) */
.wn-breadth input.wn-ma-n, .te-line input.wn-ma-n { width: 72px; padding: 4px 8px; font-size: 12px; color: var(--White); color-scheme: dark; border: 0;
  background: color-mix(in srgb, var(--White) 12%, transparent); }
.wn-breadth input.wn-ma-n[aria-invalid="true"], .te-line input.wn-ma-n[aria-invalid="true"] { outline: 2px solid var(--Salmon); }
/* «Medias:» (Global / Etapas visibles): the site's .asset-select, dark like the month and period boxes; the arrow is the
   template's own .asset-select SVG with a white fill (a data URI cannot read a CSS variable) */
.wn-breadth select.wn-ma-of, .te-line select.wn-ma-of { height: auto; width: auto; padding: 4px 28px 4px 8px; font-size: 12px; color: var(--White); color-scheme: dark;
  background-color: color-mix(in srgb, var(--White) 12%, transparent); background-position: right 10px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M5.24 5.32L8.57.96C8.82.63 8.59.16 8.17.16H1.51C1.1.16.86.63 1.11.96l3.33 4.36c.2.26.6.26.8 0z' fill='%23ffffff'/%3E%3C/svg%3E"); }
.wn-breadth select.wn-ma-of option, .te-line select.wn-ma-of option { color: var(--White); background-color: var(--Primary); }
.wn-breadth select.wn-ma-of:focus-visible, .te-line select.wn-ma-of:focus-visible { outline: 2px solid var(--YellowGreen); }
.wn-br-chart { height: 380px; flex: 1 1 auto; min-height: 280px; }
.wn-br-chart { position: relative; }
.wn-br-chart table { table-layout: auto; width: auto; margin: 0; }   /* the engine's own layout table: undo the template's table rules (as .velas-chart) */
.wn-br-chart[hidden], .wn-br-empty[hidden] { display: none; }
.wn-br-read { min-height: 18px; }
.wn-br-note { opacity: .8; }
.wn-stage { display: flex; flex-direction: row; align-items: stretch; justify-content: space-between; gap: 16px; width: 100%; height: 100%; border: 0; text-align: left; cursor: pointer; }
.wn-stage:focus-visible { outline: 2px solid var(--Primary); outline-offset: 2px; }
.wn-stage.bg-Primary:focus-visible { outline-color: var(--YellowGreen); }
.wn-stage.wn-on { box-shadow: inset 0 0 0 3px var(--Primary); }
.wn-stage.bg-Primary.wn-on { box-shadow: inset 0 0 0 3px var(--YellowGreen); }
.wn-stage-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wn-stage-num { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wn-share { opacity: .8; }
.wn-strip-box { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; gap: 6px; flex-shrink: 0; }
.wn-strip { display: flex; align-items: flex-end; gap: 4px; height: 96px; }
.wn-strip span { display: block; width: 12px; border-radius: 3px; background: color-mix(in srgb, var(--Primary) 30%, transparent); }
.wn-strip span.wn-last { background: var(--Primary); }
.wn-stage.bg-Primary .wn-strip span { background: color-mix(in srgb, var(--White) 35%, transparent); }
.wn-stage.bg-Primary .wn-strip span.wn-last { background: var(--White); }
.wn-strip-cap { opacity: .75; }
.wn-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.wn-sort:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: 2px; }
.wn-arrow { font-size: 10px; opacity: .5; }
.wn-arrow.on { opacity: 1; }
.wn-table td { white-space: normal; }
.wn-table td.wn-why { min-width: 120px; max-width: 260px; }
.wn-stagecell { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.wn-table .cs-dash-asset .asset-name { max-width: 140px; }
.wn-prov { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.wn-prov .box-status { opacity: .75; }
.wn-ld { margin-left: 6px; white-space: nowrap; }
.wn-last-sig { white-space: nowrap; }
.wn-chart-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wn-chart-top h6 { margin-bottom: 6px; }
.wn-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 12px; color: var(--White); }
.wn-legend[hidden] { display: none; }
.wn-key { display: inline-flex; align-items: center; gap: 6px; }
.wn-dot { width: 10px; height: 10px; border-radius: 50%; }
@media (max-width: 575px) { .wn-stage { flex-direction: column; } .wn-strip-box { align-items: flex-start; } }
/* «Del bosque a los árboles» (.wn-mx, weinstein.js mxDraw): its own zone between the four stage cards and «Cómo se lee».
   Template table with heat cells: group percentage of selected-stage entries minus exits; color measures percentage-point lead over its market.
   Strong green ≥20; green ≥10; light green ≥4; neutral within 4 or too little activity; red bands ≤−4, ≤−10, ≤−20.
   Gray: fewer than the current minimum of assets with known stages. */
.wn-mx { margin: 16px 0 40px; padding-top: 32px; border-top: 1px solid var(--Gainsboro); }
.wn-mx-head { margin-bottom: 16px; }
.wn-mx-head .text-GrayDark { max-width: 900px; }
.wn-mx-ctrl { margin-bottom: 12px; }
.wn-mx-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.wn-mx-refs .box-status { padding: 4px 10px; }
.wn-mx-table th.wn-mx-col { text-align: center; }
.wn-mx-table th.wn-mx-col .wn-sort { justify-content: center; width: 100%; }
.wn-mx-close { opacity: .8; margin-top: 2px; }
.wn-mx-dates { display: none; }
.list-activos-content.wn-mx-table td { height: 64px; }
.wn-mx-table .wn-mx-label { white-space: normal; min-width: 220px; position: sticky; left: 0; z-index: 1; }
.wn-mx-table th.wn-mx-label { background-color: var(--Primary); }
.wn-mx-table td.wn-mx-label { background-color: var(--Gainsboro); }
.wn-mx-path { line-height: 1.3; }
.list-activos-content.wn-mx-table td.wn-mx-cell { text-align: center; min-width: 104px; color: var(--Primary); }
.list-activos-content td.wn-mx-g3, .wn-mx-key.wn-mx-g3 { background-color: var(--Green); }
.list-activos-content td.wn-mx-g2, .wn-mx-key.wn-mx-g2 { background-color: color-mix(in srgb, var(--Green) 60%, var(--Khaki)); }
.list-activos-content td.wn-mx-g1, .wn-mx-key.wn-mx-g1 { background-color: color-mix(in srgb, var(--YellowGreen) 50%, var(--Khaki)); }
.list-activos-content td.wn-mx-n, .wn-mx-key.wn-mx-n { background-color: var(--Khaki); }
.list-activos-content td.wn-mx-r1, .wn-mx-key.wn-mx-r1 { background-color: color-mix(in srgb, var(--Salmon) 40%, var(--Khaki)); }
.list-activos-content td.wn-mx-r2, .wn-mx-key.wn-mx-r2 { background-color: color-mix(in srgb, var(--Salmon) 70%, var(--Khaki)); }
.list-activos-content td.wn-mx-r3, .wn-mx-key.wn-mx-r3 { background-color: var(--Salmon); }
.list-activos-content td.wn-mx-gray, .wn-mx-key.wn-mx-gray { background-color: var(--Gainsboro); color: var(--GrayDark); }
.wn-mx-row.active td { box-shadow: inset 0 2px 0 var(--Primary), inset 0 -2px 0 var(--Primary); }
.wn-mx-row:focus-visible { outline: 2px solid var(--Primary); outline-offset: 2px; }
.list-activos-content tr.wn-mx-more td { background: none; height: auto; text-align: center; padding: 8px 0; }
.list-activos-content tr.wn-mx-sub td.wn-mx-members { height: auto; white-space: normal; padding: 12px 16px; background-color: var(--White); }
.wn-mx-mems { display: flex; flex-wrap: wrap; gap: 6px; }
.wn-mx-mem { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--Gainsboro); border-radius: 8px;
  background: var(--White); color: var(--Primary); cursor: pointer; }
.wn-mx-mem:hover, .wn-mx-mem:focus-visible { border-color: var(--Primary); }
.wn-mx-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.wn-mx-key { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 6px; color: var(--Primary); }
.wn-mx-small { margin-bottom: 12px; }
@media (max-width: 767px) { .wn-mx-table .wn-mx-label { min-width: 160px; } .list-activos-content.wn-mx-table td.wn-mx-cell { min-width: 84px; } }
@media (max-width: 575px) {      /* a phone: the three columns as close to the first screen as the label allows */
  .wn-mx-close { display: none; }
  .wn-mx-dates { display: block; margin-bottom: 8px; }
  .wn-mx-table .wn-mx-label { min-width: 104px; max-width: 116px; padding-left: 10px !important; padding-right: 6px; }
  .wn-mx-table .wn-mx-label .f14-bold { font-size: 13px; line-height: 1.3; }
  .wn-mx-path { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
  .wn-mx-mk { display: none; }
  .list-activos-content.wn-mx-table td.wn-mx-cell { min-width: 56px; padding: 0 2px; }
  .list-activos-content.wn-mx-table th.wn-mx-col { min-width: 56px; padding-left: 2px; padding-right: 2px; }
}
/* «Ondas del bosque» (third tab, 2026-10-15): the panel's .wn-breadth chart for a Sector › Subsector › Grupo. Right of the
   Nº/% toggle (.wn-br-head) a picker .wn-pick: a dark pill .wn-pick-btn opening a light popover .wn-pick-pop built from the
   ⌘F search box (.cs-search-field + .cs-search-list + .cs-search-row; rows indented per level, .current = the shown node,
   .wn-pick-head = market label under «Todos», .wn-pick-hit = the matched name). Thinking circle .wn-bf-spin (the
   .cs-loading ring, cs-spin). «Actualizar» (.tf-button.style-1) with its status at the right end of .wn-global (.wn-bf-act). */
.wn-br-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wn-br-top > div:first-child { flex: 1 1 240px; min-width: 0; }
.wn-pick { position: relative; }
.wn-pick-btn { display: inline-flex; align-items: center; gap: 8px; max-width: min(360px, 78vw); padding: 7px 12px; border: 0; border-radius: 10px;
  background: color-mix(in srgb, var(--White) 12%, transparent); color: var(--White); }
.wn-pick-btn:hover { background: color-mix(in srgb, var(--White) 20%, transparent); }
.wn-pick-btn:focus-visible { outline: 2px solid var(--YellowGreen); }
.wn-pick-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wn-pick-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: min(460px, calc(100vw - 16px)); border-radius: 16px; background: var(--White);
  box-shadow: 0 24px 64px color-mix(in srgb, var(--Primary) 30%, transparent); overflow: hidden; }
.wn-pick-pop .cs-search-field input { font-size: 14px; }
.wn-pick-count:not(:empty) { padding: 6px 16px 0; }
.wn-pick-list { height: auto; max-height: min(420px, 55vh); }
.wn-pick-row { justify-content: space-between; color: var(--Primary); }
.wn-pick-row:hover, .wn-pick-row.active { background: var(--Gainsboro); }
.wn-pick-row.current { box-shadow: inset 3px 0 0 var(--YellowGreen); }
.wn-pick-hit { text-decoration: underline; text-decoration-color: var(--YellowGreen); text-decoration-thickness: 2px; }
.wn-pick-head { padding: 10px 10px 4px; text-transform: uppercase; letter-spacing: .04em; }
.wn-bf-spin span { display: block; width: 18px; height: 18px; border: 2px solid var(--LightGray); border-top-color: var(--Primary); border-radius: 50%;
  animation: cs-spin 0.8s linear infinite; }
.wn-bf-spin[hidden] { display: none; }
.wn-bf-segs { display: contents; }
.wn-global .cs-seg-item[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.wn-bf-act { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; }
.wn-bf-btnrow { display: flex; align-items: center; gap: 10px; }
.wn-bf-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wn-bf-act { position: relative; }
@media (min-width: 768px) { .wn-bf-state { position: absolute; top: calc(100% + 2px); right: 0; white-space: nowrap; text-align: right; } }   /* under the button, in the row's bottom margin: the row stays one line */
.wn-bf-update[aria-disabled="true"] { opacity: .7; cursor: progress; }
@media (max-width: 767px) { .wn-bf-act { margin-left: 0; align-items: flex-start; } .wn-bf-state { text-align: left; } }
/* end Weinstein */

/* ---------------------------------------------------------------- TS caídos (/ts-caidos; tc_web.py, tc_caidos.js)
   Panel: three rows of three compact .asset-stat cards, with hover/focus explanations, the row .tc-tabrow = the «Temporalidad» dropdown
   (form .tc-tf: the template's native select .asset-select, 1M/1W/1D) and the market tabs .tc-tabs (links on .widget-menu-tab),
   result chip group .tc-chips (tf-button style-1 = chosen, style-2 = the others), the /activos table (.tc-table) with current market cap and the market pill .tc-mk beside the ticker and the cell
   «Manipulación: d/m/aaaa +X% (+tiempo)» (.tc-manip; «mes en curso» pill .tc-open). Asset view: .hist-head, the chart
   on .wg-box.bg-Primary (.tc-chart-box, note .tc-chart-note; tc_caidos.js moves the same dropdown, .tc-tf-chart, into the
   chart toolbar left of LOG/AUTO) and the history rows as buttons .tc-go.
   Line under the market tabs (.tc-line, tc_linea.js): the /weinstein breadth box copied (.wg-box.bg-Primary, dark .cs-seg
   .tc-dark-seg in .tc-line-dates, month boxes .tc-line-month in .tc-line-lab, status .tc-line-msg (visually hidden when
   empty, still a live region), monthly bars .tc-line-chart in .tc-line-plot with the template's table rules undone and its
   «Cargando…» .tc-line-wait, the month popup .tc-bar-pop (the template's white dropdown look: .tc-bar-head with the
   close button .tc-bar-x, one link .tc-bar-asset per asset), empty message .tc-line-empty, footnote .tc-line-note). */
.tc-tabs { margin-bottom: 16px; }
.tc-tabrow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin-bottom: 16px; }
.tc-tabrow .tc-tabs { flex: 1 1 320px; min-width: 0; margin-bottom: 0; }
.tc-tf { display: flex; margin: 0; }
/* TS caídos: simulation-template filter row, scoped so other strategy controls retain their layout. */
#tc-panel .tc-filters .asset-select { flex: 1 1 180px; max-width: none; min-width: 0; }
.box-status.tc-mk-etf { background-color: var(--LightSkyBlue); }
.box-status.tc-mk-indice { background-color: var(--LightSkyBlue); }
.tc-tabrow .asset-select { height: auto; min-height: 46px; }   /* as tall as the market tabs beside it */
.tc-tf-chart .asset-select { height: 40px; }
.tc-tabs .widget-menu-tab .item-title a { color: inherit; }
.tc-tabs .widget-menu-tab.style-1 { overflow-x: auto; }   /* four tabs (1W lists a commodity) scroll on a phone, as .hist-tabs */
.tc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-table .tc-name { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-table .asset-link { display: inline-flex; align-items: center; gap: 10px; }
.tc-table .box-status.tc-mk { margin-top: 6px; }
.box-status.tc-mk-acc { background-color: var(--LightSkyBlue); }
.box-status.tc-mk-cripto { background-color: var(--Orchid); }
.box-status.tc-mk-materia { background-color: var(--Khaki); }
.tc-manip { display: block; white-space: normal; }
.tc-row { cursor: pointer; }
.box-status.tc-open { display: inline-flex; margin-left: 6px; padding: 2px 8px; font-size: 10px; background-color: var(--Salmon); vertical-align: middle; }
.tc-go { all: unset; cursor: pointer; display: block; text-align: left; border-radius: 6px; }
.tc-go:hover .tc-manip { text-decoration: underline; }
.tc-go:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: 2px; }
.tc-chart-box { position: relative; }
.tc-chart-box #tc-chart { min-height: 480px; }
.tc-chart-note { margin-bottom: 8px; }
.tc-line { display: flex; flex-direction: column; gap: 10px; }
.tc-line-dates { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.tc-line-dates[hidden], .tc-line-chart[hidden], .tc-line-empty[hidden] { display: none; }
.tc-dark-seg { background: color-mix(in srgb, var(--White) 12%, transparent); }
.tc-dark-seg .cs-seg-item { padding: 4px 8px; color: var(--White); }
.tc-dark-seg .cs-seg-item.active { color: var(--Primary); }
.tc-line-lab { display: inline-flex; align-items: center; gap: 6px; }
.tc-line input.tc-line-month { width: 170px; padding: 4px 8px; font-size: 12px; color: var(--White); color-scheme: dark; border: 0;
  background: color-mix(in srgb, var(--White) 12%, transparent); }
.tc-line input.tc-line-month[aria-invalid="true"] { outline: 2px solid var(--Salmon); }
.tc-line-msg:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }   /* still a live region */
.tc-line-plot { position: relative; }
.tc-line-chart { position: relative; height: 380px; min-height: 280px; }
.tc-line-chart table { table-layout: auto; width: auto; margin: 0; }   /* the engine's own layout table (as .velas-chart) */
.tc-line-wait { padding-top: 8px; }
.tc-line-note { opacity: .8; }
.tc-line-note a { color: inherit; text-decoration: underline; }   /* the chart library's credit (no logo over the first bar) */
.tc-line h6:focus { outline: none; }   /* focus lands here when the popup closes from the keyboard */
.tc-bar-pop { position: absolute; z-index: 5; width: 260px; max-width: calc(100% - 8px); max-height: calc(100% - 8px); overflow-y: auto;
  padding: 8px 0; border-radius: 6px; background-color: var(--White); color: var(--Primary);
  box-shadow: 0px 1px 2px 0px rgba(255, 255, 255, 0.1) inset, 0px 8px 22px 0px rgba(4, 8, 16, 0.3); }   /* .dropdown.default > .dropdown-menu */
.tc-bar-pop[hidden] { display: none; }
.tc-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 6px 12px; }
.tc-bar-x { all: unset; cursor: pointer; width: 32px; height: 32px; line-height: 32px; text-align: center; border-radius: 6px; font-size: 18px; }
.tc-bar-x:hover, .tc-bar-asset:hover { background-color: color-mix(in srgb, var(--Primary) 6%, transparent); }
.tc-bar-pop ul { margin: 0; padding: 0; list-style: none; }
.tc-bar-asset { display: flex; flex-direction: column; min-height: 28px; padding: 6px 12px; color: var(--Primary); }
.tc-bar-asset:hover .f12-bold { text-decoration: underline; }
.tc-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-bar-x:focus-visible, .tc-bar-asset:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: -2px; }
/* Panel updates reuse the existing .cs-loading circle and cs-spin animation. */
#tc-panel .tc-reset { margin-left: auto; align-self: center; }
#tc-panel .tc-results { position: relative; }
#tc-panel .tc-busy { position: absolute; top: 12px; left: 0; right: 0; height: 28px; pointer-events: none; display: flex; align-items: center; justify-content: center; gap: 8px; }
#tc-panel .tc-busy[hidden], #tc-panel [data-tc-retry][hidden] { display: none; }
#tc-panel .tc-busy span.tc-busy-text { width: auto; height: auto; border: 0; border-radius: 6px; background: var(--White); padding: 4px 8px; animation: none; }
#tc-panel[aria-busy="true"] tbody { opacity: .5; pointer-events: none; }
#tc-panel [aria-disabled="true"] { opacity: .5; cursor: wait; }
#tc-panel .tc-load-msg { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
@media (prefers-reduced-motion: reduce) { #tc-panel .tc-busy span { animation: none; } }
/* Asset context uses the same card grid as Activos; all new layout stays inside this TS-only section. */
.tc-context { width: 100%; }
.tc-context .row { row-gap: 16px; }
.tc-context .wg-card { height: 100%; }
.tc-context .content, .tc-context .content > div { min-width: 0; width: 100%; }
.tc-context h6 { overflow-wrap: anywhere; }
.tc-context-tf { display: flex; flex-direction: column; width: 100%; padding: 8px 10px; text-align: center; }
.tc-context-tf + .tc-context-tf { margin-top: 6px; }
.tc-context-value { font-size: 16px; font-weight: 700; }
.tc-context-stages { display: inline-flex; margin: 8px 0; }
.tc-context-details summary { cursor: pointer; }
.tc-context-details summary:focus-visible { outline: 2px solid var(--YellowGreen); }
#tc-context [hidden] { display: none; }
.tc-context .asset-stat { padding: 16px; }
/* TS-only row alignment, exclusive context controls and historical date loading. */
#tc-panel .row { align-items: stretch; }
#tc-panel .row > div { display: flex; }
#tc-panel .asset-stat { width: 100%; height: 100%; min-height: 116px; padding: 20px; }
#tc-panel .tc-stat { position: relative; cursor: help; }
#tc-panel .tc-stat .content, #tc-panel .tc-stat .content > div { width: 100%; min-width: 0; }
#tc-panel .tc-stat-help { position: absolute; inset: 0; padding: 16px 20px; border-radius: inherit;
  background: inherit; overflow-y: auto; display: none; }
#tc-panel .tc-stat:hover .tc-stat-help, #tc-panel .tc-stat:focus .tc-stat-help { display: block; }
#tc-panel .tc-stat:focus-visible { outline: 2px solid var(--Primary); outline-offset: 3px; }
#tc-panel .tc-ticker-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#tc-panel .tc-ticker-row .tc-mk { margin: 0; }
#tc-panel[aria-busy="true"] #tc-cards, #tc-panel[aria-busy="true"] #tc-line { opacity: .5; }
#tc-panel .tc-tabrow .asset-select, #tc-panel .tc-reset { height: 56px; min-height: 56px; }
#tc-panel .tc-reset { align-self: stretch; }
#tc-panel .tc-tabs .widget-menu-tab.style-1 { min-height: 56px; padding: 8px; }
#tc-panel .tc-tabs .widget-menu-tab.style-1 .item-title { padding: 8px 12px; }
#tc-asset .tc-context-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin: 8px 0; }
#tc-asset .tc-date { display: flex; margin: 0; }
#tc-asset .tc-date input { height: 46px; min-height: 46px; width: 158px; padding: 0 12px; background-image: none; }
#tc-asset .tc-today { height: 46px; min-height: 46px; }
#tc-asset .tc-context-stages { margin: 0; min-height: 46px; align-items: center; }
#tc-asset .tc-context-stages .cs-seg-item { min-height: 36px; }
#tc-asset .tc-date-loading { justify-content: flex-end; gap: 8px; margin-top: 8px; }
#tc-asset .tc-date-loading[hidden] { display: none; }
#tc-asset[aria-busy="true"] .tc-context { opacity: .5; }
@media (max-width: 767px) { #tc-asset .tc-context-controls, #tc-asset .tc-date-loading { justify-content: flex-start; } }
/* end TS caídos */

/* ---------------------------------------------------------------- TS enteros (/ts-enteros; te_web.py, te_enteros.js)
   A copy of the TS caídos block (.tc-*) under its own .te-* names, so TS caídos can change without moving this page.
   Panel: three rows of three compact .asset-stat cards, with hover/focus explanations, the row .te-tabrow = the «Temporalidad» dropdown
   (form .te-tf: the template's native select .asset-select, 1M only for now) and the market tabs .te-tabs (links on .widget-menu-tab),
   result chip group .te-chips (tf-button style-1 = chosen, style-2 = the others), the /activos table (.te-table) with current market cap and the market pill .te-mk beside the ticker and the cell
   «Compra: d/m/aaaa +X% (+tiempo)» (.te-manip; «mes en curso» pill .te-open). Asset view: .hist-head, the chart
   on .wg-box.bg-Primary (.te-chart-box, note .te-chart-note; te_enteros.js moves the same dropdown, .te-tf-chart, into the
   chart toolbar left of LOG/AUTO) and the history rows as buttons .te-go.
   Line under the market tabs (.te-line, te_linea.js): the /weinstein breadth box copied (.wg-box.bg-Primary, dark .cs-seg
   .te-dark-seg in .te-line-dates, month boxes .te-line-month in .te-line-lab, status .te-line-msg (visually hidden when
   empty, still a live region), monthly bars .te-line-chart in .te-line-plot with the template's table rules undone and its
   «Cargando…» .te-line-wait, the month popup .te-bar-pop (the template's white dropdown look: .te-bar-head with the
   close button .te-bar-x, one link .te-bar-asset per asset), empty message .te-line-empty, footnote .te-line-note). */
.te-tabs { margin-bottom: 16px; }
.te-tabrow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin-bottom: 16px; }
.te-tabrow .te-tabs { flex: 1 1 320px; min-width: 0; margin-bottom: 0; }
.te-tf { display: flex; margin: 0; }
/* TS enteros: the simulation template's equal native dropdowns. */
#te-panel .te-filters .asset-select { flex: 1 1 180px; max-width: none; min-width: 0; }
@media (max-width: 767px) { #te-panel .te-filters .asset-select { flex-basis: 100%; } }
#te-panel .box-status.te-mk-etf { background-color: var(--LightSkyBlue); }
.te-tabrow .asset-select { height: auto; min-height: 46px; }   /* as tall as the market tabs beside it */
.te-tf-chart .asset-select { height: 40px; }
.te-tabs .widget-menu-tab .item-title a { color: inherit; }
.te-tabs .widget-menu-tab.style-1 { overflow-x: auto; }   /* four tabs (1W lists a commodity) scroll on a phone, as .hist-tabs */
.te-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.te-table .te-name { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-table .asset-link { display: inline-flex; align-items: center; gap: 10px; }
.te-table .box-status.te-mk { margin-top: 6px; }
.box-status.te-mk-acc { background-color: var(--LightSkyBlue); }
.box-status.te-mk-cripto { background-color: var(--Orchid); }
.box-status.te-mk-materia { background-color: var(--Khaki); }
.te-manip { display: block; white-space: normal; }
.te-row { cursor: pointer; }
.box-status.te-open { display: inline-flex; margin-left: 6px; padding: 2px 8px; font-size: 10px; background-color: var(--Salmon); vertical-align: middle; }
.te-go { all: unset; cursor: pointer; display: block; text-align: left; border-radius: 6px; }
.te-go:hover .te-manip { text-decoration: underline; }
.te-go:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: 2px; }
.te-chart-box { position: relative; }
.te-chart-box #te-chart { min-height: 480px; }
.te-chart-note { margin-bottom: 8px; }
.te-line { display: flex; flex-direction: column; gap: 10px; }
.te-line-dates { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.te-line-dates[hidden], .te-line-chart[hidden], .te-line-empty[hidden], .te-line .wn-ma[hidden] { display: none; }
.te-dark-seg { background: color-mix(in srgb, var(--White) 12%, transparent); }
.te-dark-seg .cs-seg-item { padding: 4px 8px; color: var(--White); }
.te-dark-seg .cs-seg-item.active { color: var(--Primary); }
.te-line-lab { display: inline-flex; align-items: center; gap: 6px; }
.te-line input.te-line-month { width: 170px; padding: 4px 8px; font-size: 12px; color: var(--White); color-scheme: dark; border: 0;
  background: color-mix(in srgb, var(--White) 12%, transparent); }
.te-line input.te-line-month[aria-invalid="true"] { outline: 2px solid var(--Salmon); }
.te-line-msg:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }   /* still a live region */
.te-line-plot { position: relative; }
.te-line-chart { position: relative; height: 380px; min-height: 280px; }
.te-line-chart table { table-layout: auto; width: auto; margin: 0; }   /* the engine's own layout table (as .velas-chart) */
.te-line-wait { padding-top: 8px; }
.te-line-note { opacity: .8; }
.te-line-note a { color: inherit; text-decoration: underline; }   /* the chart library's credit (no logo over the first bar) */
.te-line h6:focus { outline: none; }   /* focus lands here when the popup closes from the keyboard */
.te-bar-pop { position: absolute; z-index: 5; width: 260px; max-width: calc(100% - 8px); max-height: calc(100% - 8px); overflow-y: auto;
  padding: 8px 0; border-radius: 6px; background-color: var(--White); color: var(--Primary);
  box-shadow: 0px 1px 2px 0px rgba(255, 255, 255, 0.1) inset, 0px 8px 22px 0px rgba(4, 8, 16, 0.3); }   /* .dropdown.default > .dropdown-menu */
.te-bar-pop[hidden] { display: none; }
.te-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 6px 12px; }
.te-bar-x { all: unset; cursor: pointer; width: 32px; height: 32px; line-height: 32px; text-align: center; border-radius: 6px; font-size: 18px; }
.te-bar-x:hover, .te-bar-asset:hover { background-color: color-mix(in srgb, var(--Primary) 6%, transparent); }
.te-bar-pop ul { margin: 0; padding: 0; list-style: none; }
.te-bar-asset { display: flex; flex-direction: column; min-height: 28px; padding: 6px 12px; color: var(--Primary); }
.te-bar-asset:hover .f12-bold { text-decoration: underline; }
.te-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-bar-x:focus-visible, .te-bar-asset:focus-visible { outline: 2px solid var(--YellowGreen); outline-offset: -2px; }
/* Panel updates reuse the existing .cs-loading circle and cs-spin animation. */
#te-panel .te-reset { margin-left: auto; align-self: center; }
#te-panel .te-results { position: relative; }
#te-panel .te-busy { position: absolute; top: 12px; left: 0; right: 0; height: 28px; pointer-events: none; display: flex; align-items: center; justify-content: center; gap: 8px; }
#te-panel .te-busy[hidden], #te-panel [data-te-retry][hidden] { display: none; }
#te-panel .te-busy span.te-busy-text { width: auto; height: auto; border: 0; border-radius: 6px; background: var(--White); padding: 4px 8px; animation: none; }
#te-panel[aria-busy="true"] tbody { opacity: .5; pointer-events: none; }
#te-panel [aria-disabled="true"] { opacity: .5; cursor: wait; }
#te-panel .te-load-msg { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
@media (prefers-reduced-motion: reduce) { #te-panel .te-busy span { animation: none; } }
/* Asset context uses the same card grid as Activos; all new layout stays inside this TS-only section. */
.te-context { width: 100%; }
.te-context .row { row-gap: 16px; }
.te-context .wg-card { height: 100%; }
.te-context .content, .te-context .content > div { min-width: 0; width: 100%; }
.te-context h6 { overflow-wrap: anywhere; }
.te-context-tf { display: flex; flex-direction: column; width: 100%; padding: 8px 10px; text-align: center; }
.te-context-tf + .te-context-tf { margin-top: 6px; }
.te-context-value { font-size: 16px; font-weight: 700; }
.te-context-stages { display: inline-flex; margin: 8px 0; }
.te-context-details summary { cursor: pointer; }
.te-context-details summary:focus-visible { outline: 2px solid var(--YellowGreen); }
#te-context [hidden] { display: none; }
.te-context .asset-stat { padding: 16px; }
/* TS-only row alignment, exclusive context controls and historical date loading. */
#te-panel .row { align-items: stretch; }
#te-panel .row > div { display: flex; }
#te-panel .asset-stat { width: 100%; height: 100%; min-height: 116px; padding: 20px; }
#te-panel .te-stat { position: relative; cursor: help; }
#te-panel .te-stat .content, #te-panel .te-stat .content > div { width: 100%; min-width: 0; }
#te-panel .te-stat-help { position: absolute; inset: 0; padding: 16px 20px; border-radius: inherit;
  background: inherit; overflow-y: auto; display: none; }
#te-panel .te-stat:hover .te-stat-help, #te-panel .te-stat:focus .te-stat-help { display: block; }
#te-panel .te-stat:focus-visible { outline: 2px solid var(--Primary); outline-offset: 3px; }
#te-panel .te-ticker-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#te-panel .te-ticker-row .te-mk { margin: 0; }
#te-panel[aria-busy="true"] #te-cards, #te-panel[aria-busy="true"] #te-line { opacity: .5; }
#te-panel .te-tabrow .asset-select, #te-panel .te-reset { height: 56px; min-height: 56px; }
#te-panel .te-reset { align-self: stretch; }
#te-panel .te-tabs .widget-menu-tab.style-1 { min-height: 56px; padding: 8px; }
#te-panel .te-tabs .widget-menu-tab.style-1 .item-title { padding: 8px 12px; }
#te-asset .te-context-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin: 8px 0; }
#te-asset .te-date { display: flex; margin: 0; }
#te-asset .te-date input { height: 46px; min-height: 46px; width: 158px; padding: 0 12px; background-image: none; }
#te-asset .te-today { height: 46px; min-height: 46px; }
#te-asset .te-context-stages { margin: 0; min-height: 46px; align-items: center; }
#te-asset .te-context-stages .cs-seg-item { min-height: 36px; }
#te-asset .te-date-loading { justify-content: flex-end; gap: 8px; margin-top: 8px; }
#te-asset .te-date-loading[hidden] { display: none; }
#te-asset[aria-busy="true"] .te-context { opacity: .5; }
@media (max-width: 767px) { #te-asset .te-context-controls, #te-asset .te-date-loading { justify-content: flex-start; } }
/* end TS enteros */
/* Ondas de Weinstein (/ondas-weinstein) — cards .od-stat (template .wg-card.asset-stat, explanation on hover/focus),
   chart box .od-chart-box (Velas on bg-Primary), operations table .od-table (the /activos table look). */
#od-app .od-cards .row { align-items: stretch; }
#od-app .od-cards .row > div { display: flex; }
#od-app .od-stat { position: relative; width: 100%; height: 100%; min-height: 116px; padding: 20px; cursor: help; }
#od-app .od-stat .content, #od-app .od-stat .content > div { width: 100%; min-width: 0; }
#od-app .od-stat-help { position: absolute; top: 0; left: 0; right: 0; min-height: 100%; z-index: 5; padding: 16px 20px;
  border-radius: inherit; background: inherit; display: none; }
#od-app .od-stat:hover .od-stat-help, #od-app .od-stat:focus .od-stat-help { display: block; }
#od-app .od-stat.od-quiet .od-stat-help { display: none; }
#od-app .od-stat:focus-visible { outline: 2px solid var(--Primary); outline-offset: 3px; }
#od-app .od-intro { margin-top: 16px; max-width: 980px; }
#od-app .od-group { margin-bottom: 12px; }
#od-app .od-chart-head { margin-bottom: 12px; }
#od-app .od-chart-head h6 { margin-bottom: 4px; }
#od-app .od-table-head { margin-bottom: 12px; }
#od-app .od-table td, #od-app .od-table th { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
#od-app .od-table td:first-child, #od-app .od-table th:first-child { padding-left: 16px; }
#od-app .od-table td:last-child, #od-app .od-table th:last-child { padding-right: 16px; }
#od-app .od-table .num { text-align: right; }
@media (max-width: 767px) { #od-app .od-stat { min-height: 0; padding: 16px; } }
/* end Ondas de Weinstein */

/* Historical date control: same native input and tokens as the TS context date. */
.wn-mx input.asset-select { height: 46px; min-height: 46px; width: 158px; padding: 0 12px; background-color: var(--Gainsboro); background-image: none; }

/* TheStrat A1: shared card tables, scanner controls and multi-period Velas. */
.strat-controls { display:flex; flex-wrap:wrap; gap:16px; align-items:end; }
.strat-controls label { display:flex; flex-direction:column; gap:8px; }
.strat-controls select, .strat-controls input:not([type=checkbox]) { max-width:100%; }
.strat-controls label:has(input[type=checkbox]) { flex-direction:row; align-items:center; }
.strat-app .strat-table { min-width:1350px; }
.strat-app .strat-grid table { width:max-content; min-width:100%; }
.strat-grid th[data-column="code"],.strat-grid td[data-column="code"] { position:sticky; left:0; z-index:1; background:var(--Gainsboro); }
.strat-grid th[data-column="code"] { background:var(--Primary); z-index:2; }
.strat-column-sort { background:transparent; border:0; white-space:nowrap; padding:0; }
.strat-asset { border:0; background:transparent; color:var(--Primary); text-align:left; }
.strat-name { max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.strat-column-control { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.strat-column-control label { min-width:150px; }
.strat-column-control button { padding:6px 10px; }
.strat-chart-dialog { width:min(1300px,96vw); max-height:92vh; overflow:auto; }
.strat-charts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:16px; }
.strat-charts>.wg-box { min-width:0; padding:16px; }
.strat-app :focus-visible { outline:2px solid var(--Green); outline-offset:3px; }
@media (max-width:1000px) { .strat-charts { grid-template-columns:1fr; } }
@media (max-width:575px) { .strat-controls>label { flex:1 1 140px; min-width:0; } .strat-controls select,.strat-controls input { width:100%; } .strat-controls input[type=checkbox] { width:auto; } .strat-column-control { flex-wrap:wrap; } }
.strat-column-filter-box { display:flex; flex-direction:column; gap:8px; flex:1 1 200px; max-width:320px; }
.strat-filter-condition { display:flex; gap:8px; }
.strat-filter-condition input,.strat-filter-condition select { min-width:0; width:50%; }
.strat-column-filter { display:block; background:transparent; border:0; margin-top:8px; padding:0; }
/* «Simulación» tab of /weinstein (wn_sim.js, card kmvde8jg4vadb): the /simulaciones/plantilla cards (.asset-stat.te-stat with
   their hover/focus explanation), its dark chart box (.te-line) and tables (.te-table), scoped to #wn-sim. */
#wn-sim .row { align-items: stretch; }
#wn-sim .row > div { display: flex; }
#wn-sim .asset-stat { width: 100%; height: 100%; min-height: 116px; padding: 20px; }
#wn-sim .te-stat { position: relative; cursor: help; }
#wn-sim .te-stat .content, #wn-sim .te-stat .content > div { width: 100%; min-width: 0; }
#wn-sim .te-stat-help { position: absolute; inset: 0; padding: 16px 20px; border-radius: inherit; background: inherit; overflow-y: auto; display: none; }
#wn-sim .te-stat:hover .te-stat-help, #wn-sim .te-stat:focus .te-stat-help { display: block; }
#wn-sim .te-stat:focus-visible { outline: 2px solid var(--Primary); outline-offset: 3px; }
#wn-sim .sim-filters .asset-select { flex: 1 1 180px; max-width: none; min-width: 0; height: 56px; min-height: 56px; }
#wn-sim .te-reset { height: 56px; min-height: 56px; margin-left: auto; }
#wn-sim .te-chips .box-status { white-space: normal; }
#wn-sim .sim-more { display: flex; justify-content: center; margin-top: 16px; }
#wn-sim .sim-more [hidden] { display: none; }
#wn-sim .sim-limits { padding-left: 18px; list-style: disc; }
#wn-sim[aria-busy="true"] #sim-cards, #wn-sim[aria-busy="true"] .te-results { opacity: .6; }
#wn-sim .te-table td { white-space: normal; }     /* long category paths and rule names wrap instead of widening the table */
#wn-sim .te-table td.num { white-space: nowrap; }
#wn-sim #sim-table td:nth-child(2), #wn-sim #sim-open td:first-child { min-width: 220px; }
#wn-sim #sim-hyp td:first-child { min-width: 280px; }

/* Benchmark operations retain the catalogue spinner, blur, and button styles. */
#benchmark-app .benchmark-busy { flex-direction: column; }
#benchmark-app #benchmark-busy { position: fixed; z-index: 1100; }
#benchmark-app #benchmark-comparison-keys { max-height: 240px; overflow: auto; }

#benchmark-app #benchmark-read { max-height: 96px; overflow: auto; }

/* NYAD v1: reference indices, original counts and daily oscillator share one timeline. */
#haller-app[data-nyad-oscillator] .wn-br-chart { height: 1320px; min-height: 1320px; }
@media (max-width: 767px) {
  #haller-app[data-nyad-oscillator] .wn-br-chart { height: 1600px; min-height: 1600px; }
}

/* Pane-aligned NYAD filters reuse the catalogue keys and background. */
#haller-app[data-nyad-indices] .nyad-chart-wrap { position: relative; }
#haller-app[data-nyad-indices] .nyad-pane-controls { padding: 12px 0; }
#haller-app[data-nyad-indices] .nyad-pane-controls > * + * { margin-top: 8px; }
#haller-app[data-nyad-indices] [data-pane-controls-ready] .nyad-pane-controls { position: absolute; left: 0; right: 0; z-index: 2; }
#haller-app[data-nyad-indices] #haller-highs-chart[hidden] + .nyad-pane-controls { position: static; }

/* Tops: while the first load or a timeframe change is on its way, a blurred full-screen veil with the catalogue loading circle (.cs-loading, cs-spin). */
#tops-app .tops-busy, #mt-busy.tops-busy { position: fixed; inset: 0; z-index: 1100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: color-mix(in srgb, var(--Primary) 35%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--White); }
#tops-app .tops-busy[hidden], #mt-busy.tops-busy[hidden] { display: none; }
#tops-app .tops-busy .cs-loading, #mt-busy.tops-busy .cs-loading { position: static; }
#tops-app .tops-busy .cs-loading span, #mt-busy.tops-busy .cs-loading span { width: 48px; height: 48px; border-width: 4px; border-color: color-mix(in srgb, var(--White) 35%, transparent); border-top-color: var(--YellowGreen); }
@media (prefers-reduced-motion: reduce) { #tops-app .tops-busy .cs-loading span, #mt-busy.tops-busy .cs-loading span { animation-duration: 2.4s; } }
/* «Señal: top v2» danger colours by timeframe (dot, line, filter chip, table): the template has no deep red or orange */
#tops-app { --TopD: #C00000; --TopS: #FF5722; --TopM: #FF9800; }
/* «Señal: bottom v1» on Bottoms (dot, line, filter chip, table): greens by timeframe, the deepest on D (its dots sat
   closest to the lows): deep, mid and light green (the template has only --Green, which the oscillator line already uses) */
#tops-app[data-bottoms] { --BotD: #0B6B2C; --BotS: #1E8449; --BotM: #7ED39A; }

/* Macrotécnica asset chart (/macrotecnica?activo=) and its comparison charts (Datos tab): the Pine's color.teal for 60-119-bar
   Darvas boxes; the template has no teal variable, so this is its own teal theme colour (theme-primary-35988D). */
[data-mt-asset], [data-mt-panel] { --Teal: #35988D; }
/* Macrotécnica: the asset view's Resumen | Macrotécnicos switch (.cs-seg) next to the name wraps under it on narrow screens;
   the comparison charts' veil is Tops' (#mt-busy.tops-busy above). */
[data-mt-asset] .hist-id { flex-wrap: wrap; }

/* /test, strategy report (informe.js, card kmwepjhitmpqa): the /oscilador panel (#te-panel[data-sim-template]: .te-stat
   cards, .te-line chart box, .te-table) laid out as a TradeSearcher report. Equity chart legend .inf-legend with swatches
   .inf-swatch (--sw colour; .inf-dash dashed line, .inf-bar column); AUTO button .inf-auto; audit box .inf-audit (score
   ring .inf-ring: .inf-ring-bg track, .inf-ring-fg arc, tones .type-Khaki / .type-Salmon as the bars; sub-scores
   .inf-parts with the template's .tf-progress-bar plus tones .type-Khaki / .type-Salmon (only inside [data-informe]); quality line .inf-gate-ok |
   -avisos | -fallo; checks .inf-check-pass | -fail | -na); label/value lists .inf-kv = the template's .card-details with
   full-width .left columns. */
[data-informe] .te-line-chart[hidden], [data-informe] .te-line-dates[hidden] { display: none; }
.inf-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.inf-legend li { display: inline-flex; align-items: center; gap: 6px; }
.inf-swatch { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--sw); }
.inf-swatch.inf-dash { background: repeating-linear-gradient(90deg, var(--sw) 0 4px, transparent 4px 7px); }
.inf-swatch.inf-bar { width: 8px; height: 10px; opacity: .6; }
.inf-auto.cs-seg-item { padding: 4px 8px; color: var(--White); background: color-mix(in srgb, var(--White) 12%, transparent); border-radius: 6px; }
.inf-audit { display: flex; flex-direction: column; gap: 16px; height: 100%; }
.inf-audit > .title { border-bottom: 1px solid var(--LightGray); padding-bottom: 12px; }
.inf-audit > .title h6 { display: flex; align-items: center; gap: 8px; }
.inf-score { display: flex; align-items: center; gap: 14px; }
.inf-score h5 { margin: 2px 0; }
.inf-ring { flex: none; width: 64px; height: 64px; }
.inf-ring circle { fill: none; stroke-width: 3.2; }
.inf-ring-bg { stroke: var(--LightGray); }
.inf-ring-fg { stroke: var(--YellowGreen); stroke-linecap: round; }
.inf-ring-fg.type-Khaki { stroke: var(--Khaki); }
.inf-ring-fg.type-Salmon { stroke: var(--Salmon); }
.inf-ring text { font-size: 9px; font-weight: 700; fill: var(--Primary); }
.inf-parts { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.inf-part-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
[data-informe] .tf-progress-bar.type-Khaki { background-color: color-mix(in srgb, var(--Khaki) 25%, transparent); }
[data-informe] .tf-progress-bar.type-Khaki span { background-color: var(--Khaki); }
[data-informe] .tf-progress-bar.type-Salmon { background-color: color-mix(in srgb, var(--Salmon) 18%, transparent); }
[data-informe] .tf-progress-bar.type-Salmon span { background-color: var(--Salmon); }
.inf-gate { padding: 8px 12px; border-radius: 8px; background: var(--Gainsboro); }
.inf-gate:empty { display: none; }
.inf-gate-ok { background: color-mix(in srgb, var(--YellowGreen) 35%, transparent); }
.inf-gate-avisos { background: color-mix(in srgb, var(--Khaki) 45%, transparent); }
.inf-gate-fallo { background: color-mix(in srgb, var(--Salmon) 35%, transparent); }
.inf-checks summary { cursor: pointer; }
.inf-checks ul { margin: 8px 0 0; padding-left: 18px; list-style: disc; }
.inf-check-fail { color: var(--Salmon); }
.inf-kv { width: 100%; height: auto; gap: 16px; }
.inf-kv > .title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.inf-kv .content { gap: 24px; }
.inf-kv .content .left { width: 100%; min-width: 0; }
.inf-kv .left li { gap: 16px; }
.inf-kv .left li > :first-child { flex: none; max-width: 45%; }
.inf-kv .left li > :last-child { text-align: right; }
[data-informe] .sim-filters .asset-select { flex: 0 1 360px; }   /* one select: as wide as /oscilador's two, not the whole row */
@media (max-width: 767px) { .inf-kv .content { flex-direction: column; gap: 12px; } .inf-kv .left li:last-child { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--LightGray); } }
