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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 20px 60px; }

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 48px 20px 40px;
    text-align: center;
    margin-bottom: 0;
}
.header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.subtitle { font-size: 1.05rem; opacity: 0.9; font-weight: 300; }

.ad-space { margin: 24px auto; min-height: 90px; }

.tabs {
    display: flex;
    gap: 0;
    margin: 32px 0 0;
    border-bottom: 2px solid #e8ecf0;
}
.tab-btn {
    padding: 12px 28px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #7f8c8d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.tab-btn.active { color: #667eea; border-bottom-color: #667eea; }
.tab-btn:hover { color: #667eea; }

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

.card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid #eee;
    margin: 24px 0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 0.88rem; font-weight: 600; color: #555; }
.input-group input, .input-group select {
    padding: 11px 14px;
    border: 1.5px solid #dde2e8;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #2c3e50;
    transition: border-color 0.2s;
    background: white;
}
.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.input-prefix {
    position: relative;
}
.input-prefix span {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 0.95rem;
    pointer-events: none;
}
.input-prefix input { padding-left: 26px; }

.calc-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 24px;
    transition: opacity 0.2s;
}
.calc-btn:hover { opacity: 0.9; }

.results { display: none; }
.results.show { display: block; }

.result-highlight {
    background: linear-gradient(135deg, #667eea10, #764ba210);
    border: 2px solid #667eea30;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}
.result-highlight .big-number {
    font-size: 2.4rem;
    font-weight: 700;
    color: #667eea;
}
.result-highlight .big-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 4px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.result-box {
    background: #f8f9fc;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    border: 1px solid #eee;
}
.result-box .val { font-size: 1.3rem; font-weight: 700; color: #2c3e50; }
.result-box .lbl { font-size: 0.8rem; color: #7f8c8d; margin-top: 4px; }

.chart-wrap { position: relative; height: 260px; margin: 24px 0; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 16px;
}
th {
    background: #f0f2f7;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
}
td { padding: 8px 12px; border-bottom: 1px solid #f0f2f7; color: #444; }
tr:hover td { background: #fafbff; }

.table-wrap { max-height: 320px; overflow-y: auto; border-radius: 8px; border: 1px solid #eee; }

.reset-btn {
    background: none;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s;
}
.reset-btn:hover { background: #667eea; color: white; }

.info-section {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin: 24px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #eee;
}
.info-section h2 { font-size: 1.2rem; margin-bottom: 12px; color: #2c3e50; }
.info-section p { color: #555; font-size: 0.93rem; line-height: 1.75; margin-bottom: 10px; }

.footer {
    text-align: center;
    padding: 32px 20px;
    background: #2c3e50;
    color: #bdc3c7;
    font-size: 0.88rem;
    margin-top: 40px;
}
.footer a { color: #bdc3c7; text-decoration: none; }
.footer a:hover { color: white; }

@media (max-width: 600px) {
    .header h1 { font-size: 1.5rem; }
    .form-grid { grid-template-columns: 1fr; }
    .result-grid { grid-template-columns: 1fr 1fr; }
    .card { padding: 20px 16px; }
    .tab-btn { padding: 10px 16px; font-size: 0.9rem; }
}
