body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(to right, #4facfe, #00f2fe);
    color: #212121;
    margin: 0;
    padding: 15px;
    min-height: 100vh;
    overflow-x: hidden;
}

h1 {
    color: #004d40;
    font-size: 24px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

h2, h3 {
    color: #00695c;
    font-size: 18px;
    margin-bottom: 8px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}

.input-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.input-row label {
    flex: 0 0 140px;
    font-size: 14px;
    color: #004d40;
}

.input-row input {
    width: 80px;
    padding: 6px;
    border: 1px solid #b0bec5;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-row input:focus {
    border-color: #00c4cc;
    outline: none;
}

.info {
    position: relative;
    width: 18px;
    height: 18px;
    border: 2px solid #00695c;
    border-radius: 50%;
    font-size: 12px;
    line-height: 14px;
    text-align: center;
    color: #00695c;
    cursor: pointer;
    transition: all 0.3s;
}

.info:hover {
    background: #00695c;
    color: white;
    transform: scale(1.1);
}

.info::after {
    content: 'i';
}

#calculate {
    background: #00c4cc;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s, transform 0.3s;
}

#calculate:hover {
    background: #0097a7;
    transform: translateY(-2px);
}

#results {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tiles {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.tile {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.tile h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: #004d40;
}

.tile p {
    margin: 4px 0;
    font-size: 14px;
    color: #455a64;
}

#charts {
    margin: 15px 0;
}

#charts canvas {
    width: 100% !important;
    max-height: 250px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

#toggle-dataset {
    background: #f06292;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

#toggle-dataset:hover {
    background: #ec407a;
}

#dataset-content {
    display: none;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

select {
    padding: 6px;
    border: 1px solid #b0bec5;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s;
    margin-right: 8px;
    margin-bottom: 8px;
}

select:focus {
    border-color: #00c4cc;
    outline: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}

th, td {
    border: 1px solid #b0bec5;
    padding: 6px;
    text-align: left;
}

th {
    background: #e0f7fa;
    color: #004d40;
}

@media (max-width: 768px) {
    h1 { font-size: 22px; }
    h2, h3 { font-size: 16px; }
    .input-row label { flex: 0 0 120px; }
    .input-row input { width: 70px; }
    .tiles { flex-direction: column; align-items: center; }
    .tile { min-width: 180px; }
    #charts canvas { max-height: 220px; }
    #toggle-dataset { width: 100%; }
}

@media (max-width: 480px) {
    body { padding: 10px; }
    h1 { font-size: 20px; }
    h2, h3 { font-size: 14px; }
    .input-row { flex-direction: column; align-items: stretch; gap: 4px; }
    .input-row label { flex: none; margin-bottom: 2px; }
    .input-row input { width: 100%; min-height: 40px; }
    .info { width: 16px; height: 16px; font-size: 10px; line-height: 12px; }
    #calculate { width: 100%; min-height: 40px; }
    .tiles { gap: 10px; }
    .tile { min-width: 100%; padding: 10px; }
    #charts canvas { max-height: 180px; }
    #dataset-content { padding: 10px; }
}