/* ===== COMPARACIÓN VISUAL - Gráficos y Ventajas/Desventajas ===== */
.visual-comparison {
    max-width: 1700px;
    margin: 0 auto 3rem;
    padding-top: 0;
    padding-right: 0.5rem;
    padding-bottom: 0;
    animation: visFadeIn 1s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    scroll-margin-top: 2rem;
}

@keyframes visFadeIn {
    from { opacity: 0; transform: translateY(40px); filter: blur(6px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes dividerGlow {
    from { opacity: 0; transform: scaleY(0); }
    to { opacity: 1; transform: scaleY(1); }
}

.visual-comparison .results-title {
    text-align: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    letter-spacing: 0.3px;
    animation: visFadeIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.visual-comparison .results-title i {
    color: var(--primary-color);
    margin-right: 0.6rem;
    font-size: 1.3rem;
}

.visual-comparison .results-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1.8rem;
    font-weight: 400;
    animation: visFadeIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s both;
}

.light-theme .visual-comparison .results-title {
    color: #1a1a1a;
}

/* === Split layout === */
.comparison-split {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.comparison-left,
.comparison-right {
    flex: 1;
    padding: 1.8rem;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.comparison-left {
    flex: 1.3;
    position: sticky;
    top: 1rem;
    animation: slideInLeft 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s both;
}

.comparison-right {
    flex: 1;
    animation: slideInRight 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.35s both;
}

.light-theme .comparison-left,
.light-theme .comparison-right {
    background: #f0f0f0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.07);
}

.comparison-left h4,
.comparison-right h4 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.comparison-left h4 i,
.comparison-right h4 i {
    color: var(--primary-color);
    font-size: 1.05rem;
}

.light-theme .comparison-left h4,
.light-theme .comparison-right h4 {
    color: #1a1a1a;
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* === Divider vertical === */
.comparison-divider {
    width: 1px;
    background: var(--primary-color);
    margin: 0 1.5rem;
    flex-shrink: 0;
}

.light-theme .comparison-divider {
    background: var(--primary-color);
}

/* === Glass Tooltip === */
#chart-glass-tooltip {
    position: absolute;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.97);
    transition: opacity 0.15s ease, transform 0.15s ease;
    padding: 10px 13px;
    border-radius: 10px;
    background: rgb(16, 16, 16);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    font-family: 'Courier New', monospace;
    min-width: 120px;
    max-width: 220px;
    width: max-content;
}

#chart-glass-tooltip.cgt-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.light-theme #chart-glass-tooltip {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

#chart-glass-tooltip .cgt-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 7px;
}

.light-theme #chart-glass-tooltip .cgt-title {
    color: rgba(0,0,0,0.45);
}

#chart-glass-tooltip .cgt-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

#chart-glass-tooltip .cgt-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

#chart-glass-tooltip .cgt-name {
    font-size: 0.73rem;
    font-weight: 500;
    color: #ccc;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.light-theme #chart-glass-tooltip .cgt-name {
    color: #444;
}

#chart-glass-tooltip .cgt-val {
    font-size: 0.73rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.light-theme #chart-glass-tooltip .cgt-val {
    color: #111;
}

#chart-glass-tooltip .cgt-bar-wrap {
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    margin: 3px 0 2px;
    overflow: hidden;
}

.light-theme #chart-glass-tooltip .cgt-bar-wrap {
    background: rgba(0,0,0,0.06);
}

#chart-glass-tooltip .cgt-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.25s ease;
}

#chart-glass-tooltip .cgt-diff {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 5px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    opacity: 0.85;
}

.light-theme #chart-glass-tooltip .cgt-diff {
    border-top-color: rgba(0,0,0,0.06);
}

.chart-area-row {
    display: flex;
    gap: 0.8rem;
    align-items: stretch;
}

.chart-legend-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    padding: 0.4rem 0.2rem;
    margin-bottom: 0.6rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.18s ease, opacity 0.18s ease;
}
.legend-item:hover {
    background: rgba(255,255,255,0.06);
}
.light-theme .legend-item:hover {
    background: rgba(0,0,0,0.04);
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-name {
    font-size: 0.73rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    line-height: 1.25;
    word-break: break-word;
}
.light-theme .legend-name { color: #333; }

/* Serie ocultada al hacer clic en su nombre (ver comparacion_visual.js) */
.legend-item.is-off {
    opacity: 0.45;
}
.legend-item.is-off .legend-dot {
    background: transparent !important;
    box-shadow: none !important;
    border: 1.5px solid rgba(255,255,255,0.4);
}
.legend-item.is-off .legend-name {
    text-decoration: line-through;
    color: rgba(255,255,255,0.5);
}
.light-theme .legend-item.is-off .legend-dot { border-color: rgba(0,0,0,0.35); }
.light-theme .legend-item.is-off .legend-name { color: #999; }

.chart-viewport-wrap {
    flex: 1;
    min-width: 0;
}

/* === Chart inside left panel === */
.comparison-left .chart-viewport {
    position: relative;
    width: 100%;
    height: 580px;
    overflow: hidden;
    border-radius: 14px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 140, 50, 0.25);
}
.light-theme .comparison-left .chart-viewport {
    background: #f0f0f0;
    border-color: rgba(0, 0, 0, 0.1);
}

.comparison-left .chart-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.comparison-left .chart-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0.5rem 0.2rem;
    display: block;          /* always block — canvas always has real dimensions */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 0;
}

.comparison-left .chart-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.comparison-left .chart-slide canvas {
    width: 100% !important;
    height: 100% !important;
}

/* === Radar HTML labels overlay === */
.radar-labels-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
.radar-label {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    color: #e4e4e7;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
    transform: translate(-50%, -50%);
    user-select: none;
}
.light-theme .radar-label { color: #222; }
.radar-label:hover {
    background: rgba(255,107,53,0.15);
    color: #ff8c5a;
    transform: translate(-50%, -50%) scale(1.08);
}
.light-theme .radar-label:hover {
    background: rgba(255,107,53,0.1);
    color: #e85d2a;
}

/* Tooltip container — reserve space so panel doesn't grow */
#radar-tooltip-container {
    min-height: 80px;
}

/* Radar label tooltip — shown below chart */
.radar-label-tooltip {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgb(30, 30, 30);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.radar-label-tooltip.rlt-visible {
    opacity: 1;
    transform: translateY(0);
}
.light-theme .radar-label-tooltip {
    background: rgb(240, 240, 240);
    border-color: rgba(0,0,0,0.08);
}
.rlt-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}
.light-theme .rlt-title { color: #111; }
.rlt-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.rlt-card {
    flex: 1 1 180px;
    min-width: 0;
}
.rlt-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}
.rlt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rlt-name {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.light-theme .rlt-name { color: #555; }
.rlt-val {
    font-size: 0.73rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.light-theme .rlt-val { color: #111; }
.rlt-bar-wrap {
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin-bottom: 0.35rem;
    overflow: hidden;
}
.light-theme .rlt-bar-wrap { background: rgba(0,0,0,0.06); }
.rlt-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Fila que agrupa el switcher principal y el botón de Rendimiento separado */
.chart-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* === Chart type dropdown === */
.chart-controls { display: flex; justify-content: flex-start; padding: 0 0 0.75rem; }

.chart-type-dd { position: relative; display: inline-flex; }

.chart-type-trigger {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 0.85rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff8c5a 100%);
    color: #1a0a00; border: none; border-radius: 10px;
    font-weight: 700; font-size: 0.82rem; letter-spacing: 0.01em;
    cursor: pointer; box-shadow: 0 3px 12px rgba(255,107,53,0.28);
    transition: box-shadow 0.18s, transform 0.14s;
    white-space: nowrap; user-select: none; line-height: 1;
}
.chart-type-trigger:hover { box-shadow: 0 5px 18px rgba(255,107,53,0.42); transform: translateY(-1px); }
.chart-type-trigger:active { transform: translateY(0); }

.chart-type-arrow {
    font-size: 0.58rem; opacity: 0.7; margin-left: 0.15rem;
    transition: transform 0.2s ease;
}
.chart-type-dd.open .chart-type-arrow { transform: rotate(180deg); opacity: 1; }

.chart-type-menu {
    display: none; position: absolute; top: calc(100% + 8px); left: 0;
    background: #18181c;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px; padding: 0.45rem 0.35rem;
    box-shadow: 0 16px 48px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.04);
    min-width: 195px; z-index: 400;
    backdrop-filter: blur(12px);
}
.chart-type-dd.open .chart-type-menu {
    display: block;
    animation: ctDropIn 0.16s cubic-bezier(0.22,1,0.36,1);
}
@keyframes ctDropIn {
    from { opacity:0; transform:translateY(-8px) scale(0.97); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}

/* Section labels */
.chart-dd-group-lbl {
    font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: rgba(255,255,255,0.28);
    padding: 0.55rem 0.85rem 0.2rem; user-select: none;
}

.chart-type-opt {
    width: 100%; display: flex; align-items: center;
    padding: 0.46rem 0.85rem; border-radius: 8px;
    background: transparent; border: none;
    color: rgba(255,255,255,0.6); font-size: 0.83rem; font-weight: 500;
    cursor: pointer; gap: 0; white-space: nowrap;
    transition: background 0.11s, color 0.11s;
    position: relative;
}
.cto-ico {
    width: 26px; flex-shrink: 0; display: flex; align-items: center;
    justify-content: center; font-size: 0.78rem;
    color: rgba(255,255,255,0.35); transition: color 0.11s;
}
.cto-txt { flex: 1; text-align: left; }
.chart-type-opt:hover { background: rgba(255,255,255,0.055); color: rgba(255,255,255,0.92); }
.chart-type-opt:hover .cto-ico { color: rgba(255,107,53,0.75); }
.chart-type-opt.active {
    background: rgba(255,107,53,0.12) !important;
    color: #ffb07a !important; font-weight: 600;
}
.chart-type-opt.active .cto-ico { color: var(--primary-color) !important; }
.chart-type-opt.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free'; font-weight: 900;
    font-size: 0.65rem; color: var(--primary-color); opacity: 0.85;
    margin-left: 0.5rem;
}

.chart-type-sep { height: 1px; background: rgba(255,255,255,0.07); margin: 0.35rem 0.6rem; }

/* Light theme */
.light-theme .chart-type-menu, html.light-theme .chart-type-menu {
    background: rgba(255,255,255,0.97);
    border-color: rgba(0,0,0,0.09);
    box-shadow: 0 16px 48px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
}
.light-theme .chart-dd-group-lbl, html.light-theme .chart-dd-group-lbl { color: rgba(0,0,0,0.35); }
.light-theme .chart-type-opt, html.light-theme .chart-type-opt { color: rgba(0,0,0,0.6); }
.light-theme .cto-ico, html.light-theme .cto-ico { color: rgba(0,0,0,0.3); }
.light-theme .chart-type-opt:hover, html.light-theme .chart-type-opt:hover { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.88); }
.light-theme .chart-type-opt:hover .cto-ico, html.light-theme .chart-type-opt:hover .cto-ico { color: var(--primary-color); }
.light-theme .chart-type-opt.active, html.light-theme .chart-type-opt.active { background: rgba(255,107,53,0.08) !important; color: #c94000 !important; }
.light-theme .chart-type-opt.active .cto-ico, html.light-theme .chart-type-opt.active .cto-ico { color: #c94000 !important; }
.light-theme .chart-type-sep, html.light-theme .chart-type-sep { background: rgba(0,0,0,0.07); }
.light-theme .chart-type-trigger, html.light-theme .chart-type-trigger { color: #1a0a00; }

.chart-btn {
    padding: 0.5rem 1.1rem;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chart-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 107, 53, 0.08);
}

.chart-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #ff8c5a);
    color: #0c0d10;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.35);
    font-weight: 800;
}

.light-theme .chart-btn {
    color: #666;
}

.light-theme .chart-btn:hover {
    color: #333;
    background: rgba(255, 107, 53, 0.08);
}

.light-theme .chart-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #ff8c5a);
    color: #fff;
}

/* === Tree Diagram - Advantages/Disadvantages === */
.tree-root {
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    padding: 0.2rem 0;
}

.tree-root-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.tree-root-label i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Branch (category level) */
.tree-branch {
    display: flex;
    gap: 0;
    position: relative;
}

.tree-branch > .tree-connector {
    flex-shrink: 0;
    width: 24px;
    color: rgba(255, 107, 53, 0.35);
    font-weight: 400;
    user-select: none;
    text-align: center;
    line-height: 2.4;
    position: relative;
}

/* Vertical line for non-last branches */
.tree-branch:not(.last) > .tree-connector::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 2.2rem;
    bottom: 0;
    width: 1px;
    background: rgba(255, 107, 53, 0.2);
    transform: translateX(-50%);
}

.tree-branch > .tree-node {
    flex: 1;
    min-width: 0;
}

/* Folder button (category) */
.tree-folder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: left;
}

.tree-folder:hover {
    background: rgba(255, 107, 53, 0.08);
}

.tree-folder-icon {
    color: #ffc107;
    font-size: 0.95rem;
    display: inline-block;
}

.tree-folder-open-icon {
    color: #ffb300;
    font-size: 0.95rem;
    display: none;
}

.tree-branch.open .tree-folder-icon {
    display: none;
}

.tree-branch.open .tree-folder-open-icon {
    display: inline-block;
}

.tree-folder span {
    flex: 1;
}

.tree-cpu-dot {
    flex: 0 !important;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tree-winner-badge {
    flex: 0 !important;
    font-size: 0.75rem;
    opacity: 0.55;
    margin-right: 2px;
    filter: saturate(0.6);
    transition: opacity 0.2s, filter 0.2s;
}

.tree-folder:hover .tree-winner-badge,
.tree-branch.open .tree-winner-badge {
    opacity: 0.9;
    filter: saturate(1);
}

.tree-count {
    flex: 0 !important;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.45rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
}

.light-theme .tree-count {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #666;
}

/* Children container */
.tree-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tree-branch.open > .tree-node > .tree-children {
    max-height: 3000px;
}

.adv-description {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: -0.6rem 0 1rem;
    line-height: 1.5;
    opacity: 0.7;
}

.adv-description strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Section headers inside tree children */
.tree-section-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.35rem 0.5rem 0.2rem;
    margin-top: 0.25rem;
}

.tree-header-pro {
    color: #4caf50;
    opacity: 0.75;
}

.tree-header-con {
    color: #f44336;
    opacity: 0.75;
}

/* Leaf (individual point) */
.tree-leaf {
    display: flex;
    gap: 0;
    position: relative;
}

.tree-leaf > .tree-connector {
    flex-shrink: 0;
    width: 24px;
    color: rgba(255, 255, 255, 0.15);
    font-weight: 400;
    user-select: none;
    text-align: center;
    line-height: 2.2;
    position: relative;
}

/* Vertical line for non-last leaves */
.tree-leaf:not(.last) > .tree-connector::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 2rem;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-50%);
}

.light-theme .tree-leaf > .tree-connector {
    color: rgba(0, 0, 0, 0.2);
}

.light-theme .tree-leaf:not(.last) > .tree-connector::after {
    background: rgba(0, 0, 0, 0.08);
}

.light-theme .tree-branch > .tree-connector {
    color: rgba(255, 107, 53, 0.4);
}

.light-theme .tree-branch:not(.last) > .tree-connector::after {
    background: rgba(255, 107, 53, 0.18);
}

/* File (individual advantage/disadvantage) */
.tree-file {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    flex: 1;
    min-width: 0;
    transition: background 0.2s ease;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.84rem;
    line-height: 1.5;
}

.tree-file:hover {
    background: rgba(255, 255, 255, 0.03);
}

.light-theme .tree-file:hover {
    background: rgba(0, 0, 0, 0.025);
}

.tree-file > i {
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.tree-file.pro > i { color: #4caf50; }
.tree-file.con > i { color: #f44336; }
.tree-file.info > i { color: #ffc107; }

.tree-file-text {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.adv-diff-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    margin-left: auto;
}
.adv-diff-pill.adv-diff-pro {
    background: rgba(76,175,80,0.18);
    color: #66bb6a;
    border: 1px solid rgba(76,175,80,0.35);
}
.adv-diff-pill.adv-diff-con {
    background: rgba(244,67,54,0.18);
    color: #ef5350;
    border: 1px solid rgba(244,67,54,0.35);
}
.light-theme .adv-diff-pill.adv-diff-pro {
    background: rgba(76,175,80,0.12);
    color: #2e7d32;
    border-color: rgba(76,175,80,0.3);
}
.light-theme .adv-diff-pill.adv-diff-con {
    background: rgba(244,67,54,0.12);
    color: #c62828;
    border-color: rgba(244,67,54,0.3);
}

.tree-file-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Light theme folder colors */
.light-theme .tree-folder {
    color: #1a1a1a;
}

.light-theme .tree-folder:hover {
    background: rgba(255, 107, 53, 0.06);
}

.light-theme .tree-root-label {
    color: #1a1a1a;
}

/* === Responsive === */
@media (max-width: 900px) {
    .comparison-split {
        flex-direction: column;
    }

    .comparison-left,
    .comparison-right {
        animation: visFadeIn 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s both;
    }

    .comparison-divider {
        width: 100%;
        height: 2px;
        margin: 1rem 0;
        background: linear-gradient(90deg, transparent 5%, var(--primary-color) 30%, rgba(255, 107, 53, 0.6) 50%, var(--primary-color) 70%, transparent 95%);
        transform-origin: center center;
    }

    .comparison-left .chart-viewport {
        height: 380px;
    }
}

@media (max-width: 520px) {
    .chart-switcher {
        flex-direction: column;
        align-items: stretch;
        width: auto;
    }

    .chart-btn {
        justify-content: center;
    }

    .visual-comparison {
        padding: 0 0.5rem;
    }

    .visual-comparison .results-title {
        font-size: 1.2rem;
    }

    .comparison-left .chart-viewport {
        height: 300px;
    }
}

/* === Winner Banner === */
.winner-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.4rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.light-theme .winner-banner {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.winner-trophy {
    font-size: 1.6rem;
    color: #f5a623;
    flex-shrink: 0;
}

.winner-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.winner-name {
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.winner-detail {
    font-size: 0.78rem;
    color: var(--text-secondary, #999);
    font-weight: 400;
}

.winner-detail strong {
    color: var(--text-primary, #fff);
    font-weight: 700;
}

.light-theme .winner-detail strong {
    color: #111;
}

.winner-share {
    flex-shrink: 0;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.btn-share:hover {
    background: var(--primary-color);
    color: #fff;
}

/* === Specs Table === */
.specs-table-section {
    margin-top: 2rem;
    animation: visFadeIn 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.5s both;
}

.specs-table-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 1rem;
    letter-spacing: 0.2px;
}

.specs-table-title i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.light-theme .specs-table-title {
    color: #1a1a1a;
}

.specs-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.specs-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.specs-expand-btn,
.specs-diff-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
    font-family: inherit;
}
.specs-expand-btn:hover,
.specs-diff-btn:hover {
    background: rgba(255, 107, 53, 0.2);
}
.specs-diff-btn.active {
    background: rgba(255, 107, 53, 0.25);
    border-color: rgba(255, 107, 53, 0.7);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.25);
}
.light-theme .specs-expand-btn,
.light-theme .specs-diff-btn {
    background: rgba(255, 107, 53, 0.07);
    border-color: rgba(255, 107, 53, 0.2);
}
.light-theme .specs-diff-btn.active {
    background: rgba(255, 107, 53, 0.18);
    border-color: rgba(255, 107, 53, 0.5);
    color: #c94a1a;
}

.specs-subtable-wrap {
    margin-bottom: 1.5rem;
}

.specs-subtable-wrap:last-child {
    margin-bottom: 0;
}

.specs-subtable-title {
    color: #e0e0e0;
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 0.6rem;
    padding: 0.5rem 0.8rem;
    border-left: 3px solid var(--primary-color);
    background: rgba(255, 107, 53, 0.06);
    border-radius: 0 8px 8px 0;
    letter-spacing: 0.2px;
}

.specs-subtable-title i {
    color: var(--primary-color);
    margin-right: 0.45rem;
    font-size: 0.82rem;
}

.light-theme .specs-subtable-title {
    color: #2a2a2a;
    background: rgba(255, 107, 53, 0.08);
}

.specs-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #212121;
}

.light-theme .specs-table-wrap {
    border-color: #e0e0e0;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.specs-table thead th {
    background: #1e1e1e;
    color: var(--text-primary, #e4e4e7);
    font-weight: 700;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #232323;
    font-size: 0.78rem;
}

/* Columnas de nombre — ancho máximo con ellipsis y tooltip nativo */
.specs-table thead th.th-name {
    max-width: 180px;
    min-width: 120px;
    overflow: hidden;
    cursor: default;
}
.th-name-inner {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.light-theme .specs-table thead th {
    background: #ebebeb;
    color: #222;
    border-bottom-color: #e0e0e0;
}

.specs-table tbody td {
    padding: 8px 14px;
    color: var(--text-secondary, #aaa);
    background: #141414;
    border-bottom: 1px solid #1a1a1a;
    white-space: nowrap;
}

.light-theme .specs-table tbody td {
    color: #555;
    background: #f9f9f9;
    border-bottom-color: #ebebeb;
}

.specs-table tbody tr:hover td {
    background: #1e1e1e;
}

.light-theme .specs-table tbody tr:hover td {
    background: #f0f0f0;
}

.specs-label-col {
    font-weight: 600;
    color: var(--text-primary, #d4d4d8) !important;
    min-width: 140px;
}

.specs-label-col i {
    color: var(--primary-color);
    margin-right: 8px;
    width: 14px;
    text-align: center;
}

/* === Tooltip en iconos de especificaciones === */
.spec-icon-tip {
    display: inline-flex;
    align-items: center;
    cursor: help;
}

#spec-tooltip-global {
    position: fixed;
    z-index: 9999;
    background: #171717;
    color: #e4e4e7;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.45;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    white-space: normal;
    width: 220px;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

#spec-tooltip-global.visible {
    opacity: 1;
}

#spec-tooltip-global::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.1);
}

.light-theme #spec-tooltip-global {
    background: #ffffff;
    color: #333;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.light-theme #spec-tooltip-global::before {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.light-theme .specs-label-col {
    color: #222 !important;
}

td.spec-best {
    color: #2e7d32 !important;
    font-weight: 700;
}
.light-theme td.spec-best {
    color: #1b5e20 !important;
}

.spec-na {
    opacity: 0.35;
}

@media (max-width: 900px) {
    .winner-banner {
        flex-wrap: wrap;
    }
    .winner-share {
        width: 100%;
    }
    .btn-share {
        width: 100%;
        justify-content: center;
    }
}

/* Percentage diff badges */
.spec-diff {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.spec-diff.diff-worse {
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b6b;
}
.light-theme .spec-diff.diff-worse {
    background: rgba(220, 53, 69, 0.1);
    color: #c0392b;
}

/* Export PNG button */
.btn-export {
    background: rgba(255, 107, 53, 0.12);
    border-color: rgba(255, 107, 53, 0.3);
    color: var(--primary-color);
}
.btn-export:hover {
    background: rgba(255, 107, 53, 0.22);
    border-color: rgba(255, 107, 53, 0.5);
}
.btn-export:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Export PDF button */
.btn-export-pdf {
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}
.btn-export-pdf:hover {
    background: rgba(220, 53, 69, 0.22);
    border-color: rgba(220, 53, 69, 0.5);
}
.btn-export-pdf:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Diff badge: best (green) */
.spec-diff.diff-best {
    background: rgba(76, 175, 80, 0.15);
    color: #66bb6a;
}
.light-theme .spec-diff.diff-best {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
}

/* ===== PER-PROCESSOR ADVANTAGES TABS ===== */
.adv-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.adv-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem 0.45rem 0.5rem;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    flex: 1;
    min-width: 0;
}

.adv-tab:hover {
    border-color: var(--tab-color, var(--primary-color));
    background: rgba(255,255,255,0.06);
}

.adv-tab.active {
    border-color: var(--tab-color, var(--primary-color));
    background: color-mix(in srgb, var(--tab-color, var(--primary-color)) 12%, transparent);
}

.adv-tab-letter {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--tab-color, var(--primary-color));
    color: #0c0d10;
    font-weight: 800;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.adv-tab-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adv-tab.active .adv-tab-name {
    color: var(--text-primary);
}

.light-theme .adv-tab {
    border-color: rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02);
}

.light-theme .adv-tab.active {
    background: color-mix(in srgb, var(--tab-color, var(--primary-color)) 10%, transparent);
    border-color: var(--tab-color, var(--primary-color));
}

/* Panels */
.adv-panel {
    display: none;
}

.adv-panel.active {
    display: block;
    animation: advFadeIn 0.25s ease both;
}

@keyframes advFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Sections: pros / cons */
.adv-section {
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.light-theme .adv-section {
    border-color: rgba(0,0,0,0.06);
}

.adv-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.adv-header-pro {
    background: rgba(76, 175, 80, 0.12);
    color: #66bb6a;
    border-bottom: 1px solid rgba(76, 175, 80, 0.15);
}

.adv-header-con {
    background: rgba(220, 53, 69, 0.1);
    color: #ff6b6b;
    border-bottom: 1px solid rgba(220, 53, 69, 0.12);
}

.light-theme .adv-header-pro {
    background: rgba(76, 175, 80, 0.08);
    color: #2e7d32;
}

.light-theme .adv-header-con {
    background: rgba(220, 53, 69, 0.07);
    color: #c0392b;
}

/* Individual items */
.adv-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.adv-item:last-child {
    border-bottom: none;
}

.light-theme .adv-item {
    border-bottom-color: rgba(0,0,0,0.04);
}

.adv-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--primary-color);
    opacity: 0.75;
}

.adv-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.light-theme .adv-text {
    color: #444;
}

.adv-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    opacity: 0.6;
}

/* ===== Scoring Info Modal ===== */
.btn-scoring-info {
    background: rgba(255,107,53,0.08);
    border-color: rgba(255,107,53,0.3);
    color: var(--primary-color);
}
.btn-scoring-info:hover {
    background: rgba(255,107,53,0.18);
    border-color: rgba(255,107,53,0.55);
}

.scoring-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.72);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}
.light-theme .scoring-modal-overlay {
    background: rgba(0,0,0,0.45);
}

.scoring-modal {
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    width: 100%;
    max-width: 1160px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    animation: scoringModalIn 0.22s cubic-bezier(0.22,0.61,0.36,1) both;
}
.light-theme .scoring-modal {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
}
@keyframes scoringModalIn {
    from { opacity:0; transform: translateY(-18px) scale(0.97); }
    to   { opacity:1; transform: none; }
}

.scoring-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.3rem 1.6rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.light-theme .scoring-modal-header {
    border-bottom-color: rgba(0,0,0,0.08);
}
.scoring-modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.light-theme .scoring-modal-header h2 { color: #111; }
.scoring-modal-header h2 i { color: var(--primary-color); }

.scoring-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}
.scoring-modal-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.light-theme .scoring-modal-close { color: rgba(0,0,0,0.4); }
.light-theme .scoring-modal-close:hover { color: #111; background: rgba(0,0,0,0.06); }

.scoring-modal-body {
    padding: 1.4rem 1.6rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.scoring-intro {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.6;
}
.light-theme .scoring-intro { color: #555; }

.scoring-categories {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.scoring-cat {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 1rem 1.2rem;
}
.light-theme .scoring-cat {
    background: #f7f7f7;
    border-color: rgba(0,0,0,0.07);
}
.scoring-cat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    cursor: pointer;
    user-select: none;
    transition: margin-bottom 0.3s ease;
}
.scoring-cat-header::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid rgba(255,255,255,0.4);
    border-bottom: 2px solid rgba(255,255,255,0.4);
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-left: auto;
    flex-shrink: 0;
}
.light-theme .scoring-cat-header::after {
    border-color: rgba(0,0,0,0.3);
}
.scoring-cat.collapsed .scoring-cat-header {
    margin-bottom: 0;
}
.scoring-cat.collapsed .scoring-cat-header::after {
    transform: rotate(-45deg);
}
.scoring-cat-content {
    overflow: hidden;
    transition: height 0.38s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease;
    opacity: 1;
}
.scoring-cat.collapsed .scoring-cat-content {
    opacity: 0;
}
.scoring-cat-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.scoring-cat-header strong {
    display: block;
    font-size: 0.92rem;
    color: #fff;
    font-weight: 700;
}
.light-theme .scoring-cat-header strong { color: #111; }
.scoring-cat-weight {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}
.scoring-cat p, .scoring-cat ul, .scoring-cat li {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.55;
    margin: 0.3rem 0 0;
}
.light-theme .scoring-cat p,
.light-theme .scoring-cat ul,
.light-theme .scoring-cat li { color: #555; }
.scoring-cat ul { padding-left: 1.2rem; }
.scoring-cat li { margin: 0.15rem 0; }
.scoring-formula {
    background: rgba(255,107,53,0.07);
    border-left: 3px solid rgba(255,107,53,0.4);
    border-radius: 0 6px 6px 0;
    padding: 0.45rem 0.75rem !important;
    font-family: 'Courier New', monospace !important;
    font-size: 0.78rem !important;
}
.light-theme .scoring-formula {
    background: rgba(255,107,53,0.06);
}
.scoring-formula code { font-size: inherit; background: none; }

.scoring-note {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(255,107,53,0.06);
    border: 1px solid rgba(255,107,53,0.18);
    border-radius: 10px;
    padding: 0.9rem 1rem;
}
.scoring-note i {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.scoring-note p {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.55;
}
.light-theme .scoring-note p { color: #555; }

/* === Scoring modal — expanded structure === */
.scoring-info-row {
    text-align: center;
    margin: 1.5rem 0 1rem;
}
.btn-scoring-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(255,107,53,0.07);
    border: 1px solid rgba(255,107,53,0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}
.btn-scoring-info:hover {
    background: rgba(255,107,53,0.15);
    border-color: rgba(255,107,53,0.55);
}
.scoring-modal-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.scoring-modal-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,107,53,0.15);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.scoring-modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}
.light-theme .scoring-modal-header h2 { color: #111; }
.scoring-modal-subtitle {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
}
.light-theme .scoring-modal-subtitle { color: rgba(0,0,0,0.4); }
.scoring-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.8rem;
}
.light-theme .scoring-section-title { color: #111; }
.scoring-section-title i { color: var(--primary-color); }
.scoring-intro-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.scoring-intro-block p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.6;
}
.light-theme .scoring-intro-block p { color: #555; }
.scoring-intro-block ul {
    margin: 0.2rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.83rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.55;
}
.light-theme .scoring-intro-block ul { color: #555; }
.scoring-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 0.4rem 0;
}
.light-theme .scoring-divider { background: rgba(0,0,0,0.07); }

/* === Scoring modal — tab navigation === */
.scoring-tabs-nav {
    display: flex;
    gap: 0;
    padding: 0 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    overflow-x: auto;
}
.light-theme .scoring-tabs-nav { border-bottom-color: rgba(0,0,0,0.08); }
.scoring-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.72rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255,255,255,0.42);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
    margin-bottom: -1px;
    white-space: nowrap;
    flex-shrink: 0;
}
.scoring-tab-btn:hover { color: rgba(255,255,255,0.82); }
.scoring-tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.light-theme .scoring-tab-btn { color: rgba(0,0,0,0.38); }
.light-theme .scoring-tab-btn:hover { color: #111; }
.light-theme .scoring-tab-btn.active { color: var(--primary-color); }
.scoring-tab-panel { display: none; }
.scoring-tab-panel.stab-active { display: flex; flex-direction: column; gap: 1.2rem; }

/* === Scoring modal — JS tooltip === */
.sm-tooltip {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    max-width: 290px;
    background: rgb(30, 30, 30);
    border: 1px solid rgba(255,107,53,0.3);
    border-radius: 8px;
    padding: 0.5rem 0.78rem;
    font-size: 0.76rem;
    color: rgba(255,255,255,0.88);
    line-height: 1.55;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    display: none;
}
.sm-tooltip.tip-visible { display: block; }
.light-theme .sm-tooltip { background: #fff; color: #222; border-color: rgba(255,107,53,0.25); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

/* === Scoring modal — glossary inline terms === */
.gt {
    border-bottom: 1px dashed rgba(255,107,53,0.6);
    cursor: help;
    white-space: nowrap;
    font-style: normal;
}
.light-theme .gt { border-bottom-color: rgba(255,107,53,0.45); }

/* === Scoring modal — tables === */
.scoring-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin: 0.4rem 0;
}
.scoring-table th {
    background: rgba(255,107,53,0.1);
    color: var(--primary-color);
    font-weight: 700;
    padding: 0.45rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,107,53,0.2);
    font-size: 0.76rem;
}
.scoring-table td {
    padding: 0.38rem 0.65rem;
    border-bottom: 1px solid rgba(255,255,255,0.045);
    color: rgba(255,255,255,0.7);
    vertical-align: middle;
}
.scoring-table tr:last-child td { border-bottom: none; }
.scoring-table tr:hover td { background: rgba(255,255,255,0.025); }
.light-theme .scoring-table th { background: rgba(255,107,53,0.08); border-bottom-color: rgba(255,107,53,0.15); }
.light-theme .scoring-table td { color: #444; border-bottom-color: rgba(0,0,0,0.055); }
.light-theme .scoring-table tr:hover td { background: rgba(0,0,0,0.025); }
.scoring-table .td-pts { color: var(--primary-color); font-weight: 700; white-space: nowrap; }
.scoring-table .td-hi { color: #81c784; font-weight: 600; }
.scoring-table .td-med { color: #ffca28; font-weight: 600; }
.scoring-table .td-lo { color: rgba(255,255,255,0.38); }
.light-theme .scoring-table .td-lo { color: #aaa; }

/* === Scoring modal — glosario === */
.glosario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 0.55rem;
}
.glosario-item {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 0.68rem 0.9rem;
}
.light-theme .glosario-item { background: #f7f7f7; border-color: rgba(0,0,0,0.07); }
.glosario-item dt {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.18rem;
}
.glosario-item dd {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.58);
    line-height: 1.5;
}
.light-theme .glosario-item dd { color: #555; }

/* ===== Modal: Desglose de Cálculos ===== */
.btn-calc-detail {
    background: rgba(99,102,241,0.08) !important;
    border-color: rgba(99,102,241,0.3) !important;
    color: #6366f1 !important;
}
.btn-calc-detail:hover {
    background: rgba(99,102,241,0.18) !important;
    border-color: rgba(99,102,241,0.55) !important;
}

.calc-detail-modal-inner {
    max-width: 820px;
}

/* ── Selector desplegable ── */
.calc-gpu-selector-wrap {
    padding: 0.75rem 1.5rem 0;
}
.calc-gpu-selector-inner {
    position: relative;
    display: inline-block;
    width: 100%;
}
.calc-gpu-select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: rgba(255,255,255,0.85);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.light-theme .calc-gpu-select-btn {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.8);
}
.calc-gpu-select-btn:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.18);
}
.light-theme .calc-gpu-select-btn:hover {
    background: rgba(0,0,0,0.05);
}
.calc-gpu-select-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.calc-gpu-select-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calc-gpu-select-arrow {
    font-size: 0.72rem;
    opacity: 0.55;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.calc-gpu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1e2030;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.light-theme .calc-gpu-dropdown {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.calc-gpu-dropdown.open {
    display: block;
}
.calc-gpu-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    font-size: 0.84rem;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.light-theme .calc-gpu-option {
    border-bottom-color: rgba(0,0,0,0.05);
    color: rgba(0,0,0,0.65);
}
.calc-gpu-option:last-child {
    border-bottom: none;
}
.calc-gpu-option:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.95);
}
.light-theme .calc-gpu-option:hover {
    background: rgba(0,0,0,0.04);
    color: rgba(0,0,0,0.9);
}
.calc-gpu-option.selected {
    background: rgb(30, 30, 30);
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}
.light-theme .calc-gpu-option.selected {
    background: rgba(255, 107, 53, 0.15);
    color: rgba(0,0,0,0.9);
}
.calc-gpu-option-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Panel ── */
.calc-detail-panel {
    display: none;
}
.calc-detail-panel.calc-panel-active {
    display: block;
}

.calc-gpu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.calc-gpu-header h3 {
    margin: 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.calc-global-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.4rem 1rem;
    border-radius: 10px;
    font-weight: 700;
}
.calc-global-score {
    font-size: 1.6rem;
    line-height: 1;
}
.calc-global-label {
    font-size: 0.78rem;
    opacity: 0.75;
}

.calc-global-formula {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 1.2rem;
    overflow-x: auto;
    line-height: 1.7;
}
.light-theme .calc-global-formula {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.06);
    color: rgba(0,0,0,0.55);
}
.calc-weight-item {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

/* ── Acordeón de categorías ── */
.calc-category-block {
    margin-bottom: 0.6rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}
.light-theme .calc-category-block {
    border-color: rgba(0,0,0,0.07);
}
.calc-cat-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    background: rgba(255,255,255,0.03);
    border: none;
    border-bottom: 1px solid transparent;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: rgba(255,255,255,0.85);
    transition: background 0.15s;
}
.light-theme .calc-cat-header {
    background: rgba(0,0,0,0.025);
    color: rgba(0,0,0,0.8);
}
.calc-cat-header:hover {
    background: rgba(255,255,255,0.06);
}
.light-theme .calc-cat-header:hover {
    background: rgba(0,0,0,0.045);
}
.calc-cat-header[aria-expanded="true"] {
    border-bottom-color: rgba(255,255,255,0.04);
}
.light-theme .calc-cat-header[aria-expanded="true"] {
    border-bottom-color: rgba(0,0,0,0.04);
}
.calc-cat-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    background: color-mix(in srgb, var(--cat-color) 15%, transparent);
    color: var(--cat-color);
    flex-shrink: 0;
}
.calc-cat-score {
    margin-left: auto;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--cat-color);
}
.calc-cat-weight {
    font-size: 0.72rem;
    opacity: 0.5;
    font-family: 'Courier New', monospace;
}
.calc-cat-chevron {
    font-size: 0.7rem;
    opacity: 0.45;
    transition: transform 0.22s ease;
    margin-left: 0.3rem;
}

.calc-steps {
    transition: height 0.25s ease;
    padding: 0;
}
.calc-steps[style*="height: auto"],
.calc-steps:not([style*="height: 0"]) {
    padding: 0.3rem 0;
}
.calc-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.9rem;
    font-size: 0.78rem;
    gap: 1rem;
}
.calc-step-label {
    color: rgba(255,255,255,0.55);
    flex: 1;
    min-width: 0;
}
.light-theme .calc-step-label {
    color: rgba(0,0,0,0.5);
}
.calc-step-value {
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 0.76rem;
}
.light-theme .calc-step-value {
    color: rgba(0,0,0,0.75);
}
.calc-step-formula {
    background: rgba(99,102,241,0.04);
}
.light-theme .calc-step-formula {
    background: rgba(99,102,241,0.05);
}
.calc-step-formula .calc-step-label {
    color: rgba(255,255,255,0.7);
    font-family: 'Courier New', monospace;
    font-size: 0.74rem;
}
.light-theme .calc-step-formula .calc-step-label {
    color: rgba(0,0,0,0.6);
}
.calc-step-result {
    background: rgba(40,167,69,0.08);
    border-top: 1px solid rgba(40,167,69,0.12);
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}
.calc-step-result .calc-step-label {
    font-weight: 700;
    color: rgba(255,255,255,0.8);
}
.light-theme .calc-step-result .calc-step-label {
    color: rgba(0,0,0,0.7);
}
.calc-step-result .calc-step-value {
    color: #28a745;
    font-weight: 700;
    font-size: 0.82rem;
}
