:root {
    color-scheme: light;
    /* Design tokens */
    --bg: #f6f7f4;
    --ink: #17201c;
    --muted: #63716a;
    --line: #d8ded7;
    --green: #3fa35b;
    --yellow: #f2c94c;
    --orange: #f2994a;
    --red: #d64545;
    --missing: #d5d9d2;
    --date-column: 86px;
    --date-gap: 14px;
    /* Bootstrap mappings */
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-body-font-family: Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bs-secondary-color: var(--muted);
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: 0.5rem;
}

.page {
    padding-top: 32px;
    padding-bottom: 32px;
}

.eyebrow,
.current-label,
#current-conditions,
#current-meta,
#updated-at,
.details span {
    color: var(--muted);
    font-size: 0.9rem;
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h1 {
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 1;
    letter-spacing: 0;
}

h2 {
    font-size: 1rem;
}

.current {
    width: fit-content;
    min-width: 210px;
    margin-top: 18px;
    padding: 16px;
}

.current span,
.current strong {
    display: block;
}

.current strong {
    margin: 4px 0;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 0.9;
}

.legend {
    gap: 10px 18px;
    color: var(--muted);
    font-size: 0.92rem;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.chart-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.heatmap-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    user-select: none;
}

.heatmap-table th,
.heatmap-table td {
    padding: 0;
    border: 0;
}

.heatmap-table thead th {
    padding-bottom: 5px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 400;
}

.date-column {
    width: var(--date-column);
}

.gap-column {
    width: var(--date-gap);
}

.time-axis {
    position: relative;
    height: 0.8rem;
}

.tick {
    position: absolute;
    left: calc((var(--hour) / 17) * 100%);
    transform: translateX(-50%);
    line-height: 1;
    white-space: nowrap;
}

.day-label {
    background: var(--bg);
    color: var(--muted);
    font-family:
        "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
}

.point-cell {
    height: 1lh;
}

.cell-button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    appearance: none;
    border: 0;
    cursor: pointer;
    outline: 0;
    background: transparent;
}

.point-cell:hover,
.point-cell:has(.cell-button:focus-visible),
.point-cell.active {
    position: relative;
    z-index: 1;
    box-shadow:
        inset 0 0 0 2px var(--ink),
        0 0 0 2px var(--bg);
}

.point-cell.now {
    position: relative;
    z-index: 1;
    box-shadow: inset 0 0 0 2px var(--ink);
}

.level-green {
    background: var(--green);
}

.level-yellow {
    background: var(--yellow);
}

.level-orange {
    background: var(--orange);
}

.level-red {
    background: var(--red);
}

.level-missing {
    background: var(--missing);
}

.details {
    display: grid;
    gap: 4px;
    align-items: start;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.details strong {
    font-size: 1.05rem;
}

.details-table {
    width: max-content;
    border-collapse: collapse;
    color: var(--muted);
    font-size: 0.9rem;
}

.details-table th,
.details-table td {
    padding: 1px 12px 1px 0;
    border: 0;
    font-weight: 400;
    text-align: left;
    vertical-align: top;
}

.details-table td {
    color: var(--ink);
    font-variant-numeric: lining-nums tabular-nums;
}

.footer {
    gap: 8px 16px;
    padding-top: 18px;
    padding-bottom: 28px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.footer a {
    color: inherit;
}

@media (max-width: 720px) {
    :root {
        --date-column: 60px;
        --date-gap: 10px;
    }

    .page {
        padding-top: 20px;
    }

    .chart-head {
        display: block;
    }

    .day-label {
        font-size: 0.62rem;
        letter-spacing: 0;
    }

    .heatmap-table thead th {
        font-size: 0.62rem;
    }
}

@media (max-width: 430px) {
    :root {
        --date-column: 52px;
        --date-gap: 8px;
    }

    .day-label {
        font-size: 0.54rem;
    }

    .heatmap-table thead th {
        font-size: 0.52rem;
    }
}
