:root {
    --primary: #6C63FF;
    --primary-dim: rgba(108, 99, 255, 0.12);
    --success: #00C853;
    --success-dim: rgba(0, 200, 83, 0.12);
    --danger: #FF5252;
    --danger-dim: rgba(255, 82, 82, 0.12);
    --warning: #FFD740;
    --bg: #0D1117;
    --bg-card: rgba(22, 27, 34, 0.8);
    --bg-elevated: #161B22;
    --bg-input: rgba(13, 17, 23, 0.9);
    --text: #E6EDF3;
    --text-sec: #8B949E;
    --text-muted: #484F58;
    --border: rgba(139, 148, 158, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 1.25rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-dim);
    border-radius: var(--radius-sm);
}

.app-title {
    font-size: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #A78BFA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-subtitle {
    font-size: 0.625rem;
    color: var(--text-sec);
}

.header-actions {
    display: flex;
    gap: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #5B52E5);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-sec);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-elevated);
}

.main-content {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Color Panel */
.color-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.color-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.color-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-sec);
    letter-spacing: 0.04em;
}

.color-picker {
    width: 80px;
    height: 80px;
    border: 3px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 9px;
}

.color-input {
    width: 100px;
    text-align: center;
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    outline: none;
}

.color-input:focus {
    border-color: var(--primary);
}

/* Ratio */
.ratio-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ratio-value {
    font-size: 2.5rem;
    font-weight: 800;
    transition: color 300ms;
}

.ratio-label {
    font-size: 0.75rem;
    color: var(--text-sec);
    font-weight: 600;
}

/* WCAG Cards */
.wcag-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.wcag-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
    transition: all 250ms ease;
}

.wcag-card.pass {
    border-color: rgba(0, 200, 83, 0.25);
    background: rgba(0, 200, 83, 0.04);
}

.wcag-card.fail {
    border-color: rgba(255, 82, 82, 0.25);
    background: rgba(255, 82, 82, 0.04);
}

.wcag-level {
    font-size: 0.6875rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.wcag-min {
    font-size: 0.5625rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.wcag-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.625rem;
    font-weight: 800;
}

.wcag-badge.pass {
    background: var(--success-dim);
    color: var(--success);
}

.wcag-badge.fail {
    background: var(--danger-dim);
    color: var(--danger);
}

/* Preview */
.preview-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.preview-box {
    padding: 24px;
    border-radius: var(--radius-sm);
    transition: all 200ms ease;
}

.preview-normal {
    font-size: 16px;
    margin-bottom: 10px;
}

.preview-large {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.preview-small {
    font-size: 12px;
}

/* Suggestions */
.suggestions-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.suggestion-card {
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: all 200ms;
}

.suggestion-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.suggestion-color {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.suggestion-ratio {
    font-size: 0.5625rem;
    color: var(--text-sec);
}

.app-footer {
    text-align: center;
    padding: 12px;
    font-size: 0.625rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .color-panel {
        flex-direction: column;
    }

    .wcag-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 148, 158, 0.15);
    border-radius: 3px;
}