:root {
    /* Light mode colors */
    --bg-primary: #f7fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-tertiary: #a0aec0;
    --accent-color: #667eea;
    --accent-hover: #5a67d8;
}

body.dark-mode {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-tertiary: #718096;
    --accent-color: #9f7aea;
    --accent-hover: #b794f4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    overflow: visible;
}

h1 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.ascii-title {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.2;
    color: #667eea;
    margin-bottom: 1.5rem;
    white-space: pre;
    overflow-x: auto;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: default;
}

.ascii-title:hover {
    color: #764ba2;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    transform: scale(1.02);
}

body.dark-mode .ascii-title {
    color: #9f7aea;
}

body.dark-mode .ascii-title:hover {
    color: #c4b5fd;
    text-shadow: 0 0 25px rgba(159, 122, 234, 0.6);
}

/* Tablet size - medium */
@media (max-width: 768px) {
    .ascii-title {
        font-size: 0.42rem;
        text-align: center;
        line-height: 1.1;
    }
}

/* Mobile size - extra small */
@media (max-width: 480px) {
    .ascii-title {
        font-size: 0.28rem;
        line-height: 1.0;
    }
}

/* Site Header & Navigation */
.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.logo-link {
    text-decoration: none;
    display: block;
}

.logo-link .ascii-title {
    margin-bottom: 0;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 12px;
    margin-top: 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-btn i {
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.nav-btn:hover {
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
}

.nav-btn:hover i {
    transform: scale(1.1);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.nav-btn.active:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
}

/* Dark mode navigation */
body.dark-mode .main-nav {
    background: linear-gradient(135deg, rgba(159, 122, 234, 0.1) 0%, rgba(183, 148, 244, 0.1) 100%);
}

body.dark-mode .nav-btn {
    color: #a0aec0;
}

body.dark-mode .nav-btn:hover {
    background: rgba(159, 122, 234, 0.15);
    color: #c4b5fd;
}

body.dark-mode .nav-btn.active {
    background: linear-gradient(135deg, #9f7aea 0%, #b794f4 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(159, 122, 234, 0.4);
}

body.dark-mode .nav-btn.active:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    box-shadow: 0 6px 16px rgba(159, 122, 234, 0.5);
}

/* Responsive navigation */
@media (max-width: 600px) {
    .main-nav {
        flex-direction: column;
        width: 100%;
        gap: 0.25rem;
    }
    
    .nav-btn {
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .nav-btn span {
        font-size: 0.85rem;
    }
    
    .nav-btn i {
        font-size: 0.9rem;
    }
}

/* Intro Section Styling */
.intro-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 2.5rem;
}

.intro-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2d3748;
    margin-bottom: 1.25rem;
}

.usage-text {
    font-size: 0.925rem;
    line-height: 1.65;
    color: #718096;
}

.intro-text p,
.usage-text p {
    margin-bottom: 0.5rem;
}

.intro-text p:last-child,
.usage-text p:last-child {
    margin-bottom: 0;
}

.intro-section a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.intro-section a:hover {
    color: #5a67d8;
    border-bottom-color: #5a67d8;
}

.intro-section i {
    color: #667eea;
    font-size: 0.85rem;
}

/* Dark mode styles for intro section */
body.dark-mode .intro-section {
    background: transparent;
}

body.dark-mode .intro-text {
    color: #e2e8f0;
}

body.dark-mode .usage-text {
    color: #a0aec0;
}

body.dark-mode .intro-section a {
    color: #9f7aea;
    border-bottom-color: rgba(159, 122, 234, 0.3);
}

body.dark-mode .intro-section a:hover {
    color: #b794f4;
    border-bottom-color: #b794f4;
}

body.dark-mode .intro-section i {
    color: #9f7aea;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .intro-section {
        margin-bottom: 2rem;
    }

    .intro-text {
        font-size: 1rem;
    }

    .usage-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .intro-text {
        font-size: 0.95rem;
    }

    .usage-text {
        font-size: 0.875rem;
    }
}

h2 {
    color: #4a5568;
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

body.dark-mode h2 {
    color: #a0aec0;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: stretch;
}

.search-box {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    height: 44px;
    box-sizing: border-box;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: #f7fafc;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    height: 44px;
    box-sizing: border-box;
}

body.dark-mode .filter-group {
    background: #1a202c;
    border-color: #4a5568;
}

.filter-group label {
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-mode .filter-group label {
    color: #cbd5e0;
}

.filter-group input[type="radio"] {
    cursor: pointer;
}

.language-select {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.95rem;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
}

.language-select:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.language-select:focus {
    outline: none;
    background-color: rgba(102, 126, 234, 0.1);
}

body.dark-mode .language-select {
    background-color: transparent;
    color: #cbd5e0;
}

body.dark-mode .language-select:hover {
    background-color: rgba(102, 126, 234, 0.2);
}

.search-box:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding-top: 3rem;
    margin-top: -3rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    overflow: visible;
}

body.dark-mode table {
    background: #2d3748;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow: visible;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s ease;
    overflow: visible;
}

th:first-child {
    border-top-left-radius: 0.5rem;
}

th:last-child {
    border-top-right-radius: 0.5rem;
}

th:hover {
    background: rgba(255, 255, 255, 0.1);
}

th::after {
    content: '⇅';
    position: absolute;
    right: 1rem;
    opacity: 0.5;
    font-size: 0.8rem;
}

th.sort-asc::after {
    content: '↑';
    opacity: 1;
}

th.sort-desc::after {
    content: '↓';
    opacity: 1;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f7fafc;
}

.layout-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.layout-name a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.2s ease;
}

.layout-name a:hover {
    color: #667eea;
    text-decoration: underline;
}

body.dark-mode .layout-name a {
    color: #e2e8f0;
}

body.dark-mode .layout-name a:hover {
    color: #9f7aea;
}

.stat-value {
    font-variant-numeric: tabular-nums;
    color: #4a5568;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #718096;
    font-size: 1.1rem;
}

.link-cell a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.link-cell a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.footer {
    margin-top: 2rem;
    text-align: center;
    color: #718096;
    font-size: 0.85rem;
    position: relative;
}

.footer a {
    color: #667eea;
    text-decoration: none;
}

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

body.dark-mode .footer a {
    color: #9f7aea;
}

body.dark-mode .footer a:hover {
    color: #b794f4;
}

/* Keycap styling for name in footer */
.keycap-name {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    vertical-align: middle;
}

.keycap-name .space {
    width: 6px;
}

.keycap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(145deg, #f0f0f0 0%, #e0e0e0 50%, #d5d5d5 100%);
    border-radius: 3px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 10px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    position: relative;
    box-shadow: 
        0 1px 0 0px #c0c0c0,
        0 2px 0 0px #b5b5b5,
        0 2px 2px 0px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.1s ease;
    transform: translateY(0);
}

.keycap::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 2px;
    background: linear-gradient(145deg, #fafafa 0%, #f0f0f0 30%, #eaeaea 100%);
    border-radius: 2px;
    z-index: -1;
}

.keycap:hover {
    transform: translateY(1px);
    box-shadow: 
        0 0px 0 0px #c0c0c0,
        0 1px 0 0px #b5b5b5,
        0 1px 1px 0px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

a.keycap-link {
    text-decoration: none;
}

a.keycap-link:hover {
    text-decoration: none;
}

a.keycap-link .keycap:hover {
    background: linear-gradient(145deg, #e8e8ff 0%, #d8d8f0 50%, #d0d0e8 100%);
}

a.keycap-link .keycap:hover::before {
    background: linear-gradient(145deg, #f0f0ff 0%, #e8e8f8 30%, #e4e4f4 100%);
}

/* Dark mode keycaps */
body.dark-mode .keycap {
    background: linear-gradient(145deg, #4a4a5a 0%, #3a3a4a 50%, #2a2a3a 100%);
    color: #e0e0e0;
    box-shadow: 
        0 1px 0 0px #2a2a3a,
        0 2px 0 0px #1a1a2a,
        0 2px 2px 0px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

body.dark-mode .keycap::before {
    background: linear-gradient(145deg, #5a5a6a 0%, #4a4a5a 30%, #404050 100%);
}

body.dark-mode .keycap:hover {
    box-shadow: 
        0 0px 0 0px #2a2a3a,
        0 1px 0 0px #1a1a2a,
        0 1px 1px 0px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.dark-mode a.keycap-link .keycap:hover {
    background: linear-gradient(145deg, #5a5a7a 0%, #4a4a6a 50%, #3a3a5a 100%);
}

body.dark-mode a.keycap-link .keycap:hover::before {
    background: linear-gradient(145deg, #6a6a8a 0%, #5a5a7a 30%, #4a4a6a 100%);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    padding: 0.25rem;
    color: #718096;
    margin-top: 1rem;
    opacity: 0.7;
}

.theme-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
}

.theme-toggle-light {
    display: none;
}

body.dark-mode .theme-toggle {
    color: #a0aec0;
}

body.dark-mode .theme-toggle-light {
    display: inline;
}

body.dark-mode .theme-toggle-dark {
    display: none;
}

/* Dark mode styles */
body.dark-mode {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

body.dark-mode .container {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode h1 {
    color: #e2e8f0;
}

body.dark-mode .search-box {
    background: #1a202c;
    color: #e2e8f0;
    border-color: #4a5568;
}

body.dark-mode .search-box:focus {
    border-color: #667eea;
}

body.dark-mode td {
    border-bottom-color: #4a5568;
}

body.dark-mode tbody tr:hover {
    background: #1a202c;
}

body.dark-mode .layout-name {
    color: #e2e8f0;
}

body.dark-mode .stat-value {
    color: #cbd5e0;
}

body.dark-mode .footer {
    color: #a0aec0;
}

body.dark-mode .link-cell a {
    color: #9f7aea;
}

body.dark-mode .link-cell a:hover {
    color: #b794f4;
}

.pin-star-column {
    width: 60px;
    text-align: center;
    padding: 1rem 0.25rem !important;
}

.pin-star-icons {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
}

.pin-icon,
.star-icon {
    cursor: pointer;
    font-size: 1.2rem;
    color: #cbd5e0;
    transition: all 0.2s ease;
    user-select: none;
}

.pin-icon:hover {
    color: #667eea;
    transform: scale(1.2);
}

.pin-icon.pinned {
    color: #667eea;
}

body.dark-mode .pin-icon {
    color: #4a5568;
}

body.dark-mode .pin-icon.pinned {
    color: #9f7aea;
}

.star-icon:hover {
    color: #f59e0b;
    transform: scale(1.2);
}

.star-icon.starred {
    color: #f59e0b;
}

body.dark-mode .star-icon {
    color: #4a5568;
}

body.dark-mode .star-icon.starred {
    color: #fbbf24;
}

tbody tr.starred {
    background: #fef3c7;
}

body.dark-mode tbody tr.starred {
    background: #78350f;
}

tbody tr.starred:hover {
    background: #fde68a !important;
}

body.dark-mode tbody tr.starred:hover {
    background: #92400e !important;
}

.external-link-icon {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.external-link-icon:hover {
    opacity: 1;
}

.thumb-icon {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.8rem;
    opacity: 0.6;
    color: inherit;
}

.tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted currentColor;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #2d3748;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2d3748;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

/* Right-aligned tooltips for last columns */
th:nth-last-child(-n+4) .tooltip::after {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(-8px);
}

th:nth-last-child(-n+4) .tooltip::before {
    left: auto;
    right: 1rem;
    transform: translateX(0);
}

th:nth-last-child(-n+4) .tooltip:hover::after {
    transform: translateX(0) translateY(-12px);
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

.tooltip:hover::before {
    opacity: 1;
}

body.dark-mode .tooltip::after {
    background: #1a202c;
    border: 1px solid #4a5568;
}

body.dark-mode .tooltip::before {
    border-top-color: #1a202c;
}

body.dark-mode .no-results,
body.dark-mode .loading {
    color: #a0aec0;
}

/* Score Controls Wrapper */
.score-controls-wrapper {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.score-controls-wrapper[open] .toggle-icon {
    transform: rotate(180deg);
}

.score-controls-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #4a5568;
    list-style: none;
    user-select: none;
}

.score-controls-toggle::-webkit-details-marker {
    display: none;
}

.score-controls-toggle i {
    color: #667eea;
}

.score-controls-toggle .toggle-icon {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.score-controls-toggle:hover {
    background: rgba(102, 126, 234, 0.08);
}

.score-controls {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.preset-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.preset-label {
    font-size: 0.85rem;
    color: #718096;
    margin-right: 0.25rem;
}

.preset-btn {
    padding: 0.4rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    color: #4a5568;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.preset-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.weight-sliders {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weight-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weight-control label {
    font-size: 0.85rem;
    color: #4a5568;
    font-weight: 600;
    min-width: 65px;
}

.weight-description {
    font-size: 0.75rem;
    color: #718096;
    flex: 1;
}

.weight-control input[type="range"] {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    cursor: pointer;
}

.weight-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.weight-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.weight-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.weight-value {
    width: 55px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    text-align: center;
    color: #4a5568;
}

.weight-value:focus {
    outline: none;
    border-color: #667eea;
}

/* Dark mode score controls */
body.dark-mode .score-controls-wrapper {
    background: linear-gradient(135deg, rgba(159, 122, 234, 0.08) 0%, rgba(183, 148, 244, 0.08) 100%);
    border-color: #4a5568;
}

body.dark-mode .score-controls-toggle {
    color: #cbd5e0;
}

body.dark-mode .score-controls-toggle i {
    color: #9f7aea;
}

body.dark-mode .score-controls {
    border-top-color: #4a5568;
}

body.dark-mode .preset-label {
    color: #a0aec0;
}

body.dark-mode .preset-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #cbd5e0;
}

body.dark-mode .preset-btn:hover {
    border-color: #9f7aea;
    color: #b794f4;
}

body.dark-mode .preset-btn.active {
    background: linear-gradient(135deg, #9f7aea 0%, #b794f4 100%);
    color: white;
}

body.dark-mode .weight-control label {
    color: #cbd5e0;
}

body.dark-mode .weight-control input[type="range"] {
    background: #4a5568;
}

body.dark-mode .weight-control input[type="range"]::-webkit-slider-thumb {
    background: linear-gradient(135deg, #9f7aea 0%, #b794f4 100%);
}

body.dark-mode .weight-control input[type="range"]::-moz-range-thumb {
    background: linear-gradient(135deg, #9f7aea 0%, #b794f4 100%);
}

body.dark-mode .weight-value {
    background: #1a202c;
    border-color: #4a5568;
    color: #cbd5e0;
}

body.dark-mode .weight-value:focus {
    border-color: #9f7aea;
}

body.dark-mode .weight-description {
    color: #718096;
}

/* Nested Score Explanation (inside weight controls) */
.score-explanation-nested {
    margin-top: 1.25rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.score-explanation-nested summary {
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-explanation-nested summary::-webkit-details-marker {
    display: none;
}

.score-explanation-nested summary:hover {
    background: rgba(100, 116, 139, 0.08);
    border-radius: 0.5rem;
}

.score-explanation-nested[open] summary {
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0.5rem 0.5rem 0 0;
}

.score-explanation-nested .score-explanation-content {
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #475569;
    background: #f8fafc;
    border-radius: 0 0 0.5rem 0.5rem;
}

.score-explanation-nested .score-explanation-content h4 {
    color: #334155;
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.score-explanation-nested .score-explanation-content h4:first-child {
    margin-top: 0;
}

.score-explanation-nested .score-explanation-content p {
    margin-bottom: 0.4rem;
}

/* Dark mode nested score explanation */
body.dark-mode .score-explanation-nested {
    background: #1e293b;
    border-color: #475569;
}

body.dark-mode .score-explanation-nested summary {
    color: #94a3b8;
}

body.dark-mode .score-explanation-nested summary:hover {
    background: rgba(148, 163, 184, 0.1);
}

body.dark-mode .score-explanation-nested[open] summary {
    border-bottom-color: #475569;
}

body.dark-mode .score-explanation-nested .score-explanation-content {
    background: #0f172a;
    color: #94a3b8;
}

body.dark-mode .score-explanation-nested .score-explanation-content h4 {
    color: #cbd5e1;
}

/* Score Explanation in Footer - REMOVED, now using nested version */

/* Responsive weight controls */
@media (max-width: 600px) {
    .weight-control label {
        min-width: 55px;
        font-size: 0.8rem;
    }
    
    .weight-control input[type="range"] {
        width: 60px;
    }
    
    .weight-description {
        display: none;
    }
}

/* Score value styling */
.score-value {
    font-weight: 600;
    color: #667eea !important;
}

body.dark-mode .score-value {
    color: #9f7aea !important;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
}
