:root {
    --font-sans: 'Inter', -apple-system, sans-serif;
    --bg: #1A0F0A;
    --surface: #231710;
    --surface-2: #2C1E15;
    --border: rgba(225, 112, 85, .1);
    --border-hover: rgba(225, 112, 85, .3);
    --primary: #E17055;
    --primary-glow: rgba(225, 112, 85, .15);
    --secondary: #FAB1A0;
    --accent: #FFEAA7;
    --text: #E2E8F0;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --green: #4ADE80;
    --red: #F87171;
    --radius: 12px;
    --radius-sm: 8px
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    background-image: radial-gradient(ellipse at 30% 0%, rgba(225, 112, 85, .04) 0%, transparent 50%)
}

.header {
    padding: .85rem 2rem;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    background: rgba(26, 15, 10, .85);
    position: sticky;
    top: 0;
    z-index: 50
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.logo {
    display: flex;
    align-items: center;
    gap: .6rem
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(225, 112, 85, .1);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 1.1rem
}

.logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.tagline {
    font-size: .7rem;
    color: var(--text-dim)
}

.main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.25rem 2rem 3rem
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: fadeIn .4s ease backwards
}

.section-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .65rem
}

.hint {
    font-size: .75rem;
    color: var(--text-dim);
    margin-bottom: .5rem
}

.upload-row {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin-bottom: .5rem
}

.upload-btn {
    cursor: pointer
}

.file-count {
    font-size: .75rem;
    color: var(--text-dim)
}

.file-list-input {
    width: 100%;
    resize: vertical;
    padding: .5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: monospace;
    font-size: .72rem;
    line-height: 1.5;
    outline: none
}

.file-list-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow)
}

.chart-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap
}

#pie-chart {
    flex-shrink: 0
}

.legend {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1
}

.legend-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0
}

.legend-pct {
    font-weight: 700;
    width: 36px;
    text-align: right;
    font-size: .7rem
}

.lang-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: .75rem;
    background: var(--surface-2)
}

.lang-segment {
    height: 100%;
    transition: width .5s ease
}

.stats-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap
}

.stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: .4rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm)
}

.stat-val {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary)
}

.stat-label {
    font-size: .6rem;
    color: var(--text-dim);
    text-transform: uppercase
}

.file-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 300px;
    overflow-y: auto
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .75rem
}

.file-table th {
    padding: .35rem .5rem;
    text-align: left;
    background: var(--surface-2);
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    position: sticky;
    top: 0
}

.file-table td {
    padding: .3rem .5rem;
    border-top: 1px solid rgba(255, 255, 255, .03);
    word-break: break-word
}

.file-table td:nth-child(2) {
    font-weight: 600
}

.status-tag {
    font-size: .6rem;
    padding: .1rem .3rem;
    border-radius: 3px
}

.status-code {
    background: rgba(74, 222, 128, .1);
    color: var(--green)
}

.status-vendored {
    background: rgba(248, 113, 113, .1);
    color: var(--red)
}

.status-generated {
    background: rgba(255, 234, 167, .1);
    color: var(--accent)
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary), #D63031);
    color: #fff;
    padding: .5rem .9rem;
    box-shadow: 0 4px 16px var(--primary-glow)
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--primary-glow)
}

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    padding: .35rem .55rem
}

.btn--ghost:hover {
    background: rgba(225, 112, 85, .06);
    color: var(--text)
}

.btn--sm {
    font-size: .75rem;
    padding: .3rem .5rem
}

.hidden {
    display: none !important
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .4);
    opacity: 0;
    pointer-events: none;
    transition: all .4s cubic-bezier(.16, 1, .3, 1);
    z-index: 100
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
}

@media(max-width:600px) {
    .header {
        padding: .75rem 1rem
    }

    .main {
        padding: 1rem
    }

    .chart-row {
        flex-direction: column
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}