* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
    color: #263238;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 2rem 1rem 1rem;
}

header h1 {
    margin: 0;
    font-size: 2.25rem;
}

.subtitle {
    margin: 0.25rem 0 0;
    color: #5d4037;
}

main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

.controls {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.controls label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

input[type="password"],
select {
    flex: 1;
    min-width: 220px;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    background: #fff;
}

.last-updated {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: #455a64;
    font-style: italic;
    min-height: 1.2em;
}

.status.warn { color: #ef6c00; }

button {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover:not(:disabled) { background: #f57c00; }
button:disabled { background: #bdbdbd; cursor: not-allowed; }

.hint {
    font-size: 0.85rem;
    color: #607d8b;
    margin: 0.75rem 0 0;
}

.status {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    min-height: 1.2em;
}

.status.error { color: #c62828; }
.status.success { color: #2e7d32; }

.results {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.results.hidden { display: none; }

.results h2 {
    margin-top: 0;
}

.chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 220px;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
}

.bar {
    flex: 1 0 50px;
    background: linear-gradient(to top, #ff9800, #ffc107);
    border-radius: 6px 6px 0 0;
    position: relative;
    min-height: 4px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.bar .value {
    position: absolute;
    top: -1.4em;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5d4037;
}

.bar .label {
    font-size: 0.7rem;
    color: #fff;
    padding: 4px 2px;
    text-align: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    text-align: left;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #eee;
}

th { background: #fff3e0; }
td:last-child, th:last-child { text-align: right; }

footer {
    text-align: center;
    padding: 1rem;
    color: #78909c;
}
