.home-page {
    height: 100svh;
    overflow: hidden;
    padding: clamp(16px, 3svh, 32px) clamp(12px, 3vw, 24px);
    background: #f7f8fa;
}

.home-container {
    width: min(860px, 100%);
    margin: 0 auto;
}

.calendar-card {
    position: relative;
    height: clamp(400px, calc(100svh - 32px), 520px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8eaee;
    border-radius: 10px;
    padding: clamp(16px, 2vw, 24px);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.calendar-header {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
    margin-bottom: clamp(8px, 1.5svh, 14px);
}

.calendar-title {
    min-width: 0;
}

.calendar-title h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 3px;
    color: #1f2937;
    font-size: clamp(16px, 1.4vw, 20px);
    line-height: 1.15;
}

.calendar-title p {
    margin: 0;
    color: #64748b;
    font-size: clamp(11px, 0.9vw, 13px);
    line-height: 1.25;
}

.calendar-legend {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vw, 12px);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid #dfe3e8;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: clamp(10px, 0.85vw, 12px);
    font-weight: 600;
    white-space: nowrap;
}

.legend-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    display: inline-flex;
}

.legend-dot svg,
.dot svg {
    width: 100%;
    height: 100%;
    display: block;
}


.calendar-nav {
    display: flex;
    gap: 6px;
}

.nav-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    background: #fff;
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.nav-btn:hover {
    background: #f8fafc;
    color: #1f2937;
}

.month-title {
    margin: 0 0 clamp(8px, 1.2svh, 12px);
    color: #1f2937;
    text-align: center;
    font-size: clamp(16px, 1.6vw, 18px);
    line-height: 1.2;
}

.weekday-row,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
    margin-bottom: 4px;
    color: #64748b;
    text-align: center;
}

.weekday-row span {
    font-size: clamp(10px, 0.85vw, 12px);
    line-height: 28px;
}

.calendar-grid {
    min-height: 0;
    flex: 1;
    grid-auto-rows: minmax(0, 1fr);
    gap: 0;
}

.day-cell {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: grid;
    align-items: start;
    justify-items: start;
    padding: 5px;
    border: 1px solid #e7eaf0;
    border-left: 0;
    border-top: 0;
    border-radius: 0;
    background: #fff;
    color: #334155;
    font-size: clamp(11px, 0.9vw, 13px);
}

.weekday-row span,
.day-cell:nth-child(7n + 1) {
    border-left: 1px solid #e7eaf0;
}

.day-cell:nth-child(-n + 7) {
    border-top: 1px solid #e7eaf0;
}

.day-cell.empty {
    background: #fbfcfd;
}

.day-cell.today {
    border: 1px solid #3b82f6;
    color: #1d4ed8;
}

.day-number {
    position: relative;
    z-index: 3;
    font-weight: 600;
}

.dot {
    align-self: end;
    justify-self: center;
    width: 10px;
    height: 10px;
    margin: 0 0 3px;
    border-radius: 50%;
}

.status-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.20;
    pointer-events: none;
}

.status-shade svg {
    width: 100%;
    height: 100%;
    display: block;
}

.status-dots {
    position: absolute;
    left: 0;
    bottom: 5px;
    z-index: 3;
    width: 100%;
    height: 10px;
    display: block;
    pointer-events: none;
}

.status-dot {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 10px;
    display: block;
}

.status-dot svg {
    width: 100%;
    height: 100%;
    display: block;
}

.status-dots.count-1 .status-dot {
    left: calc(50% - 5px);
}

.status-dots.count-2 .status-dot:nth-child(1) {
    left: calc(25% - 5px);
}

.status-dots.count-2 .status-dot:nth-child(2) {
    left: calc(75% - 5px);
}

.status-dots.count-3 .status-dot:nth-child(1) {
    left: calc(16.666% - 5px);
}

.status-dots.count-3 .status-dot:nth-child(2) {
    left: calc(50% - 5px);
}

.status-dots.count-3 .status-dot:nth-child(3) {
    left: calc(83.333% - 5px);
}

.status-dots.count-4 .status-dot:nth-child(1) {
    left: calc(12.5% - 5px);
}

.status-dots.count-4 .status-dot:nth-child(2) {
    left: calc(37.5% - 5px);
}

.status-dots.count-4 .status-dot:nth-child(3) {
    left: calc(62.5% - 5px);
}

.status-dots.count-4 .status-dot:nth-child(4) {
    left: calc(87.5% - 5px);
}

.calendar-popover {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    width: min(260px, calc(100% - 24px));
    padding: 12px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.calendar-popover[hidden] {
    display: none;
}

.calendar-popover.popover-left {
    left: 12px;
    right: auto;
}

.calendar-popover.popover-right {
    left: auto;
    right: 12px;
}

.calendar-popover.popover-top {
    top: 58px;
    bottom: auto;
}

.calendar-popover.popover-bottom {
    top: auto;
    bottom: 12px;
}

.calendar-popover strong {
    display: block;
    margin-bottom: 8px;
    color: #1f2937;
}

.calendar-popover ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.calendar-popover li {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    color: #475569;
    font-size: 12px;
}

.calendar-popover .tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid #dfe3e8;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-weight: 700;
    white-space: nowrap;
}

.empty .dot {
    display: none;
}

@media (max-width: 760px) {
    .home-page {
        overflow: auto;
        height: auto;
        min-height: 100svh;
        padding: 12px;
    }

    .calendar-card {
        height: calc(100svh - 24px);
        min-height: 440px;
        padding: 12px;
    }

    .calendar-header {
        grid-template-columns: 1fr auto;
    }

    .calendar-legend {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }

    .weekday-row span {
        line-height: 24px;
    }

    .day-cell {
        padding: 3px;
    }

    .dot {
        width: 8px;
        height: 8px;
    }
}
