body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page {
    display: none;
    text-align: center;
    width: 100%;
    padding: 20px;
}

.page.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

button {
    font-size: 1.2rem;
    padding: 12px 24px;
    cursor: pointer;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background 0.3s;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid #fff;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

.invisible {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s;
}

#bargraph {
    margin-bottom: 2rem;
    margin-top: 0;
    width: 60px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    opacity: 1;
    transition: opacity 0.3s;
}

.meter {
    width: 40px;
    height: 250px;
    background: #e0e0e0;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
    margin: 0;
}

.fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #dc3545 0%, #ffc107 50%, #28a745 100%);
    transform-origin: bottom;
    transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scaleY(1);
}

.labels {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.labels span:first-child {
    align-self: flex-start;
}

.labels span:last-child {
    align-self: flex-end;
}

/* Page transition animation */
.page {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}

.page.active {
    opacity: 1;
    transform: translateY(0);
}