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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    padding: 20px;
    color: #2c2c2c;
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e5e5;
}

h1 {
    font-size: 1.375rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.subtitle {
    color: #737373;
    font-size: 0.875rem;
}

.card {
    background: white;
    border: 1px solid #e5e5e5;
    padding: 24px;
    margin-bottom: 16px;
}

.section-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #525252;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mode-indicator {
    font-size: 0.75rem;
    color: #2563eb;
    font-weight: 600;
    background: #eff6ff;
    padding: 4px 10px;
    border: 1px solid #bfdbfe;
}

/* DPI Sektion - Kompakt */
.dpi-row {
    display: grid;
    grid-template-columns: 60px 120px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    margin-bottom: 20px;
}

.dpi-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #525252;
}

.dpi-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

#dpiInput {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #d4d4d4;
    font-size: 0.875rem;
    text-align: center;
}

.dpi-unit {
    font-size: 0.75rem;
    color: #737373;
    font-weight: 500;
}

.dpi-presets {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.dpi-preset {
    padding: 6px 14px;
    background: white;
    border: 1px solid #d4d4d4;
    cursor: pointer;
    font-size: 0.813rem;
    font-weight: 500;
    color: #525252;
    transition: all 0.12s;
}

.dpi-preset:hover {
    background: #f5f5f5;
    border-color: #a3a3a3;
}

.dpi-preset.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

/* Converter Grid - Optimiert */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.converter-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.column-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.input-group {
    display: grid;
    grid-template-columns: 60px 1fr 35px;
    gap: 10px;
    align-items: center;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #525252;
}

input[type="number"] {
    padding: 7px 10px;
    border: 1px solid #d4d4d4;
    font-size: 0.875rem;
    transition: border-color 0.12s;
    background: white;
}

input[type="number"]:focus {
    outline: none;
    border-color: #2563eb;
}

input[type="number"]:disabled {
    background: #f0f7ff;
    color: #2563eb;
    font-weight: 600;
    cursor: default;
}

.unit-label {
    font-size: 0.75rem;
    color: #737373;
    font-weight: 500;
    text-align: center;
}

.swap-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn {
    background: #2563eb;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    background: #1d4ed8;
    transform: rotate(180deg);
}

.swap-btn:active {
    transform: rotate(180deg) scale(0.9);
}

/* Formel Sektion */
.formula-box {
    background: #fafafa;
    border-left: 2px solid #2563eb;
    padding: 12px 14px;
}

.formula-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #525252;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.formula-code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #1a1a1a;
    margin-bottom: 6px;
    font-weight: 500;
}

.formula-description {
    font-size: 0.813rem;
    color: #737373;
    line-height: 1.4;
}

/* Info Grid - Unten */
.info-section {
    margin-top: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.info-card {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    padding: 12px;
}

.info-card h3 {
    font-size: 0.813rem;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 4px;
}

.info-card p {
    font-size: 0.813rem;
    color: #737373;
    line-height: 1.35;
}

@media (max-width: 768px) {
    .converter-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .swap-container {
        order: 2;
    }

    .swap-btn {
        margin: 8px auto;
        transform: rotate(90deg);
    }

    .swap-btn:hover {
        transform: rotate(270deg);
    }

    .dpi-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dpi-presets {
        justify-content: flex-start;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

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

    .dpi-presets {
        flex-wrap: wrap;
    }
}