/* ── Calendar page ───────────────────────────────────────────── */

.cal-main {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 80px;
    display: flex;
    flex-direction: column;
}

/* Day-of-week header row */
.cal-dow-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 3px;
}
.cal-dow-header div {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-mute);
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Calendar grid */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    flex: 1;
}

.cal-loading {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--ink-mute);
    font-size: 14px;
}

/* Day cell */
.cal-cell {
    min-height: 88px;
    background: var(--surface);
    border-radius: 7px;
    padding: 6px 7px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 0.12s, border-color 0.12s;
    overflow: hidden;
}
.cal-cell:hover {
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}
.cal-cell.is-today {
    border-color: var(--accent);
}
.cal-cell.other-month {
    opacity: 0.38;
}
.cal-cell.is-weekend {
    background: color-mix(in srgb, var(--ink) 3%, var(--bg));
}
.cal-cell.is-today.is-weekend {
    background: var(--surface);
}

/* Day number */
.cal-cell-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 5px;
}
.cal-cell.is-today .cal-cell-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
}

/* Account name chips in cells */
.cal-stop-names {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}
.cal-stop-chip {
    font-size: 10px;
    line-height: 1.35;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--accent-bg);
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Outlook event chips */
.cal-event {
    font-size: 11px;
    color: var(--ink-mute);
    padding: 2px 5px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--ink) 6%, transparent);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.cal-event.cal-event-matched {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
}

/* "Today" button in topbar */
.cal-today-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Mobile: hide event text, show dots instead */
@media (max-width: 540px) {
    .cal-cell {
        min-height: 56px;
        padding: 5px 5px;
    }
    .cal-cell-num {
        font-size: 12px;
    }
    .cal-event {
        display: none;
    }
    .cal-dot-row {
        display: flex;
        gap: 3px;
        flex-wrap: wrap;
        margin-top: 3px;
    }
    .cal-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--ink-mute);
        flex-shrink: 0;
    }
    .cal-dot.is-matched {
        background: var(--accent);
    }
}
@media (min-width: 541px) {
    .cal-dot-row { display: none; }
}
