/* MFT Q-Ball Lepton Spectrum Solver — styling (v2) */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #222;
    background: #fff;
    line-height: 1.55;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */

.site-header {
    border-bottom: 1px solid #e5e5e5;
    padding: 14px 0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    color: #111;
}

.site-nav {
    display: flex;
    gap: 24px;
}

.site-nav a {
    text-decoration: none;
    color: #555;
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover, .site-nav a.active {
    color: #111;
    border-bottom-color: #2c5aa0;
}

/* Page content */

main {
    padding: 40px 24px 80px;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #111;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px;
    color: #111;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 8px;
    color: #333;
}

.lede {
    color: #444;
    margin: 0 0 32px;
    max-width: 820px;
}

/* Status / loading */

.status {
    background: #f8f9fc;
    border: 1px solid #e5e5e5;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 32px;
}

.status p {
    margin: 0 0 12px;
    color: #555;
}

.progress-bar {
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #2c5aa0;
    transition: width 0.3s ease;
}

/* Solver layout */

.solver-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    margin: 24px 0;
}

@media (max-width: 800px) {
    .solver-grid {
        grid-template-columns: 1fr;
    }
}

/* Controls */

.controls {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 20px;
    background: #fafbfd;
    align-self: start;
    position: sticky;
    top: 80px;
}

@media (max-width: 800px) {
    .controls { position: static; }
}

.controls h2 {
    margin-top: 0;
    font-size: 16px;
    font-weight: 600;
}

.control {
    margin: 14px 0;
}

.control label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 4px;
}

.hint-inline {
    color: #888;
    font-weight: 400;
    font-size: 12px;
}

.control input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 14px;
    background: #fff;
}

.control input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.15);
}

hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 18px 0;
}

.presets {
    margin-bottom: 8px;
}

.preset-label {
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin: 0 0 6px;
}

.preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.preset {
    padding: 8px 6px;
    border: 1px solid #2c5aa0;
    background: #fff;
    color: #2c5aa0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.preset:hover {
    background: #2c5aa0;
    color: #fff;
}

.preset.active {
    background: #2c5aa0;
    color: #fff;
}

.preset-description {
    font-size: 12px;
    color: #555;
    margin: 8px 0 0;
    line-height: 1.5;
}

.solve-button {
    width: 100%;
    padding: 12px;
    background: #2c5aa0;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.15s;
}

.solve-button:hover:not(:disabled) {
    background: #234a85;
}

.solve-button:disabled {
    background: #888;
    cursor: not-allowed;
}

.solve-time-note {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin: 4px 0 0;
}

.silver-ratio-note {
    margin-top: 18px;
    padding: 10px 12px;
    background: #f0f4fa;
    border-left: 3px solid #2c5aa0;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
}

.silver-ratio-note p {
    margin: 0;
    color: #444;
    line-height: 1.5;
}

/* Results */

.results {
    min-width: 0;
}

.results h2 {
    margin-top: 0;
}

.results-summary {
    background: #f8f9fc;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #444;
}

.results-summary p {
    margin: 0 0 6px;
}

.results-summary p:last-child {
    margin-bottom: 0;
}

.results-summary .placeholder {
    color: #888;
    font-style: italic;
}

.results-summary .error {
    color: #c0392b;
}

.results-summary .hint, .hint {
    margin-top: 6px;
    font-size: 12px;
    color: #777;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.badge.ok {
    background: #d5f5e3;
    color: #1e7e34;
}

.badge.warn {
    background: #fdebd0;
    color: #b9770e;
}

/* Lepton triple table */

.lepton-triple-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 18px;
    font-size: 13px;
}

.lepton-triple-table th {
    text-align: left;
    padding: 8px 10px;
    background: #2c5aa0;
    color: #fff;
    font-weight: 600;
}

.lepton-triple-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #eee;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.lepton-triple-table .lepton-row td:first-child {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
}

.lepton-triple-table .lepton-row.electron {
    background: rgba(39, 174, 96, 0.05);
}
.lepton-triple-table .lepton-row.muon {
    background: rgba(44, 90, 160, 0.05);
}
.lepton-triple-table .lepton-row.tau {
    background: rgba(192, 57, 43, 0.05);
}

.lepton-ratios-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 18px;
    font-size: 13px;
    max-width: 480px;
}

.lepton-ratios-table th {
    text-align: left;
    padding: 6px 10px;
    background: #f0f4fa;
    color: #234a85;
    font-weight: 600;
}

.lepton-ratios-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.lepton-ratios-table td:first-child {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
}

/* Color dots */

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.lepton-tag {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 6px;
    border-radius: 8px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
    text-transform: lowercase;
}

.stab-tag {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
}

.stab-stable {
    background: #d5f5e3;
    color: #1e7e34;
}

.stab-metastable {
    background: #fdebd0;
    color: #b9770e;
}

.stab-unstable {
    background: #f5b7b1;
    color: #922b21;
}

.muted {
    color: #ccc;
}

/* Plots */

.plots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 700px) {
    .plots {
        grid-template-columns: 1fr;
    }
}

.plot-container {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 12px;
    background: #fff;
}

.plot-container h3 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-align: center;
}

.plot-container canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Spectrum table */

.spectrum-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-top: 8px;
}

.spectrum-table-wrapper::-webkit-scrollbar {
    width: 10px;
}
.spectrum-table-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
}
.spectrum-table-wrapper::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 5px;
}
.spectrum-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.spectrum-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.spectrum-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.spectrum-table th {
    text-align: left;
    padding: 7px 10px;
    background: #f0f4fa;
    border-bottom: 2px solid #2c5aa0;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    color: #234a85;
}

.spectrum-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
}

.spectrum-table tr:hover td {
    background: #fafbfd;
}

.spectrum-table .lepton-row.electron {
    background: rgba(39, 174, 96, 0.08);
    font-weight: 600;
}
.spectrum-table .lepton-row.muon {
    background: rgba(44, 90, 160, 0.08);
    font-weight: 600;
}
.spectrum-table .lepton-row.tau {
    background: rgba(192, 57, 43, 0.08);
    font-weight: 600;
}

/* Explanatory section */

.explanatory {
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid #e5e5e5;
    max-width: 820px;
}

.explanatory p {
    color: #444;
    margin: 0 0 14px;
}

.explanatory strong {
    color: #111;
}

/* Footer */

.page-footer {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
    color: #888;
    font-size: 13px;
}

.page-footer a {
    color: #2c5aa0;
    text-decoration: none;
}

.page-footer a:hover {
    text-decoration: underline;
}

/* ─── Energy Landscape Visualizer styles ─── */

.ls-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    margin: 24px 0;
}

@media (max-width: 800px) {
    .ls-grid { grid-template-columns: 1fr; }
}

/* Slider container */
.rho-slider-container {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 16px 18px;
    margin: 16px 0;
    transition: all 0.2s;
}

.rho-slider-container.silver-active {
    border-color: #2c5aa0;
    background: linear-gradient(to right, #f7f9fc, #fff, #f7f9fc);
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.18);
}

.rho-display {
    text-align: center;
    margin-bottom: 12px;
}

.rho-display .rho-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: #234a85;
    line-height: 1;
}

.rho-display .rho-label {
    display: block;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.rho-display .silver-tag {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.silver-tag.is-silver {
    background: #e8eef5;
    color: #234a85;
    box-shadow: 0 0 0 1px rgba(44,90,160,0.4);
}

.silver-tag.no-barrier {
    background: #f5b7b1;
    color: #922b21;
}

.silver-tag.has-barrier {
    background: #fdebd0;
    color: #8a4f1b;
}

/* Slider */
input[type=range].rho-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right,
                #f5b7b1 0%, #f5b7b1 18.75%,
                #fdebd0 18.75%, #fdebd0 43.75%,
                #2c5aa0 43.75%, #2c5aa0 50%,
                #fdebd0 50%, #fdebd0 100%);
    border-radius: 4px;
    outline: none;
    margin: 8px 0;
    cursor: pointer;
}

input[type=range].rho-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #2c5aa0;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type=range].rho-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #2c5aa0;
    cursor: pointer;
}

.slider-tick-row {
    position: relative;
    height: 18px;
    margin: 4px 2px 0;
    font-size: 11px;
    color: #666;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.slider-tick-row .tick {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.slider-tick-row .tick.silver {
    color: #2c5aa0;
    font-weight: 700;
}

/* Critical-point readouts */
.crit-points-block, .silver-comparison-block {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 14px 16px;
    margin-top: 14px;
}

.silver-comparison-block {
    border-left: 4px solid #2c5aa0;
    background: linear-gradient(135deg, #f7f9fc 0%, #fff 100%);
}

.crit-points-block h4, .silver-comparison-block h4 {
    margin: 0 0 10px;
    font-size: 12px;
    color: #234a85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crit-row, .ratio-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.crit-row:last-child, .ratio-row:last-child { border-bottom: none; }

.crit-row .crit-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.crit-row.cp-zero .crit-dot { background: #27ae60; }
.crit-row.cp-barrier .crit-dot { background: #d4a017; }
.crit-row.cp-vacuum .crit-dot { background: #c0392b; }

.crit-row .crit-name, .ratio-row .ratio-name {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    color: #444;
    font-weight: 600;
}

.crit-row .crit-vals, .ratio-row .ratio-val {
    text-align: right;
    color: #555;
}

.crit-row .crit-vals strong, .ratio-row .ratio-val strong {
    color: #234a85;
    font-weight: 600;
}

.ratio-row .target {
    text-align: right;
    color: #888;
    font-size: 11.5px;
    margin-top: 1px;
}

/* Preset buttons (re-use existing .preset class with these tweaks) */
.regime-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 14px;
}

.regime-presets .preset {
    padding: 9px 6px;
    font-size: 11.5px;
}

.regime-description {
    font-size: 12.5px;
    color: #555;
    line-height: 1.55;
    margin: 12px 0 0;
    padding: 10px 12px;
    background: #f7f9fc;
    border-radius: 4px;
    border-left: 3px solid #2c5aa0;
}

/* Plot title with regime tag */
.plot-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.plot-title-row h3 {
    margin: 0;
}

.regime-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 10px;
}

.regime-tag.regime-no-barrier {
    background: #f5b7b1;
    color: #922b21;
}

.regime-tag.regime-degenerate {
    background: #f5dccd;
    color: #8a4f1b;
}

.regime-tag.regime-asymmetric {
    background: #fdebd0;
    color: #b9770e;
}

.regime-tag.regime-silver {
    background: #e8eef5;
    color: #234a85;
}

.regime-tag.regime-skewed {
    background: #efe8f4;
    color: #6a4c93;
}
