/* =============================================================================
   🧬 SYMBOLIC REGRESSION — self-modifying FinalScore Lab panel CSS
   ============================================================================= */

.panel-sr {
    background:
        radial-gradient(ellipse at top left, rgba(214,153,255,0.07), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(255,216,107,0.07), transparent 60%),
        linear-gradient(180deg, rgba(28,20,55,0.94), rgba(10,8,24,0.97));
    border: 1px solid rgba(214,153,255,0.30);
    border-radius: 14px;
    padding: 22px 26px;
    margin-top: 18px;
    box-shadow:
        0 10px 32px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(214,153,255,0.10);
}

/* ── HEADLINE STRIP ────────────────────────────────────────────────────── */

.sr-headline-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 12px 0 16px;
}

.sr-headline-card {
    background: linear-gradient(180deg, rgba(214,153,255,0.06), rgba(10,8,24,0.50));
    border: 1px solid rgba(214,153,255,0.24);
    border-radius: 10px;
    padding: 12px 14px;
}

.sr-headline-label {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 10.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #b095f5;
    margin-bottom: 4px;
}

.sr-headline-value {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    color: #d699ff;
    line-height: 1.2;
    letter-spacing: 0.8px;
}

.sr-headline-sub {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    color: #888aa0;
    font-style: italic;
    margin-top: 4px;
}

/* ── BEST FORMULA CARD ─────────────────────────────────────────────────── */

.sr-formula-card {
    background: linear-gradient(180deg, rgba(255,216,107,0.07), rgba(10,8,24,0.55));
    border: 1px solid rgba(255,216,107,0.36);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 0 16px rgba(255,216,107,0.10);
}

.sr-formula-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.sr-formula-title {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
    color: #ffd86b;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.sr-formula-meta {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    color: #888aa0;
    font-style: italic;
}

.sr-formula-text {
    font-family: "Cascadia Mono", "Courier New", monospace;
    font-size: 14px;
    color: #ddc88a;
    background: rgba(10,8,24,0.65);
    border: 1px dashed rgba(212,175,55,0.20);
    border-radius: 6px;
    padding: 12px 14px;
    line-height: 1.6;
    word-break: break-word;
    overflow-x: auto;
}

.sr-formula-interp {
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    font-size: 12px;
    color: #b095f5;
    margin-top: 8px;
}

/* ── FITNESS CURVE + LEADERBOARD ───────────────────────────────────────── */

.sr-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.sr-card {
    background: rgba(10,8,24,0.55);
    border: 1px solid rgba(212,175,55,0.14);
    border-radius: 10px;
    padding: 12px 14px;
}

.sr-card-title {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
    color: #ddc88a;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}

.sr-fitness-canvas {
    width: 100%;
    height: 250px;
    display: block;
    border-radius: 6px;
}

.sr-fitness-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    color: #888aa0;
}

.sr-fitness-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sr-fitness-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 4px currentColor;
}

.sr-dot-best   { background: #ffd86b; color: #ffd86b; }
.sr-dot-mean   { background: #d699ff; color: #d699ff; }
.sr-dot-base   { background: rgba(255,255,255,0.35); color: rgba(255,255,255,0.4); }

/* Leaderboard list */
.sr-leader-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 290px;
    overflow-y: auto;
}

.sr-leader-item {
    background: linear-gradient(90deg, rgba(214,153,255,0.06), transparent 80%);
    border-left: 2px solid rgba(214,153,255,0.40);
    padding: 7px 10px;
    border-radius: 0 6px 6px 0;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
}

.sr-leader-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.sr-leader-rank {
    color: #ffd86b;
    font-weight: 600;
}

.sr-leader-meta {
    color: #888aa0;
    font-size: 11px;
    font-style: italic;
}

.sr-leader-text {
    font-family: "Cascadia Mono", "Courier New", monospace;
    font-size: 11px;
    color: #ddc88a;
    line-height: 1.4;
    word-break: break-word;
}

/* ── POPULATION TREE RENDER ────────────────────────────────────────────── */

.sr-tree-card {
    background: rgba(10,8,24,0.55);
    border: 1px solid rgba(212,175,55,0.14);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.sr-tree-canvas {
    width: 100%;
    height: 280px;
    display: block;
    border-radius: 6px;
}

.sr-vars-strip {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sr-var-chip {
    background: rgba(176,149,245,0.10);
    border: 1px solid rgba(176,149,245,0.25);
    border-radius: 999px;
    padding: 2px 10px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 10.5px;
    color: #b095f5;
    letter-spacing: 0.4px;
}

/* ── CONTROLS + FOOT ───────────────────────────────────────────────────── */

.sr-interp {
    background: linear-gradient(90deg, rgba(214,153,255,0.07), transparent 80%);
    border-left: 2px solid rgba(214,153,255,0.50);
    border-radius: 0 6px 6px 0;
    padding: 10px 16px;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    font-size: 13px;
    color: #ddc88a;
    line-height: 1.5;
    margin-bottom: 12px;
}

.sr-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(212,175,55,0.14);
    flex-wrap: wrap;
}

.sr-btn-group {
    display: inline-flex;
    gap: 8px;
}

.sr-btn {
    background: rgba(214,153,255,0.10);
    color: #d699ff;
    border: 1px solid rgba(214,153,255,0.30);
    border-radius: 999px;
    padding: 6px 14px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.sr-btn:hover:not(:disabled) {
    background: rgba(214,153,255,0.20);
    transform: translateY(-1px);
}
.sr-btn:disabled { opacity: 0.55; cursor: progress; }

.sr-btn-start { color: #88d8b0; border-color: rgba(136,216,176,0.35); background: rgba(136,216,176,0.10); }
.sr-btn-start:hover:not(:disabled) { background: rgba(136,216,176,0.20); }

.sr-btn-stop { color: #ff7b9d; border-color: rgba(255,123,157,0.35); background: rgba(255,123,157,0.10); }
.sr-btn-stop:hover:not(:disabled) { background: rgba(255,123,157,0.20); }

.sr-foot-note {
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    font-size: 11px;
    color: #888aa0;
}

.sr-running-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(136,216,176,0.16);
    color: #88d8b0;
    border: 1px solid rgba(136,216,176,0.40);
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    animation: srRunning 2s ease-in-out infinite;
}
@keyframes srRunning {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 0.35; }
}

@media (max-width: 900px) {
    .sr-headline-row { grid-template-columns: repeat(2, 1fr); }
    .sr-row { grid-template-columns: 1fr; }
}
