/* ===== 캘린더 테이블 공통 ===== */
.calendar_box .cal_table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar_box .cal_table td,
.calendar_box .cal_table th {
    padding: 5px 10px;
    vertical-align: top;
    text-align: center;
    box-sizing: border-box;
}

.calendar_box .cal_table td {
    height: 30px;
}

.calendar_box .cal_table .day {
    color: #fff;
    padding: 5px 7px;
    background: #d16f45;
    border-radius: 50px;
    display: inline-block;
    line-height: 1;
    cursor: pointer;
}

/* 캘린더 컨테이너 기준으로 절대배치(툴팁 포지셔닝 기준) */
.calendar_box .cal_table1 {
    position: relative;
    /* 필요시 overflow: visible; */
}

/* ===== 상단 네비 버튼(모순 해소: 하나의 규칙으로 통합) ===== */
.calendar_box .cal_link {
    position: relative;
    z-index: 300;
    /* 버튼이 툴팁보다 위 */
}

.calendar_box .cal_link button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;

    display: inline-block;
    line-height: 20px;
    font-size: 16px;
    color: #fff;
    vertical-align: middle;
}

/* 첫 번째 버튼에만 구분자 | 표시 */
.calendar_box .cal_link button:first-of-type::after {
    content: "|";
    display: inline-block;
    width: 1px;
    height: 15px;
    vertical-align: middle;
    background: #7f7f84;
}

/* ===== 툴팁(공용 1개 재사용) ===== */
.calendar_box .my_txtd {
    display: none;
    position: absolute;
    /* .cal_table1 기준 */
    z-index: 100;
    background: #fff;
    padding: 8px;
    border: 1px solid #000;
    border-radius: 5px;
    max-width: 50%;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    pointer-events: auto;
    /* 툴팁 위에서도 hover 유지 */
}

.calendar_box .my_txtd .line {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin: 2px 0;
    overflow: hidden;
}

/* 한 줄일 때만 배지를 세로 가운데 정렬 */
.calendar_box .my_txtd .line.single-line {
    align-items: center;
}

/* 카테고리 뱃지 */
.calendar_box .my_txtd h3 {
    flex: 0 0 auto;
    line-height: 1.4;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: #000d;
    color: #fff;
}

.calendar_box .my_txtd .line .lineText {
    flex: 1 1 auto;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* ← 2줄까지만 */
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.4;
    max-height: calc(1.4em * 2);
    /* 시각적 2줄 높이 고정 */
    font-size: 12px;
}

.calendar_box .my_txtd h3.cal_c1 {
    background: #00a7ad;
}

.calendar_box .my_txtd h3.cal_c2 {
    background: #4900ad;
}

.calendar_box .my_txtd h3.cal_c3 {
    background: #0287ce;
}
