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

:root {
    --dc-bg: #f5f5f5;
    --dc-surface: #ffffff;
    --dc-text: #333333;
    --dc-text-secondary: #666666;
    --dc-text-muted: #888888;
    --dc-border: #e0e0e0;
    --dc-border-light: #eeeeee;
    --dc-accent: #4a90d9;
    --dc-accent-hover: #3a7bc8;
    --dc-accent-bg: #f0f6ff;
    --dc-accent-bg-hover: #f8fbff;
    --dc-info-bg: #f8f9fa;
    --dc-info-border: #dddddd;
    --dc-btn-bg: #e8e8e8;
    --dc-btn-text: #555555;
    --dc-btn-hover: #dddddd;
    --dc-tag-pos-bg: #d4edda;
    --dc-tag-pos-text: #155724;
    --dc-tag-neg-bg: #f8d7da;
    --dc-tag-neg-text: #721c24;
    --dc-tag-neu-bg: #e2e3e5;
    --dc-tag-neu-text: #383d41;
    --dc-tag-block-bg: #f5c6cb;
    --dc-tag-block-text: #721c24;
    --dc-warning: #e67e22;
    --dc-shadow: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --dc-bg: #1a1a2e;
        --dc-surface: #25253e;
        --dc-text: #e0e0e0;
        --dc-text-secondary: #b0b0b0;
        --dc-text-muted: #888888;
        --dc-border: #3a3a5c;
        --dc-border-light: #33334d;
        --dc-accent: #5da0e9;
        --dc-accent-hover: #4a90d9;
        --dc-accent-bg: #1e2a3e;
        --dc-accent-bg-hover: #243044;
        --dc-info-bg: #2a2a44;
        --dc-info-border: #3a3a5c;
        --dc-btn-bg: #3a3a5c;
        --dc-btn-text: #cccccc;
        --dc-btn-hover: #4a4a6c;
        --dc-tag-pos-bg: #1a3a2a;
        --dc-tag-pos-text: #7dcea0;
        --dc-tag-neg-bg: #3a1a1e;
        --dc-tag-neg-text: #e8a0a8;
        --dc-tag-neu-bg: #33334d;
        --dc-tag-neu-text: #b0b0b0;
        --dc-tag-block-bg: #3a1a1e;
        --dc-tag-block-text: #e8a0a8;
        --dc-warning: #f0a050;
        --dc-shadow: rgba(0, 0, 0, 0.3);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--dc-bg);
    color: var(--dc-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#distrochooser-app {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
}

.dc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--dc-border-light);
}

.dc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dc-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--dc-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.dc-sidebar-toggle:hover {
    background: var(--dc-btn-bg);
}

.dc-body {
    display: flex;
    gap: 20px;
}

.dc-sidebar {
    width: 200px;
    flex-shrink: 0;
}

.dc-sidebar-nav {
    position: sticky;
    top: 16px;
}

.dc-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--dc-text-secondary);
    transition: all 0.12s;
    line-height: 1.3;
    user-select: none;
}

.dc-sidebar-item:hover {
    background: var(--dc-info-bg);
    color: var(--dc-text);
}

.dc-sidebar-item.current {
    background: var(--dc-accent-bg);
    color: var(--dc-accent);
    font-weight: 600;
}

.dc-sidebar-item.answered .dc-sidebar-dot {
    background: var(--dc-accent);
}

.dc-sidebar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--dc-border);
    flex-shrink: 0;
}

.dc-sidebar-item.current .dc-sidebar-dot {
    border-color: var(--dc-accent);
    background: var(--dc-accent);
}

.dc-sidebar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dc-sidebar-item-result {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--dc-border-light);
    font-weight: 500;
}

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

.dc-header-icon {
    color: var(--dc-accent);
    flex-shrink: 0;
}

.dc-header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dc-text);
    line-height: 1.2;
}

.dc-header-desc {
    font-size: 13px;
    color: var(--dc-text-muted);
    margin-top: 2px;
}

.dc-header-right {
    flex-shrink: 0;
}

.dc-lang-select {
    padding: 5px 28px 5px 10px;
    border: 1px solid var(--dc-border);
    border-radius: 4px;
    background: var(--dc-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 8px center;
    appearance: none;
    -webkit-appearance: none;
    font-size: 13px;
    color: var(--dc-text-secondary);
    cursor: pointer;
    outline: none;
}

.dc-lang-select:hover {
    border-color: var(--dc-text-muted);
}

.dc-lang-select:focus {
    border-color: var(--dc-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.15);
}

.dc-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--dc-text-muted);
}

.dc-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--dc-border);
    border-radius: 2px;
    overflow: hidden;
}

.dc-progress-fill {
    height: 100%;
    background: var(--dc-accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dc-question-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--dc-text);
}

.dc-question-text {
    font-size: 14px;
    color: var(--dc-text-secondary);
    margin: 0 0 6px 0;
    line-height: 1.5;
}

.dc-info-text {
    font-size: 13px;
    color: var(--dc-text-muted);
    margin: 0 0 16px 0;
    padding: 8px 12px;
    background: var(--dc-info-bg);
    border-radius: 6px;
    line-height: 1.5;
    border-left: 3px solid var(--dc-info-border);
}

.dc-info-text::before {
    content: "? ";
    font-weight: 700;
    color: var(--dc-text-muted);
}

.dc-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.dc-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid var(--dc-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    background: var(--dc-surface);
}

.dc-option:hover {
    border-color: var(--dc-accent);
    background: var(--dc-accent-bg-hover);
}

.dc-option.selected {
    border-color: var(--dc-accent);
    background: var(--dc-accent-bg);
}

.dc-option-indicator {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--dc-border);
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.dc-option-indicator.radio {
    border-radius: 50%;
}

.dc-option-indicator.checkbox {
    border-radius: 3px;
}

.dc-option.selected .dc-option-indicator {
    border-color: var(--dc-accent);
    background: var(--dc-accent);
}

.dc-option.selected .dc-option-indicator::after {
    content: "";
    display: block;
}

.dc-option.selected .dc-option-indicator.radio::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dc-surface);
}

.dc-option.selected .dc-option-indicator.checkbox::after {
    width: 6px;
    height: 10px;
    border: solid var(--dc-surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.dc-option-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--dc-text);
}

.dc-option-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dc-option-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    object-position: center;
    margin-top: 8px;
    border-radius: 4px;
}

.dc-option-warning {
    font-size: 12px;
    color: var(--dc-warning);
    margin-top: 4px;
}

.dc-option-warning::before {
    content: "\26A0  ";
}

.dc-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--dc-border-light);
}

.dc-nav-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.dc-nav-btn.prev {
    background: var(--dc-btn-bg);
    color: var(--dc-btn-text);
}

.dc-nav-btn.prev:hover {
    background: var(--dc-btn-hover);
}

.dc-nav-btn.next {
    background: var(--dc-accent);
    color: #fff;
    margin-left: auto;
}

.dc-nav-btn.next:hover {
    background: var(--dc-accent-hover);
}

.dc-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dc-results {
    margin-top: 8px;
}

.dc-results-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--dc-text);
}

.dc-results-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--dc-text-muted);
}

.dc-results-empty h3 {
    color: var(--dc-text-secondary);
    margin-bottom: 8px;
}

.dc-result-card {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px var(--dc-shadow);
}

.dc-result-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dc-result-name {
    font-size: 18px;
    font-weight: 700;
}

.dc-result-position {
    font-size: 14px;
    opacity: 0.8;
}

.dc-result-body {
    padding: 14px 18px;
    background: var(--dc-surface);
}

.dc-result-desc {
    font-size: 13px;
    color: var(--dc-text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.dc-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--dc-text-muted);
    margin-bottom: 10px;
}

.dc-result-meta a {
    color: var(--dc-accent);
    text-decoration: none;
}

.dc-result-meta a:hover {
    text-decoration: underline;
}

.dc-result-assignments {
    border-top: 1px solid var(--dc-border-light);
    padding-top: 10px;
}

.dc-assignment {
    font-size: 12px;
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.dc-assignment-tag {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.dc-assignment-tag.positive {
    background: var(--dc-tag-pos-bg);
    color: var(--dc-tag-pos-text);
}.dc-assignment-tag.negative {
    background: var(--dc-tag-neg-bg);
    color: var(--dc-tag-neg-text);
}

.dc-assignment-tag.neutral {
    background: var(--dc-tag-neu-bg);
    color: var(--dc-tag-neu-text);
}

.dc-assignment-tag.blocking {
    background: var(--dc-tag-block-bg);
    color: var(--dc-tag-block-text);
}

.dc-score-explanation {
    margin-top: 20px;
    padding: 14px 18px;
    background: var(--dc-info-bg);
    border-radius: 8px;
    font-size: 13px;
    color: var(--dc-text-secondary);
    line-height: 1.5;
}

.dc-score-explanation h4 {
    font-size: 14px;
    color: var(--dc-text);
    margin: 0 0 8px 0;
}

.dc-results-rest {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--dc-border-light);
}

.dc-results-rest h4 {
    font-size: 14px;
    color: var(--dc-text-muted);
    margin: 0 0 10px 0;
    font-weight: 500;
}

.dc-results-rest-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dc-rest-item {
    border-radius: 6px;
    overflow: hidden;
}

.dc-rest-item.expandable {
    cursor: pointer;
}

.dc-rest-item.expandable:hover {
    background: var(--dc-accent-bg-hover);
}

.dc-rest-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
}

.dc-rest-rank {
    font-size: 12px;
    font-weight: 600;
    color: var(--dc-text-muted);
    min-width: 32px;
}

.dc-rest-name {
    font-size: 13px;
    flex: 1;
}

.dc-rest-name a {
    color: var(--dc-accent);
    text-decoration: none;
}

.dc-rest-name a:hover {
    text-decoration: underline;
}

.dc-rest-score {
    font-size: 12px;
    color: var(--dc-text-muted);
    font-variant-numeric: tabular-nums;
    margin-right: 8px;
}

.dc-rest-toggle {
    font-size: 10px;
    color: var(--dc-text-muted);
    transition: transform 0.2s;
}

.dc-rest-item.expanded .dc-rest-toggle {
    transform: rotate(90deg);
}

.dc-rest-item-detail {
    display: none;
    padding: 4px 8px 8px 8px;
    border-top: 1px solid var(--dc-border-light);
}

.dc-rest-item.expanded .dc-rest-item-detail {
    display: block;
}

.dc-assignment-empty {
    font-size: 12px;
    color: var(--dc-text-muted);
    font-style: italic;
    padding: 4px 0;
}

.dc-distrowatch-link {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--dc-border-light);
    text-align: center;
}

.dc-distrowatch-link a {
    color: var(--dc-accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.dc-distrowatch-link a:hover {
    text-decoration: underline;
}

.dc-restart-btn {
    display: block;
    margin: 36px auto 0;
    padding: 10px 28px;
    background: var(--dc-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.dc-restart-btn:hover {
    background: var(--dc-accent-hover);
}

.dc-export-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.dc-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    background: var(--dc-surface);
    color: var(--dc-text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.dc-export-btn:hover {
    border-color: var(--dc-accent);
    color: var(--dc-accent);
    background: var(--dc-accent-bg-hover);
}

.dc-export-btn svg {
    flex-shrink: 0;
}

.dc-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--dc-text-muted);
    font-size: 16px;
}

@media (max-width: 700px) {
    #distrochooser-app {
        padding: 16px 10px;
    }

    .dc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dc-header-right {
        align-self: flex-end;
        margin-top: -32px;
    }

    .dc-sidebar-toggle {
        display: block;
    }

    .dc-body {
        flex-direction: column;
    }

    .dc-sidebar {
        display: none;
        width: 100%;
    }

    .dc-sidebar.open {
        display: block;
    }

    .dc-sidebar-nav {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .dc-sidebar-item {
        padding: 5px 8px;
        font-size: 12px;
    }

    .dc-sidebar-item-result {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }

    .dc-question-title {
        font-size: 17px;
    }

    .dc-option {
        padding: 10px 12px;
    }

    .dc-result-header {
        padding: 12px 14px;
    }

    .dc-result-body {
        padding: 12px 14px;
    }

    .dc-nav-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}
