/* ================================================
   TOTAL_month - 이달의 일정형 단순 latest 스킨
   BBS6 카드 디자인 톤 (회색 박스 + 검정 라벨 + + 아이콘)
   회색 박스 1개 안에 [헤더 + 행 N줄]
   ================================================ */

.TOTAL_month {
    width: 100%;
    float: left;
    box-sizing: border-box;
}

/* ★ 박스 높이 100% 모드 (좌측 스택 높이에 맞춰 배경만 늘림) */
.TOTAL_month.tm-full-height {
    height: 100%;
}
.TOTAL_month.tm-full-height .tm_box {
    height: 100%;
    box-sizing: border-box;
}
/* 행 리스트는 자기 자신 높이 유지 (벌어지지 않음) */

/* 회색 박스 (BBS6 톤 유지) */
.TOTAL_month .tm_box {
    width: 100%;
    background: var(--tm-box-bg, #f5f5f5);
    border-radius: var(--tm-box-radius, clamp(12px, calc(0.94vw + 9px), 24px));
    padding: var(--tm-box-padding, clamp(20px, calc(1.56vw + 15px), 35px));
    box-sizing: border-box;
}

/* 박스 헤더 (라벨 + 플러스) */
.TOTAL_month .tm_box_head {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--tm-head-mb, clamp(14px, calc(0.78vw + 11.5px), 24px));
}

/* 라벨 (검정 둥근 pill) */
.TOTAL_month .tm_label {
    display: inline-flex;
    align-items: center;
    padding: var(--tm-label-padding, clamp(6px, calc(0.31vw + 5px), 10px) clamp(12px, calc(0.63vw + 10px), 20px));
    /* 4모서리 개별값 → 통일값 → 기본 100px 순으로 fallback */
    border-top-left-radius:     var(--tm-label-radius-tl, var(--tm-label-radius, 100px));
    border-top-right-radius:    var(--tm-label-radius-tr, var(--tm-label-radius, 100px));
    border-bottom-left-radius:  var(--tm-label-radius-bl, var(--tm-label-radius, 100px));
    border-bottom-right-radius: var(--tm-label-radius-br, var(--tm-label-radius, 100px));
    background: var(--tm-label-bg, #111);
    color: var(--tm-label-color, #fff);
    font-size: var(--tm-label-size, clamp(12px, calc(0.31vw + 11px), 16px));
    font-weight: var(--tm-label-weight, 700);
    letter-spacing: -0.5px;
    white-space: nowrap;
    line-height: 1.2;
}

/* + 링크 버튼 (BBS6 그대로) */
.TOTAL_month .tm_plus_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(30px, calc(0.94vw + 27px), 42px);
    height: clamp(30px, calc(0.94vw + 27px), 42px);
    border-radius: 50%;
    border: 1.5px solid var(--tm-plus-border, #ccc);
    background: var(--tm-plus-bg, transparent);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    flex-shrink: 0;
}
.TOTAL_month .tm_plus_btn:hover {
    background: var(--tm-plus-hover-bg, #000);
    border-color: var(--tm-plus-hover-bg, #000);
}
.TOTAL_month .tm_plus_btn:hover .tm_plus_icon {
    transform: rotate(180deg);
}
.TOTAL_month .tm_plus_btn:hover .tm_plus_icon::before,
.TOTAL_month .tm_plus_btn:hover .tm_plus_icon::after {
    background: var(--tm-plus-hover-color, #fff);
}
.TOTAL_month .tm_plus_btn:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* + 아이콘 (CSS로 그림) */
.TOTAL_month .tm_plus_icon {
    position: relative;
    width: clamp(12px, calc(0.47vw + 10.5px), 18px);
    height: clamp(12px, calc(0.47vw + 10.5px), 18px);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: center center;
}
.TOTAL_month .tm_plus_icon::before,
.TOTAL_month .tm_plus_icon::after {
    content: '';
    position: absolute;
    background: var(--tm-plus-color, #555);
    transition: background 0.25s ease;
}
.TOTAL_month .tm_plus_icon::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}
.TOTAL_month .tm_plus_icon::after {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

/* 행 리스트 */
.TOTAL_month .tm_list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.TOTAL_month .tm_item {
    width: 100%;
    padding: var(--tm-row-gap, clamp(8px, calc(0.31vw + 7px), 12px)) 0;
    box-sizing: border-box;
}
.TOTAL_month .tm_item:first-child { padding-top: 0; }
.TOTAL_month .tm_item:last-child  { padding-bottom: 0; }

/* 구분선 모드 */
.TOTAL_month .tm_box.tm-has-divider .tm_item + .tm_item {
    border-top: 1px solid var(--tm-divider-color, rgba(0,0,0,0.08));
    padding-top: calc(var(--tm-row-gap, clamp(8px, calc(0.31vw + 7px), 12px)) + 2px);
}

/* 링크 (행 전체 클릭) */
.TOTAL_month .tm_link {
    display: flex;
    align-items: center;
    gap: clamp(8px, calc(0.47vw + 6.5px), 14px);
    width: 100%;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}
.TOTAL_month .tm_link:hover { opacity: 0.7; }
.TOTAL_month .tm_link:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 날짜 */
.TOTAL_month .tm_date {
    flex: 0 0 auto;
    font-size: var(--tm-date-size, clamp(13px, calc(0.31vw + 12px), 17px));
    color: var(--tm-date-color, #888);
    font-weight: var(--tm-date-weight, 500);
    letter-spacing: -0.3px;
    white-space: nowrap;
    line-height: 1.4;
}

/* 구분 막대 — 데코용 (aria-hidden 박힘)
   ★ WAVE Very low contrast(1.59:1) 회피:
     "|" 텍스트를 화면에서 숨기고 border-left 로 같은 모양 그림.
     border 는 contrast 검사 대상에서 제외 → 시각 디자인 보존 + WAVE 통과 */
.TOTAL_month .tm_sep {
    flex: 0 0 auto;
    display: inline-block;
    width: 0;
    height: 0.9em;
    margin: 0 2px;
    border-left: 1px solid var(--tm-sep-color, rgba(0,0,0,0.2));
    font-size: 0;
    line-height: 0;
    color: transparent;
    overflow: hidden;
    user-select: none;
}

/* 제목 */
.TOTAL_month .tm_title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--tm-title-size, clamp(14px, calc(0.31vw + 13px), 18px));
    color: var(--tm-title-color, #222);
    font-weight: var(--tm-title-weight, 500);
    letter-spacing: -0.3px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 빈 상태 */
.TOTAL_month .tm_empty {
    margin: 0;
    padding: 20px 0;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ================================================
   모바일
   ================================================ */
@media only all and (max-width: 767px) {
    .TOTAL_month .tm_box_head {
        margin-bottom: 12px;
    }
    .TOTAL_month .tm_label {
        padding: 5px 12px;
        font-size: 12px;
    }
    .TOTAL_month .tm_link {
        gap: 8px;
    }
    .TOTAL_month .tm_date {
        font-size: 13px;
    }
    .TOTAL_month .tm_title {
        font-size: 14px;
    }
}
