:root {
    --primary: #2196F3;
    --secondary: #f5f6fa;
    --text: #2d3436;
}

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

body {
    font-family: 'Segoe UI', system-ui;
    line-height: 1.6;
    padding: 2rem;
    background: var(--secondary);
    color: var(--text);
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.calculator {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.calculator:hover {
    transform: translateY(-3px);
}

h2 {
    margin-bottom: 1.2rem;
    color: var(--primary);
    font-size: 1.4rem;
}

.input-group {
    margin-bottom: 1.2rem;
}

input {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33,150,243,0.1);
}

.result {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
    margin: 1.2rem 0;
    min-height: 2.5rem;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.tab-btn {
    background: #f0f4fa;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-btn:hover {
    background: #e3eaf3;
}

.tab-btn.active:hover {
    background: #1976D2;
}

.tab-content {
    display: none;
    padding: 1.2rem;
    background: #f8fafd;
    border-radius: 8px;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

code {
    background: #2d2d2d;
    color: #fff;
    padding: 0.3em 0.6em;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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