.dashboard-trend-reference.attendance-trend {
    min-width: 0;
    height: auto;
    padding: clamp(14px, 3vw, 26px);
}

.attendance-trend-header, .attendance-trend-reading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.attendance-trend-header h2 { margin: 0; font-size: clamp(1rem, 2.5vw, 1.35rem); }
.attendance-trend-header > span {
    background: #eeebfa;
    border-radius: 999px;
    color: #514482;
    padding: 5px 10px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.attendance-trend-reading { margin-block: 12px 15px; }
.attendance-trend-reading strong { font-size: 1.15rem; }
.attendance-trend-reading time { color: #625b87; font-size: .8rem; }

.attendance-trend-chart {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-rows: clamp(105px, 18vw, 205px) auto;
    column-gap: clamp(5px, 1vw, 12px);
    row-gap: 7px;
}

.attendance-trend-axis, .attendance-trend-grid {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.attendance-trend-axis {
    margin-block: -.5em;
    color: #625b87;
    font-size: .7rem;
    line-height: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.attendance-trend-plot { position: relative; min-width: 0; }
.attendance-trend-grid { position: absolute; inset: 0; pointer-events: none; }
.attendance-trend-grid i { height: 1px; background: #e9e6f3; }
.attendance-trend-grid i:last-child { background: #d8d2eb; }
.attendance-trend-days {
    position: absolute;
    inset: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
}

.attendance-trend-day {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
}

.attendance-trend-day[data-highlighted] { background: #ece8ff70; }
.attendance-trend-day:focus-visible { outline: 2px solid #6353d2; outline-offset: 1px; z-index: 1; }
.attendance-trend-bar {
    display: block;
    width: 66%;
    max-width: 24px;
    height: var(--attendance-bar-height);
    min-height: 1px;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, #b8aaff, #d6ccfa);
    transform-origin: bottom center;
    pointer-events: none;
}

.attendance-trend-zero {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8574c8;
    pointer-events: none;
}

.attendance-trend-day[data-highlighted] .attendance-trend-bar {
    background: linear-gradient(180deg, #6954e5, #8169eb);
}
.attendance-trend-day[data-highlighted] .attendance-trend-zero { background: #5941d2; }

.attendance-trend-dates {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    gap: 3px;
    color: #625b87;
    font-size: .7rem;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .attendance-trend-mid-date { display: none; }
    .attendance-trend-reading time { font-size: .72rem; }
}
