/* ===========================================
   BullAnalytics · Dashboard y panel Mercado
   Tokens y componentes de los módulos nuevos
   =========================================== */

:root {
    /* Alias semánticos: los gráficos y las vistas usan estos nombres, no los de marca,
       así un cambio de identidad se hace en un solo lugar. */
    --color-brand: var(--color-primary, #28a745);
    --color-brand-strong: var(--color-primary-dark, #218838);
    --color-brand-soft: var(--color-primary-light, #e8f5e9);
    --color-ink: #111827;
    --color-muted: #6b7280;
    --color-faint: #9ca3af;
    --color-surface: #ffffff;
    --color-surface-2: #f9fafb;
    --color-surface-3: #f3f4f6;
    --color-line: #e5e7eb;
    --color-line-strong: #d1d5db;
    --color-success: #16a34a;
    --color-success-bg: #dcfce7;
    --color-warning: #d97706;
    --color-warning-strong: #b45309;
    --color-warning-bg: #fef3c7;
    --color-danger: #dc2626;
    --color-danger-bg: #fee2e2;
    --color-info: #2563eb;
    --color-info-bg: #dbeafe;

    --radius-card: 14px;
    --radius-control: 10px;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, .04);
}

html.dark {
    --color-ink: #f9fafb;
    --color-muted: #9ca3af;
    --color-faint: #6b7280;
    --color-surface: #1f2937;
    --color-surface-2: #182030;
    --color-surface-3: #263244;
    --color-line: #374151;
    --color-line-strong: #4b5563;
    --color-brand-soft: rgba(40, 167, 69, .16);
    --color-success: #4ade80;
    --color-success-bg: rgba(22, 163, 74, .18);
    --color-warning: #fbbf24;
    --color-warning-strong: #fbbf24;
    --color-warning-bg: rgba(217, 119, 6, .18);
    --color-danger: #f87171;
    --color-danger-bg: rgba(220, 38, 38, .18);
    --color-info: #60a5fa;
    --color-info-bg: rgba(37, 99, 235, .18);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .35);
}

/* ==== Shell ==== */
.market-page,
.dashboard-page {
    background: var(--color-surface-3);
    color: var(--color-ink);
    font-family: var(--font-family, 'Inter', system-ui, sans-serif);
}

.market-page .wrap,
.dashboard-page .wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.market-page .nav,
.dashboard-page .nav {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--color-surface) 94%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-line);
}

.market-page .nav-inner,
.dashboard-page .nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

a.brand {
    text-decoration: none;
    color: inherit;
}

a.brand:hover .brand-em {
    color: var(--color-brand-strong);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 16.5px;
    letter-spacing: -0.03em;
    white-space: nowrap;
    flex: 0 0 auto;
}

.brand-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--color-brand);
    display: grid;
    place-items: center;
    color: #fff;
    flex: 0 0 auto;
}

.brand-mark svg {
    width: 17px;
    height: 17px;
}

.brand-em {
    color: var(--color-brand);
}

.nav-links {
    display: flex;
    gap: 4px;
    margin-left: 12px;
    overflow: visible;
    scrollbar-width: none;
    min-width: 0;
    flex: 0 1 auto;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links a {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-muted);
    text-decoration: none;
    padding: 7px 11px;
    border-radius: 8px;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-brand-strong);
    background: var(--color-brand-soft);
}

html.dark .nav-links a.active,
html.dark .nav-links a:hover {
    color: var(--color-brand);
}

.nav-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-muted);
    background: transparent;
    border: 0;
    padding: 7px 11px;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle,
.nav-dropdown-toggle.active {
    color: var(--color-brand-strong);
    background: var(--color-brand-soft);
}

html.dark .nav-dropdown-toggle:hover,
html.dark .nav-dropdown.open .nav-dropdown-toggle,
html.dark .nav-dropdown-toggle.active {
    color: var(--color-brand);
}

.nav-dropdown-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.nav-dropdown.open .nav-dropdown-toggle svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    padding: 6px;
    border-radius: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    box-shadow: var(--shadow-card);
    z-index: 60;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-dropdown-menu a {
    display: block;
    width: 100%;
    text-align: left;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu-btn,
.icon-btn.nav-menu-btn {
    display: none;
}

@media (max-width: 860px) {
    .nav-menu-btn,
    .icon-btn.nav-menu-btn {
        display: inline-grid;
        place-items: center;
    }

    .nav-links {
        display: none;
    }

    .nav.is-open .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin: 0;
        padding: 8px 12px 12px;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-line);
        z-index: 40;
    }

    .nav.is-open .nav-dropdown-menu {
        display: flex;
        position: static;
        min-width: 0;
        padding: 0 0 4px 8px;
        border: 0;
        box-shadow: none;
        background: transparent;
    }
}

.search,
.search-host {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
    border-radius: 999px;
    padding: 0 14px;
    height: 34px;
    width: 210px;
    color: var(--color-faint);
    font-size: 13px;
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: auto;
    right: 0;
    min-width: 280px;
    max-width: calc(100vw - 24px);
    max-height: 320px;
    overflow: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    z-index: 40;
    padding: 6px;
}

.search-dropdown-item {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 4px 10px;
    align-items: baseline;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--color-ink);
    border-radius: var(--radius-control);
    padding: 8px 10px;
    cursor: pointer;
    font-family: inherit;
}

.search-dropdown-item:hover,
.search-dropdown-item.is-active {
    background: var(--color-brand-soft);
}

.search-dropdown-symbol {
    font-weight: 800;
    font-size: 12.5px;
}

.search-dropdown-name {
    font-size: 12.5px;
    color: var(--color-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-dropdown-meta {
    font-size: 11px;
    color: var(--color-faint);
}

.search-dropdown-status {
    padding: 12px;
    font-size: 12.5px;
    color: var(--color-muted);
}

.search input {
    border: none;
    background: transparent;
    color: var(--color-ink);
    font-family: inherit;
    font-size: 13px;
    width: 100%;
    outline: none;
}

.search svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.page-search {
    display: none;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--color-line);
    background: var(--color-surface-2);
    color: var(--color-muted);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    cursor: pointer;
}

.icon-btn:hover {
    color: var(--color-brand-strong);
    border-color: var(--color-brand);
}

.icon-btn svg {
    width: 17px;
    height: 17px;
}

/* ==== Cabecera de página ==== */
.page-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 30px 0 18px;
}

.page-head h1 {
    font-size: clamp(24px, 3.2vw, 32px);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.page-head .sub {
    font-size: 14px;
    color: var(--color-muted);
    margin-top: 4px;
}

.page-meta {
    text-align: right;
    font-size: 11.5px;
    color: var(--color-faint);
    line-height: 1.7;
}

/* ==== Filtros ==== */
.market-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 16px;
}

.catalog-tabs {
    display: flex;
    flex: 1 1 auto;
    gap: 2px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--color-line);
}

.catalog-tabs::-webkit-scrollbar {
    display: none;
}

.catalog-tab {
    border: none;
    background: transparent;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.catalog-tab.active {
    color: var(--color-brand);
    border-bottom-color: var(--color-brand);
}

.catalog-tab:hover {
    color: var(--color-ink);
}

.page-head-market {
    display: block;
}

.page-meta-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    text-align: left;
    font-size: 12px;
}

.catalog-menu {
    position: relative;
}

.catalog-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 38px;
    padding: 0 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-line-strong);
    border-radius: var(--radius-control);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.catalog-menu-trigger {
    color: var(--color-ink);
    font-size: 13px;
}

.catalog-menu-trigger:hover,
.catalog-menu-trigger:focus-visible {
    border-color: var(--color-brand);
}

.catalog-menu-trigger:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.catalog-menu-icon {
    display: inline-flex;
    color: var(--color-brand);
}

.catalog-menu-label {
    white-space: nowrap;
}

.catalog-menu-caret {
    display: inline-flex;
    color: var(--color-muted);
    transition: transform .15s ease;
}

.catalog-menu.open .catalog-menu-caret {
    transform: rotate(180deg);
}

.catalog-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 224px;
    padding: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-control);
    box-shadow: var(--shadow-card);
}

.catalog-menu-panel[hidden] {
    display: none;
}

.catalog-menu-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--color-ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.catalog-menu-option:hover,
.catalog-menu-option.highlighted {
    background: var(--color-surface-2);
}

.catalog-menu-option.active {
    color: var(--color-brand-strong);
    font-weight: 600;
}

.catalog-menu-option-icon {
    display: inline-flex;
    color: var(--color-muted);
}

.catalog-menu-option.active .catalog-menu-option-icon,
.catalog-menu-option.active .catalog-menu-option-check {
    color: var(--color-brand);
}

.catalog-menu-option-label {
    flex: 1 1 auto;
}

.catalog-menu-option-check {
    display: inline-flex;
    color: var(--color-brand);
    opacity: 0;
}

.catalog-menu-option.active .catalog-menu-option-check {
    opacity: 1;
}

.filters-panel .advanced-toggle {
    margin-bottom: 12px;
}

@media (max-width: 760px) {
    .market-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .catalog-menu,
    .catalog-menu-trigger {
        width: 100%;
    }
}

.market-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-muted);
}

.market-pagination .btn {
    padding: 6px 12px;
}

.segmented {
    display: inline-flex;
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-control);
    padding: 3px;
    gap: 2px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
    display: none;
}

.segmented-btn {
    border: none;
    background: transparent;
    color: var(--color-muted);
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.segmented-btn.active {
    background: var(--color-surface);
    color: var(--color-ink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-muted);
    cursor: pointer;
    user-select: none;
}

.advanced-toggle .switch {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--color-line-strong);
    position: relative;
    transition: background-color .15s ease;
}

.advanced-toggle .switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #fff;
    transition: transform .15s ease;
}

.advanced-toggle input:checked + .switch {
    background: var(--color-brand);
}

.advanced-toggle input:checked + .switch::after {
    transform: translateX(16px);
}

/* ==== Tarjetas ==== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 18px;
}

.card-pad {
    padding: 18px 20px;
}

.card-accent {
    border-left: 4px solid var(--color-brand);
}

.card-accent.danger {
    border-left-color: var(--color-danger);
}

.card-accent.muted {
    border-left-color: var(--color-faint);
}

.card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.card-head h2 {
    font-size: 15px;
    font-weight: 700;
}

.card-head .stamp {
    margin-left: auto;
    font-size: 11px;
    color: var(--color-faint);
    font-weight: 500;
}

.card-sub {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 5px;
}

.brief-headline {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink);
    margin-top: 8px;
}

.card-foot-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-brand-strong);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

html.dark .card-foot-link {
    color: var(--color-brand);
}

.dash-pulse-flash {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-control);
    border: 1px solid var(--color-line);
    background: var(--color-brand-soft);
    color: var(--color-ink);
    font-size: 12px;
    line-height: 1.45;
}

.dash-pulse-flash.muted {
    background: var(--color-surface-2);
    color: var(--color-muted);
}

.dash-pulse-flash svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--color-brand);
}

.dash-pulse-flash.muted svg {
    color: var(--color-muted);
}

.dash-pulse-flash a,
.dash-inline-link {
    color: var(--color-brand-strong);
    font-weight: 600;
    text-decoration: none;
}

html.dark .dash-pulse-flash a,
html.dark .dash-inline-link {
    color: var(--color-brand);
}

.dash-pulse-flash a:hover,
.dash-inline-link:hover {
    text-decoration: underline;
}

.dash-pulse-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.dash-pulse-actions button.card-foot-link {
    border: none;
    background: transparent;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.news-prefs-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 18px 14px;
    padding: 12px 14px;
    border-radius: var(--radius-control);
    border: 1px solid var(--color-line);
    background: var(--color-brand-soft);
}

.news-prefs-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.news-prefs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.news-prefs-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-ink);
}

.news-prefs-field select {
    padding: 8px 10px;
    border-radius: var(--radius-control);
    border: 1px solid var(--color-line-strong);
    background: var(--color-surface);
    color: var(--color-ink);
    font-family: inherit;
    font-size: 13px;
}

.news-prefs-fieldset {
    border: 1px solid var(--color-line);
    border-radius: var(--radius-control);
    padding: 12px 14px;
    margin: 0;
}

.news-prefs-fieldset legend {
    padding: 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-ink);
}

.news-prefs-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 12px;
}

.news-prefs-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-ink);
    cursor: pointer;
}

.news-prefs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 700px) {
    .news-prefs-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==== KPIs ==== */
.kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.kpi {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-card);
    padding: 14px 16px 15px;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.kpi-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-top: 6px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.kpi-value.up {
    color: var(--color-success);
}

.kpi-value.down {
    color: var(--color-danger);
}

.kpi-value.muted {
    color: var(--color-faint);
}

.kpi-note {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-note.warn {
    color: var(--color-warning);
}

.kpi-spark {
    position: absolute;
    right: 12px;
    top: 40px;
    width: 46px;
    height: 30px;
}

.sparkline {
    display: block;
}

/* ==== Sectores (dashboard) ==== */
.sectors-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, .85fr);
    gap: 16px;
    margin-bottom: 18px;
    align-items: start;
}

.dashboard-sectors .sect-head {
    padding: 16px 18px 10px;
}

.dashboard-sectors .sect-head h2 {
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-sectors .sect-head h2 svg {
    width: 18px;
    height: 18px;
    color: var(--color-brand);
}

.dashboard-sectors .sect-head p {
    font-size: 13px;
    color: var(--color-muted);
    margin-top: 4px;
}

.dashboard-sectors .rank-table {
    width: 100%;
    overflow-x: auto;
}

.dashboard-sectors .rank-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.dashboard-sectors .rank-table th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-faint);
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-line);
}

.dashboard-sectors .rank-table th.num,
.dashboard-sectors .rank-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dashboard-sectors .rank-row {
    cursor: pointer;
}

.dashboard-sectors .rank-row td {
    padding: 9px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--color-line);
    vertical-align: middle;
}

.dashboard-sectors .rank-row:last-child td {
    border-bottom: none;
}

.dashboard-sectors .rank-row:hover,
.dashboard-sectors .rank-row:focus,
.dashboard-sectors .rank-row:focus-visible,
.dashboard-sectors .rank-row.is-selected {
    background: var(--color-brand-soft);
    outline: none;
}

.dashboard-sectors .rank-row.is-selected td:first-child {
    box-shadow: inset 3px 0 0 var(--color-brand);
}

.dashboard-sectors .chg-up {
    color: var(--color-success);
    font-weight: 700;
}

.dashboard-sectors .chg-down {
    color: var(--color-danger);
    font-weight: 700;
}

.dashboard-sectors .pe-missing {
    color: var(--color-warning);
    font-weight: 600;
}

.dashboard-sectors .row-quick {
    display: none;
    margin-left: 8px;
}

.dashboard-sectors .rank-row:hover .row-quick,
.dashboard-sectors .rank-row:focus-within .row-quick {
    display: inline-flex;
}

.dashboard-sectors .row-quick .btn {
    padding: 4px 10px;
    font-size: 11px;
}

.dashboard-sectors .inspector {
    padding: 18px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-sectors .inspector h3 {
    font-size: 16px;
    font-weight: 800;
}

.dashboard-sectors .inspector .muted {
    font-size: 13px;
    color: var(--color-muted);
}

.dashboard-sectors .inspector a {
    color: inherit;
    text-decoration: none;
}

.dashboard-sectors .inspector a:hover {
    color: var(--color-brand-strong);
}

.dashboard-sectors .stat-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dashboard-sectors .stat {
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-control);
    padding: 12px;
}

.dashboard-sectors .stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-faint);
}

.dashboard-sectors .stat-value {
    font-size: 20px;
    font-weight: 800;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.dashboard-sectors .hint-line {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12px;
    color: var(--color-muted);
}

.dashboard-sectors .hint-line svg {
    width: 16px;
    height: 16px;
    color: var(--color-info);
    flex: 0 0 auto;
    margin-top: 1px;
}

.dashboard-sectors .mover {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 64px minmax(0, 1.6fr);
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.dashboard-sectors .mover-asset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.dashboard-sectors .mover .logo-chip {
    width: 22px;
    height: 22px;
    font-size: 8px;
}

.dashboard-sectors .mover .logo-chip img {
    padding: 2px;
}

.dashboard-sectors .mover .note {
    color: var(--color-muted);
    font-size: 12px;
    min-width: 0;
}

.dashboard-sectors .empty-state {
    padding: 40px 24px;
    text-align: center;
}

.dashboard-sectors .empty-state svg {
    width: 32px;
    height: 32px;
    color: var(--color-brand);
    margin: 0 auto 10px;
    display: block;
}

.dashboard-sectors .empty-state p {
    margin: 8px auto 16px;
    max-width: 46ch;
}

.dashboard-sectors .list-error-box svg {
    width: 20px;
    height: 20px;
    color: var(--color-danger);
    margin-bottom: 8px;
}

.dashboard-sectors .warn-box {
    background: var(--color-warning-bg);
    border-radius: var(--radius-control);
    padding: 12px 14px;
}

.dashboard-sectors .warn-box strong {
    color: var(--color-warning);
    display: block;
    margin-bottom: 4px;
}

.dashboard-sectors .warn-box p {
    font-size: 13px;
    color: var(--color-muted);
}

.dashboard-sectors .skeleton-rank {
    padding: 12px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ==== Layout de contenido ==== */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* ==== Lista de activos ==== */
.list-head {
    padding: 18px 20px 0;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 0 0;
    border-top: 1px solid var(--color-line);
    color: inherit;
    transition: background-color .15s ease;
}

.list-row:first-of-type {
    border-top: none;
}

.list-row:hover {
    background: var(--color-surface-2);
}

.list-row-main {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 11px 8px 11px 20px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

th.follow-col,
td.follow-col,
col.follow-col {
    width: 44px;
    text-align: center;
}

td.follow-col {
    vertical-align: middle;
}

.follow-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--color-line-strong);
    border-radius: var(--radius-control);
    background: var(--color-surface);
    color: var(--color-muted);
    cursor: pointer;
}

.follow-toggle svg {
    width: 16px;
    height: 16px;
}

.follow-toggle:hover,
.follow-toggle.is-on {
    color: var(--color-brand-strong);
    border-color: var(--color-brand);
    background: var(--color-brand-soft);
}

html.dark .follow-toggle.is-on,
html.dark .follow-toggle:hover {
    color: var(--color-brand);
}

.unfollow-btn {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
}

.unfollow-btn svg {
    width: 14px;
    height: 14px;
}

.logo-chip {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-control);
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
    display: grid;
    place-items: center;
    font-size: 10.5px;
    font-weight: 800;
    color: var(--color-muted);
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
}

/* El logo va sobre las iniciales: si la imagen falta o falla, el chip
   sigue mostrando las iniciales sin romper el layout. */
.logo-chip img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
    background: #fff;
}

.asset-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.asset-name {
    min-width: 0;
}

.asset-name b {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.asset-name span {
    display: block;
    font-size: 11.5px;
    color: var(--color-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
}

.asset-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.asset-meta .pill {
    font-size: 9.5px;
    padding: 3px 7px;
}

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.tag-filter-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.tag-filter-chips {
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.th-with-hint {
    vertical-align: bottom;
}

.th-with-hint .th-label {
    margin-right: 4px;
}

.th-with-hint-end .th-hint-wrap {
    margin-left: 2px;
}

.th-hint-wrap {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.th-hint-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--color-faint);
    cursor: pointer;
}

.th-hint-btn:hover,
.th-hint-btn:focus-visible {
    color: var(--color-brand-strong);
    background: var(--color-brand-soft);
    outline: none;
}

.th-hint-icon {
    width: 14px;
    height: 14px;
}

.th-hint-tip {
    position: absolute;
    z-index: 20;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    min-width: 180px;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: var(--radius-control);
    border: 1px solid var(--color-line);
    background: var(--color-surface);
    color: var(--color-ink);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: var(--shadow-card);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}

.th-hint-wrap:hover .th-hint-tip,
.th-hint-wrap:focus-within .th-hint-tip {
    opacity: 1;
}

.th-with-hint-end .th-hint-tip {
    left: auto;
    right: 0;
    transform: none;
}

.price {
    font-size: 13.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.delta {
    font-size: 12.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 62px;
}

.delta.up {
    color: var(--color-success);
}

.delta.down {
    color: var(--color-danger);
}

.pill {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--color-surface-3);
    color: var(--color-muted);
}

.pill.warn {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.pill.danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.pill.info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.pill.success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

a.analyst-pill {
    text-decoration: none;
}

.analyst-pill-compact {
    font-size: 10px;
    padding: 3px 8px;
}

/* ==== Landing por activo ==== */
.asset-head {
    align-items: flex-start;
    gap: 18px;
}

.asset-hero {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.asset-kicker {
    margin: 0 0 4px;
    font-size: 12px;
    color: var(--color-muted);
}

.asset-kicker a {
    color: var(--color-brand-strong);
    text-decoration: none;
}

.asset-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.asset-price-block {
    text-align: right;
}

.asset-price {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.asset-analyst .card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.analyst-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.analyst-bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 28px;
    gap: 10px;
    align-items: center;
    font-size: 12.5px;
}

.analyst-bar-row b {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.news-list {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
}

.news-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--color-line);
    text-decoration: none;
    color: inherit;
}

.news-row:first-child {
    border-top: none;
}

.news-row b {
    display: block;
    font-size: 13.5px;
    line-height: 1.35;
}

.news-row span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-muted);
}

.news-row svg {
    width: 16px;
    height: 16px;
    color: var(--color-faint);
    flex: 0 0 auto;
}

.news-row:hover b {
    color: var(--color-brand-strong);
}

.list-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--color-line);
}

.list-error {
    padding: 16px 20px 20px;
}

.list-error-box {
    background: var(--color-danger-bg);
    border-radius: var(--radius-control);
    padding: 14px;
}

.list-error-box b {
    font-size: 13px;
    color: #991b1b;
}

html.dark .list-error-box b,
html.dark .list-error-box p {
    color: var(--color-danger);
}

.list-error-box p {
    font-size: 12px;
    color: #991b1b;
    margin: 4px 0 10px;
}

/* ==== Rail ==== */
.rail-list {
    margin-top: 14px;
}

.rail-item {
    padding: 14px;
    border-radius: var(--radius-control);
    margin-bottom: 10px;
}

.rail-item:last-child {
    margin-bottom: 0;
}

.rail-item b {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
}

.rail-item p {
    font-size: 11.5px;
    color: var(--color-muted);
    margin-top: 3px;
}

.rail-item.warn {
    background: var(--color-warning-bg);
}

.rail-item.info {
    background: var(--color-info-bg);
}

.rail-item.neutral {
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
}

/* ==== Brief ==== */
.bullets {
    list-style: none;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.bullets li {
    display: flex;
    gap: 9px;
    font-size: 12.5px;
    line-height: 1.5;
}

.bullets strong {
    font-weight: 700;
}

.bullets .body {
    color: var(--color-muted);
}

.bullets .dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    flex: 0 0 auto;
    margin-top: 6px;
    background: var(--color-brand);
}

.bullets .dot.success {
    background: var(--color-success);
}

.bullets .dot.warn {
    background: var(--color-warning);
}

.bullets .dot.danger {
    background: var(--color-danger);
}

.bullets .dot.neutral {
    background: var(--color-faint);
}

/* ==== Botones ==== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: var(--radius-control);
    border: 1px solid transparent;
    padding: 9px 16px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background-color .15s ease, transform .12s ease;
}

.btn:active {
    transform: scale(.985);
}

.btn-primary {
    background: var(--color-brand);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-brand-strong);
}

.btn-outline {
    background: var(--color-surface);
    border-color: var(--color-line-strong);
    color: var(--color-ink);
}

.btn-outline:hover {
    border-color: var(--color-brand);
    color: var(--color-brand-strong);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* ==== Estado vacío ==== */
.empty-state {
    padding: 22px 20px;
}

.empty-state h3 {
    font-size: 15px;
    font-weight: 700;
}

.empty-state p {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 4px;
}

/* ==== Tabla ==== */
.market-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--color-line);
}

.market-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.market-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-faint);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.market-table-advanced {
    min-width: 980px;
}

.market-table th {
    text-align: left;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--color-muted);
    background: var(--color-surface-2);
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-line);
    white-space: nowrap;
}

.market-table th.num {
    text-align: right;
}

.th-sort {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    cursor: pointer;
}

.market-table th.num .th-sort {
    justify-content: flex-end;
}

.sort-arrow {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
}

.th-sort[data-dir="asc"] .sort-arrow {
    transform: rotate(180deg);
}

.th-tip {
    display: none;
    position: absolute;
    z-index: 6;
    top: calc(100% + 8px);
    left: 0;
    width: 240px;
    padding: 8px 10px;
    border-radius: var(--radius-control);
    background: var(--color-ink);
    color: var(--color-surface);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
    white-space: normal;
    box-shadow: var(--shadow-card);
}

.market-table th.num .th-tip {
    left: auto;
    right: 0;
}

.th-sort:hover .th-tip,
.th-sort:focus-visible .th-tip {
    display: block;
}

.asset-link {
    color: inherit;
    text-decoration: none;
}

.asset-link:hover b {
    color: var(--color-brand-strong);
}

.asset-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.asset-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.follow-edit {
    padding: 6px 12px;
}

.follow-picker {
    margin-top: 12px;
}

.follow-picker input {
    width: 100%;
    border: 1px solid var(--color-line-strong);
    border-radius: var(--radius-control);
    background: var(--color-surface);
    color: var(--color-ink);
    padding: 9px 12px;
    font: inherit;
    font-size: 13px;
}

.follow-suggest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-line);
    font-size: 13px;
}

.follow-suggest .btn {
    padding: 6px 12px;
}

.list-row.is-editable {
    position: relative;
    grid-template-columns: 40px minmax(0, 1fr) auto auto auto auto;
}

.row-open {
    position: absolute;
    inset: 0;
}

.list-row.is-editable .row-remove {
    position: relative;
    z-index: 1;
}

.row-remove {
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0;
}

.row-remove:hover {
    color: var(--color-danger);
}

.market-table td {
    font-size: 12.5px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-line);
    vertical-align: middle;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.market-table tbody tr:last-child td {
    border-bottom: none;
}

.market-table tbody tr:hover {
    background: var(--color-surface-2);
}

.market-table td.num {
    text-align: right;
}

.track-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.track {
    width: 72px;
    height: 8px;
    border-radius: 999px;
    background: var(--color-surface-3);
    overflow: hidden;
    flex: 0 0 auto;
}

.track-sm {
    width: 56px;
    height: 6px;
}

.track-fill {
    height: 100%;
    border-radius: 999px;
}

.track-fill.ok {
    background: var(--color-success);
}

.track-fill.warn {
    background: var(--color-warning);
}

.track-fill.bad {
    background: var(--color-danger);
}

.track-value {
    font-size: 11.5px;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
    min-width: 44px;
}

/* Vista simple con columnas fijas: la cabecera y su valor comparten ancho,
   así ningún título queda flotando lejos de su columna. */
.market-table-simple {
    table-layout: fixed;
}

.market-table-simple .asset-name b,
.market-table-simple .asset-name span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dentro de una celda con pista, la barra ocupa el espacio libre y el
   número queda siempre en el mismo lugar. */
.track-cell .track {
    flex: 1 1 auto;
    width: auto;
}

.track-cell .track-value {
    text-align: right;
}

.rsi-value {
    font-size: 12px;
    min-width: 36px;
    font-variant-numeric: tabular-nums;
}

/* Filas que eligen el activo del gráfico histórico. */
.market-table .asset-row {
    cursor: pointer;
}

.market-table .asset-row:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: -2px;
}

.market-table .asset-row.selected td {
    background: var(--color-brand-soft);
}

.market-table .asset-row.selected .asset-name b {
    color: var(--color-brand-strong);
}

.market-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--color-line);
    font-size: 10.5px;
    color: var(--color-faint);
}

.table-error {
    padding: 22px 20px;
}

.table-error b {
    font-size: 13px;
}

.table-error p {
    font-size: 12px;
    color: var(--color-muted);
    margin: 4px 0 10px;
}

/* ==== Gráficos ==== */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.chart-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-bottom: 0;
}

.chart-head h3 {
    font-size: 14px;
    font-weight: 700;
}

.chart-head p {
    font-size: 11.5px;
    color: var(--color-muted);
    margin-top: 3px;
}

.chart-note {
    font-size: 10.5px;
    color: var(--color-faint);
    margin-top: auto;
    padding-top: 10px;
}

.chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 8px;
}

.chart-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.chart-price b {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* De quién es el gráfico histórico: ticker y nombre del activo elegido. */
.chart-asset {
    font-size: 12px;
    font-weight: 800;
    color: var(--color-brand-strong);
    white-space: nowrap;
}

/* Ranking por capitalización: filas ordenadas con barra proporcional. */
.cap-rank {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.cap-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cap-pos {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-faint);
    min-width: 16px;
    text-align: right;
    margin-top: 1px;
    font-variant-numeric: tabular-nums;
}

.cap-main {
    flex: 1;
    min-width: 0;
}

.cap-head {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-size: 12px;
}

.cap-head b {
    font-weight: 800;
}

.cap-name {
    color: var(--color-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cap-value {
    margin-left: auto;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cap-track {
    width: 100%;
    margin-top: 5px;
}

.ranges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.range-btn {
    border: 1px solid transparent;
    background: var(--color-surface-2);
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.range-btn.active {
    background: var(--color-brand-soft);
    color: var(--color-brand-strong);
    border-color: var(--color-brand);
}

html.dark .range-btn.active {
    color: var(--color-brand);
}

.compare-card {
    margin-top: 18px;
}

.compare-chart {
    width: 100%;
    height: 220px;
    margin-top: 8px;
}

.compare-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.compare-legend li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-ink);
}

.compare-swatch {
    width: 16px;
    height: 3px;
    border-radius: 99px;
    background: var(--color-brand);
}

.compare-swatch.peer-0 { background: var(--color-info); }
.compare-swatch.peer-1 { background: var(--color-warning); }
.compare-swatch.peer-2 { background: var(--color-ink); }
.compare-swatch.market {
    height: 0;
    border-top: 2px dashed var(--color-faint);
    background: transparent;
}

.price-chart {
    width: 100%;
    height: 150px;
    display: block;
}

.scatter-chart {
    width: 100%;
    height: 168px;
    display: block;
    margin-top: 12px;
}

.donut-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
}

.donut {
    width: 132px;
    height: 132px;
    flex: 0 0 auto;
}

.donut-legend {
    list-style: none;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 0;
    margin: 0;
}

.donut-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
}

.donut-legend i {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    flex: 0 0 auto;
}

.donut-legend span {
    font-weight: 600;
}

.donut-legend b {
    margin-left: auto;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
}

.bars {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 14px;
    padding: 0;
}

.bars li {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 54px;
    align-items: center;
    gap: 8px;
}

.bars-label {
    font-size: 11px;
    font-weight: 700;
}

.bars-area {
    position: relative;
    display: block;
    height: 16px;
    background: var(--color-surface-2);
    border-radius: 4px;
}

.bars-axis {
    position: absolute;
    left: 50%;
    top: -2px;
    bottom: -2px;
    width: 1px;
    background: var(--color-line-strong);
}

.bars-fill {
    position: absolute;
    top: 2px;
    bottom: 2px;
    border-radius: 3px;
}

.bars-fill.up {
    background: var(--color-success);
}

.bars-fill.down {
    background: var(--color-danger);
}

.bars-simple .bars-axis {
    display: none;
}

.bars-value {
    font-size: 11px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bars-value.up {
    color: var(--color-success);
}

.bars-value.down {
    color: var(--color-danger);
}

.chart-empty,
.chart-empty-box {
    font-size: 12px;
    color: var(--color-muted);
}

.chart-empty-box {
    background: var(--color-surface-2);
    border: 1px dashed var(--color-line-strong);
    border-radius: var(--radius-control);
    padding: 16px;
    margin-top: 12px;
}

.chart-empty-box b {
    display: block;
    font-size: 12.5px;
    color: var(--color-ink);
    margin-bottom: 4px;
}

.chart-skeleton {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.chart-skeleton .sk {
    border-radius: 6px;
    background: var(--color-surface-3);
    animation: sk-pulse 1.4s ease-in-out infinite;
}

/* ==== Skeleton ==== */
.sk {
    background: var(--color-surface-3);
    border-radius: 6px;
    animation: sk-pulse 1.4s ease-in-out infinite;
}

@keyframes sk-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .45;
    }
}

.sk-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 13px 20px;
    border-top: 1px solid var(--color-line);
}

.sk-bar {
    height: 11px;
}

/* ==== Toast ==== */
.toast-wrap {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 32px);
}

.toast {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-left: 4px solid var(--color-brand);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
    border-radius: var(--radius-control);
    padding: 11px 14px;
    font-size: 12.5px;
    font-weight: 600;
    max-width: 340px;
    animation: toast-in .22s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==== Widget del chat ==== */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 50;
}

.chat-toggle {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand-strong));
    box-shadow: 0 8px 24px rgba(40, 167, 69, .28);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
}

.chat-toggle:hover {
    transform: scale(1.05);
}

.chat-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    object-fit: cover;
}

.hidden {
    display: none !important;
}

/* ==== Footer ==== */
.foot {
    border-top: 1px solid var(--color-line);
    background: var(--color-surface);
    padding: 18px 0;
    font-size: 11.5px;
    color: var(--color-faint);
}

/* ==== Ajustes (panel de cuenta) ==== */
.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding-top: 6px;
}

.settings-layout .col {
    gap: 0;
}

.settings-layout .card {
    margin-bottom: 18px;
}

.settings-layout .col .card:last-child {
    margin-bottom: 0;
}

.profile-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 24px 20px 18px;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: var(--color-brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .02em;
    flex: 0 0 auto;
}

.profile-name {
    font-size: 15px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-role {
    font-size: 12px;
    color: var(--color-muted);
}

.field-list {
    border-top: 1px solid var(--color-line);
}

.field {
    padding: 12px 20px;
    min-width: 0;
}

.field + .field {
    border-top: 1px solid var(--color-line);
}

.field-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.field-value {
    font-size: 13.5px;
    font-weight: 600;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
}

.settings-row + .settings-row {
    border-top: 1px solid var(--color-line);
}

.settings-row-text {
    min-width: 0;
}

.settings-row-text b {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 700;
}

.settings-row-text > span {
    display: block;
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 3px;
}

.settings-row-action {
    flex: 0 0 auto;
}

.settings-input {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--color-line-strong);
    border-radius: var(--radius-control);
    background: var(--color-surface);
    color: var(--color-ink);
    font: inherit;
    font-size: 14px;
}

.settings-input:focus {
    outline: 2px solid var(--color-brand);
    outline-offset: 1px;
    border-color: var(--color-brand);
}

.settings-check {
    width: 18px;
    height: 18px;
    accent-color: var(--color-brand);
    flex: 0 0 auto;
}

.settings-note {
    color: var(--color-danger);
}

/* Segmented de tema (Claro / Oscuro / Sistema). Reutiliza .segmented y .segmented-btn. */
.theme-segmented {
    display: flex;
    width: 100%;
}

.theme-segmented .segmented-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.theme-segmented .segmented-btn svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.sk-line {
    height: 12px;
    border-radius: 6px;
    background: var(--color-surface-3);
    margin-top: 8px;
    animation: sk-pulse 1.4s ease-in-out infinite;
}

.sk-line.short {
    width: 45%;
}

.sk-line.long {
    width: 80%;
}

.sk-inline {
    display: inline-block;
    width: 120px;
    height: 14px;
    vertical-align: middle;
    border-radius: 6px;
    background: var(--color-surface-3);
    animation: sk-pulse 1.4s ease-in-out infinite;
}

.settings-layout .btn > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.btn-danger-outline {
    background: var(--color-surface);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.btn-danger-outline:hover {
    background: var(--color-danger-bg);
}

/* Switch: role="switch", aria-checked. Deshabilitado = aria-disabled + disabled. */
.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    border: none;
    padding: 0;
    background: var(--color-line-strong);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background-color .15s ease;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: transform .15s ease;
}

.toggle[aria-checked="true"] {
    background: var(--color-brand);
}

.toggle[aria-checked="true"]::after {
    transform: translateX(18px);
}

.toggle:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.toggle:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.alert-list {
    display: flex;
    flex-direction: column;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 20px;
}

.alert-item + .alert-item {
    border-top: 1px solid var(--color-line);
}

.alert-item b {
    display: block;
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.alert-item-body {
    min-width: 0;
}

.alert-item-body > span {
    display: block;
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 3px;
}

.alert-item time {
    display: block;
    font-size: 11px;
    color: var(--color-faint);
    margin-top: 4px;
}

.card-body-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.plan-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.plan-price {
    font-size: 13px;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

/* ==== Responsive ==== */
/* En pantallas angostas el plan y las preferencias van antes que el perfil. */
@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-main {
        order: -1;
    }
}

@media (max-width: 1080px) {
    .nav-links {
        overflow-x: auto;
    }


    .kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .content-grid,
    .sectors-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-sectors .inspector {
        min-height: 0;
    }

    .chart-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .nav .search {
        display: none;
    }

    .page-search {
        display: flex;
        width: 100%;
        height: 40px;
        margin: 0 0 16px;
    }

    .page-search .search-dropdown {
        left: 0;
        right: 0;
        min-width: 100%;
    }

    .list-row-main {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        row-gap: 4px;
        padding: 11px 8px 11px 16px;
    }

    .list-row-main .price {
        grid-column: 2;
        font-size: 12px;
        color: var(--color-muted);
        font-weight: 500;
    }

    .list-row-main .delta {
        grid-column: 3;
        grid-row: 1;
        text-align: right;
    }

    .list-row-main .pill {
        grid-column: 2 / -1;
        justify-self: start;
    }

    .asset-hero-actions {
        align-items: flex-start;
        width: 100%;
    }

    .asset-price-block {
        text-align: left;
    }

    .search-dropdown {
        min-width: 100%;
        right: auto;
    }

    .page-meta {
        text-align: left;
    }
}

@media (max-width: 560px) {
    .market-page .wrap,
    .dashboard-page .wrap {
        padding: 0 14px 32px;
    }

    .market-page .nav-inner,
    .dashboard-page .nav-inner {
        padding: 10px 14px;
        gap: 8px;
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kpi:last-child {
        grid-column: span 2;
    }

    .kpi-value {
        font-size: 19px;
    }

    .kpi-spark {
        display: none;
    }

    .card-pad {
        padding: 15px 16px;
    }

    .card-head .stamp {
        margin-left: 0;
        width: 100%;
    }

    .donut-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .donut-legend {
        width: 100%;
    }

    .market-toolbar,
    .market-foot {
        padding: 14px 16px;
    }
}

/* ==== Ficha del activo (/activo/{ticker}): carrusel Top 3, analistas, calendario y métricas ==== */
.ticker-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 18px;
    align-items: stretch;
}

.ticker-hero-grid > div,
.ticker-insights-grid > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ticker-hero-grid .chart-grid {
    grid-template-columns: minmax(0, 1fr);
    flex: 1;
}

.ticker-hero-grid .card,
.ticker-insights-grid .card {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ticker-insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
    align-items: stretch;
}

.asset-badges-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.asset-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.btn-outline.is-active {
    background: var(--color-brand-soft);
    border-color: var(--color-brand);
    color: var(--color-brand-strong);
}

html.dark .btn-outline.is-active {
    color: var(--color-brand);
}

.asset-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--color-line-strong);
}

.asset-adv-item {
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-control);
    padding: 10px 12px;
    min-width: 0;
}

.asset-adv-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.asset-adv-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
}

.asset-adv-val {
    font-size: 13.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--color-ink);
}

.asset-adv-hint {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 4px;
    line-height: 1.35;
}

.asset-summary-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--color-line);
}

.asset-summary-foot .card-foot-link {
    margin-top: 0;
}

/* Carrusel Top 3 Noticias en ficha */
.ticker-news-carousel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.ticker-news-slide {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-top: 12px;
    min-width: 0;
}

.ticker-news-media {
    position: relative;
    height: 126px;
    border-radius: var(--radius-control);
    overflow: hidden;
    border: 1px solid var(--color-line);
    background: var(--color-brand-soft);
    background-size: cover;
    background-position: center;
    flex: 0 0 auto;
}

.ticker-news-media svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ticker-news-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    pointer-events: none;
}

.ticker-news-badge {
    background: color-mix(in srgb, var(--color-surface) 92%, transparent);
    backdrop-filter: blur(6px);
    color: var(--color-ink);
    border: 1px solid var(--color-line);
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
}

.ticker-news-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.32;
    margin-top: 12px;
    color: var(--color-ink);
}

.ticker-news-title a {
    color: inherit;
    text-decoration: none;
}

.ticker-news-title a:hover {
    color: var(--color-brand-strong);
}

.ticker-news-desc {
    font-size: 12.5px;
    color: var(--color-muted);
    margin-top: 6px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticker-news-meta {
    font-size: 11.5px;
    color: var(--color-faint);
    margin-top: auto;
    padding-top: 10px;
}

.ticker-news-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-line);
}

.ticker-carousel-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticker-carousel-arrow {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--color-line-strong);
    background: var(--color-surface-2);
    color: var(--color-ink);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.ticker-carousel-arrow:hover {
    border-color: var(--color-brand);
    color: var(--color-brand-strong);
}

.ticker-carousel-arrow svg {
    width: 14px;
    height: 14px;
}

.ticker-carousel-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 4px;
}

.ticker-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: none;
    background: var(--color-line-strong);
    padding: 0;
    cursor: pointer;
    transition: width .18s ease, background-color .18s ease;
}

.ticker-carousel-dot[aria-current="true"] {
    width: 20px;
    background: var(--color-brand);
}

.ticker-carousel-counter {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--color-muted);
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
}

/* Opinión de analistas en ficha */
.ticker-rec-wrap {
    margin-top: 14px;
}

.ticker-rec-bar {
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    display: flex;
    background: var(--color-surface-3);
    border: 1px solid var(--color-line);
}

.ticker-rec-seg.strong-buy { background: var(--color-success); }
.ticker-rec-seg.buy { background: var(--color-brand); }
.ticker-rec-seg.hold { background: var(--color-warning); }
.ticker-rec-seg.underperform { background: var(--color-warning-strong); }
.ticker-rec-seg.sell { background: var(--color-danger); }

.ticker-rec-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--color-ink);
}

.ticker-rec-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.ticker-rec-dot {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    display: inline-block;
}

.ticker-targets-box {
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-control);
    padding: 12px 14px;
    margin-top: 14px;
}

.ticker-targets-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.ticker-targets-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
}

.ticker-targets-cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ticker-target-item span {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-faint);
}

.ticker-target-item b {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

.ticker-target-item b.brand {
    color: var(--color-brand-strong);
}

html.dark .ticker-target-item b.brand {
    color: var(--color-brand);
}

.ticker-target-track {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: var(--color-line);
    margin-top: 12px;
}

.ticker-target-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--color-brand);
    border-radius: 999px;
}

.ticker-target-marker {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    border: 2px solid var(--color-surface);
}

.ticker-target-marker.current { background: var(--color-ink); }
.ticker-target-marker.average { background: var(--color-brand); }

/* Calendario y resultados en ficha */
.ticker-evr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ticker-evr-box {
    background: var(--color-surface-2);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-control);
    padding: 11px 12px;
    min-width: 0;
}

.ticker-evr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
}

.ticker-evr-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
}

.ticker-quarters-wrap {
    margin-top: 12px;
    overflow-x: auto;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-control);
    background: var(--color-surface-2);
}

.ticker-quarters-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    min-width: 380px;
}

.ticker-quarters-table th {
    text-align: left;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-faint);
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-line);
    white-space: nowrap;
}

.ticker-quarters-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--color-line);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ticker-quarters-table tr:last-child td {
    border-bottom: none;
}

.ticker-quarters-table th.num,
.ticker-quarters-table td.num {
    text-align: right;
}

@media (max-width: 1024px) {
    .ticker-hero-grid,
    .ticker-insights-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .ticker-targets-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ticker-evr-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .activation-nudge {
        flex-direction: column;
        align-items: stretch;
    }

    .activation-nudge-actions {
        justify-content: flex-start;
    }
}

/* ==== Activación de alertas ==== */
.activation-nudge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.activation-nudge-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.activation-nudge-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-control);
    background: var(--color-brand-soft);
    color: var(--color-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activation-nudge-icon svg {
    width: 20px;
    height: 20px;
}

.activation-nudge-copy h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-ink);
    margin: 0 0 4px;
}

.activation-nudge-copy p {
    font-size: 13px;
    color: var(--color-muted);
    margin: 0;
    line-height: 1.45;
}

.activation-nudge-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.asset-flash-banner {
    margin: 0 0 16px;
    padding: 14px 16px;
    border-radius: var(--radius-card);
    border: 1px solid var(--color-line);
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asset-flash-banner.live {
    border-left: 3px solid var(--color-brand);
}

.asset-flash-banner.locked {
    background: var(--color-surface-2);
}

.asset-flash-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.asset-flash-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--color-brand-soft);
    color: var(--color-brand-strong);
    font-size: 11.5px;
    font-weight: 700;
}

html.dark .asset-flash-badge {
    color: var(--color-brand);
}

.asset-flash-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.asset-flash-link,
.asset-flash-source {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-brand-strong);
    text-decoration: none;
}

html.dark .asset-flash-link,
html.dark .asset-flash-source {
    color: var(--color-brand);
}

.asset-flash-link:hover,
.asset-flash-source:hover {
    text-decoration: underline;
}

.asset-flash-title {
    margin: 2px 0 0;
    font-size: 15px;
    line-height: 1.35;
    color: var(--color-ink);
}

.asset-flash-body {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-muted);
}

.asset-flash-why {
    margin: 2px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--color-ink);
}
