[data-testid="page-calendar"] {
    height: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.spektr-cal {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    min-height: 0;
    padding: 20px 24px 24px;
    box-sizing: border-box;
}

.spektr-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.spektr-cal-head h1 {
    margin: 0;
    font-family: var(--font-display), Inter, sans-serif;
    font-size: 22px;
    font-weight: 750;
}

.spektr-cal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spektr-cal-nav button {
    height: 36px;
    min-width: 36px;
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 12px;
}

.spektr-cal-nav button:hover {
    background: hsl(var(--accent));
}

.spektr-cal-month {
    min-width: 180px;
    text-align: center;
    font-weight: 700;
    text-transform: capitalize;
}

.spektr-cal-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 16px;
    min-height: 0;
    flex: 1;
}

.spektr-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    align-content: start;
}

.spektr-cal-dow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
    text-align: center;
    padding: 4px 0 8px;
}

.spektr-cal-day {
    min-height: 108px;
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    background: hsl(var(--card));
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    text-align: left;
}

.spektr-cal-day:hover {
    border-color: hsl(var(--ring) / 0.5);
}

.spektr-cal-day.is-empty {
    visibility: hidden;
    pointer-events: none;
}

.spektr-cal-day.is-today {
    box-shadow: inset 0 0 0 1px hsl(var(--primary) / 0.45);
}

.spektr-cal-day.is-selected {
    border-color: hsl(var(--primary));
    background: hsl(var(--accent));
}

.spektr-cal-num {
    font-size: 12px;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
}

.spektr-cal-day.is-today .spektr-cal-num {
    color: hsl(var(--primary));
}

.spektr-cal-pills {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
}

.spektr-cal-pill {
    border: 0;
    border-radius: 7px;
    padding: 3px 6px;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    color: hsl(var(--foreground));
    background: hsl(var(--muted));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spektr-cal-pill.is-sub {
    font-weight: 500;
    background: hsl(var(--chart-4) / 0.18);
    color: hsl(var(--foreground));
}

.spektr-cal-pill.is-done {
    color: hsl(var(--muted-foreground));
    text-decoration: line-through;
}

.spektr-cal-pill.is-overdue {
    background: hsl(var(--destructive) / 0.14);
    color: hsl(var(--destructive));
}

.spektr-cal-more {
    font-size: 11px;
    color: hsl(var(--muted-foreground));
    padding: 0 2px;
}

.spektr-cal-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: auto;
}

.spektr-cal-card {
    border: 1px solid hsl(var(--border));
    border-radius: 14px;
    background: hsl(var(--card));
    padding: 14px;
}

.spektr-cal-card h2 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
}

.spektr-cal-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spektr-cal-list button {
    width: 100%;
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    background: hsl(var(--background));
    color: inherit;
    font: inherit;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
}

.spektr-cal-list button:hover {
    background: hsl(var(--accent));
}

.spektr-cal-list b {
    display: block;
    font-size: 13px;
}

.spektr-cal-list span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: hsl(var(--muted-foreground));
}

.spektr-cal-empty {
    margin: 0;
    font-size: 13px;
    color: hsl(var(--muted-foreground));
}

@media (max-width: 980px) {
    .spektr-cal-body {
        grid-template-columns: 1fr;
    }

    .spektr-cal-day {
        min-height: 84px;
    }
}
