:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;

    background: #f3f7fb;
    color: #142033;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 24px;
}

main {
    width: min(100%, 860px);
}

.card {
    background: #fff;
    border: 1px solid #dce4ee;
    border-radius: 18px;

    box-shadow: 0 16px 40px rgb(20 32 51 / 8%);

    padding: 28px;
}

.auth-card {
    width: min(100%, 420px);
    margin-inline: auto;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: 1.7rem;
    margin-bottom: 8px;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 18px;
}

.muted {
    color: #637083;
}

form,
.stack {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;

    font-size: .92rem;
    font-weight: 600;
}

input {
    width: 100%;

    border: 1px solid #b8c5d4;
    border-radius: 9px;

    padding: 11px 12px;

    font: inherit;
}

input:focus {
    outline: 3px solid #b9d9ff;
    border-color: #1877d1;
}

button {
    border: 0;
    border-radius: 9px;

    background: #1473c9;
    color: #fff;

    cursor: pointer;

    font: inherit;
    font-weight: 700;

    padding: 11px 14px;
}

button:hover {
    background: #0d5fa8;
}

button:disabled {
    cursor: wait;
    opacity: .65;
}

button.secondary {
    background: #e8eef5;
    color: #1f3148;
}

button.secondary:hover {
    background: #dce5f0;
}

.actions {
    display: flex;
    flex-wrap: wrap;

    align-items: center;
    gap: 10px;
}

.actions .push {
    margin-left: auto;
}

.message {
    min-height: 1.4em;

    margin: 0;

    color: #b42318;
}

.message.success {
    color: #067647;
}

.table-wrap {
    overflow-x: auto;

    border: 1px solid #dce4ee;
    border-radius: 10px;
}

table {
    width: 100%;

    border-collapse: collapse;

    text-align: left;
}

th,
td {
    border-bottom: 1px solid #e8edf3;

    padding: 12px 14px;

    white-space: nowrap;
}

th {
    background: #f7f9fc;
    font-size: .85rem;
}

tr:last-child td {
    border-bottom: 0;
}

.hidden {
    display: none !important;
}

.current-readings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;

    margin-bottom: 18px;
}

.current-reading {
    display: grid;
    gap: 4px;

    background: #f7f9fc;
    border: 1px solid #e8edf3;
    border-radius: 12px;

    padding: 14px 16px;
}

.current-reading-label {
    color: #637083;
    font-size: .82rem;
    font-weight: 600;
}

.current-reading-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.current-reading-time {
    font-size: 1rem;
    font-weight: 600;
    color: #1f3148;
}

.view-controls {
    display: flex;
    flex-wrap: wrap;

    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 14px;
}

.view-toggle,
.period-selector {
    display: flex;
    gap: 6px;
}

.view-toggle-button,
.period-button {
    background: #e8eef5;
    color: #1f3148;

    padding: 8px 14px;
    font-size: .9rem;
}

.view-toggle-button:hover,
.period-button:hover {
    background: #dce5f0;
}

.view-toggle-button.active,
.period-button.active {
    background: #1473c9;
    color: #fff;
}

.chart-wrap {
    border: 1px solid #dce4ee;
    border-radius: 10px;

    padding: 16px;
}

#measurements-chart {
    width: 100%;
    height: auto;

    display: block;
}

@media (max-width: 560px) {
    .card {
        padding: 20px;
    }

    .actions .push {
        margin-left: 0;
    }
}