/* ==========================================================================
   Kids Trip Korea - Booking Open-Run & D-Day Calendar Stylesheet (css/calendar.css)
   Version: 2.0.0 (KTDS v1.0.0 Refined - Option 1 Soft Warm Rose & Slate Indigo)
   ========================================================================== */

.calendar-container {
    max-width: 1040px;
    margin: 1.25rem auto 5rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
    min-width: 0;
}

@media (min-width: 768px) {
    .calendar-container {
        padding: 0 1.5rem;
    }
}

/* ==========================================================================
   0. 오픈런 3계층 필터링 컨트롤 및 통합 스마트 툴바 (KTDS v1.0.0 Refined)
   ========================================================================== */
.cal-controls-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.cal-tier1-nav {
    margin-bottom: 0.15rem;
}

.cal-subgroup-bar {
    margin-bottom: 0.15rem;
}

.cal-tier2-bar {
    margin-bottom: 0.15rem;
}

.cal-unified-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.cal-mode-pills {
    display: inline-flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 2px;
}

.mode-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.35rem 0.75rem;
    min-height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    touch-action: manipulation;
}

.mode-pill-btn:hover {
    color: var(--text-primary);
}

.mode-pill-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    border-color: var(--border-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mode-pill-btn.active.mode-fc {
    background: var(--cal-fc-bg-subtle);
    color: var(--cal-fc-text-strong);
    border-color: var(--cal-fc-border);
    box-shadow: 0 1px 6px var(--cal-fc-glow);
}

.mode-pill-btn.active.mode-lottery {
    background: var(--cal-lottery-bg-subtle);
    color: var(--cal-lottery-text-strong);
    border-color: var(--cal-lottery-border);
    box-shadow: 0 1px 6px var(--cal-lottery-glow);
}

.pill-badge {
    font-size: 0.72rem;
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 5px;
    border-radius: var(--radius-full);
}

[data-theme="dark"] .pill-badge {
    background: rgba(255, 255, 255, 0.1);
}

.cal-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cal-results-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.25rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.cal-results-summary b {
    color: var(--accent-emerald);
    font-weight: 700;
}

@media (max-width: 576px) {
    .cal-unified-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    .cal-mode-pills {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }
    .mode-pill-btn {
        justify-content: center;
        padding: 0.35rem 0.2rem;
        font-size: 0.78rem;
        gap: 2px;
    }
    .mode-pill-btn span:first-child {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .cal-toolbar-actions {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    .cal-view-switch-btns {
        flex: 1;
    }
    .cal-view-tab {
        flex: 1;
        text-align: center;
        padding: 0.4rem 0.35rem;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   1. 상위 1차 목적 탭 (Depth 1: 전체 / 숙소·캠핑 / 놀거리·체험)
   ========================================================================== */
.cal-purpose-nav,
.cal-purpose-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 4px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cal-purpose-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 46px;
    padding: 0.5rem 0.35rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: clamp(0.78rem, 2.7vw, 0.9rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap; /* 🔒 줄바꿈 원천 차단 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-purpose-tab:hover {
    color: var(--accent-emerald);
    background: var(--accent-emerald-tint);
}

.cal-purpose-tab.active {
    background: var(--bg-primary);
    color: var(--accent-emerald);
    font-weight: 700;
    border-color: rgba(5, 150, 105, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 초소형 모바일(<= 480px) 전용 탭 여백 보정 */
@media (max-width: 480px) {
    .cal-purpose-nav,
    .cal-purpose-tabs {
        padding: 3px;
        gap: 3px;
    }
    .cal-purpose-tab {
        padding: 0.45rem 0.2rem;
        gap: 2px;
        min-height: 44px;
        font-size: 0.8rem;
    }
    .cal-purpose-tab span[id^="count-"] {
        font-size: 0.7rem !important;
    }
}

/* ==========================================================================
   2. 선착순 vs 추첨제 행동 분리 3-Way 세그먼트 (Action Segment)
   ========================================================================== */
.cal-mode-segment {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 6px;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.mode-seg-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.5rem;
    min-height: 58px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-seg-title {
    font-size: 0.92rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mode-seg-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.mode-seg-btn.active.mode-all {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mode-seg-btn.active.mode-fc {
    background: var(--cal-fc-bg-subtle);
    color: var(--cal-fc-text-strong);
    border-color: var(--cal-fc-border);
    box-shadow: 0 2px 10px var(--cal-fc-glow);
}
.mode-seg-btn.active.mode-fc .mode-seg-desc {
    color: var(--cal-fc-text-strong);
    font-weight: 600;
}

.mode-seg-btn.active.mode-lottery {
    background: var(--cal-lottery-bg-subtle);
    color: var(--cal-lottery-text-strong);
    border-color: var(--cal-lottery-border);
    box-shadow: 0 2px 10px var(--cal-lottery-glow);
}
.mode-seg-btn.active.mode-lottery .mode-seg-desc {
    color: var(--cal-lottery-text-strong);
    font-weight: 600;
}

/* ==========================================================================
   3. 스마트 툴바 & 뷰 전환 / 찜 액션 바
   ========================================================================== */
.cal-smart-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.65rem 1rem;
    margin-bottom: 1.5rem;
}

.cal-view-switch-btns {
    display: inline-flex;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2px;
}

.cal-view-tab {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cal-view-tab.active {
    background: var(--bg-secondary);
    color: var(--accent-emerald);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.cal-fav-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 1rem;
    min-height: 38px;
    border-radius: var(--radius-full);
    background: var(--cal-fc-bg-subtle);
    border: 1px solid var(--cal-fc-border);
    color: var(--cal-fc-text-strong);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cal-fav-toggle-btn.active {
    background: var(--cal-fc-accent);
    color: #ffffff;
    border-color: var(--cal-fc-hover);
    box-shadow: 0 2px 10px var(--cal-fc-glow);
}

/* ==========================================================================
   4. 타임라인 그룹 헤더 & 오픈런 카드
   ========================================================================== */
.timeline-section {
    display: block;
    width: 100%;
    min-height: 360px;
}

.timeline-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.timeline-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-section-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.badge-urgent-group { background: var(--cal-fc-bg-badge); color: var(--cal-fc-text-strong); }
.badge-tomorrow-group { background: rgba(217, 119, 6, 0.12); color: #D97706; }
.badge-week-group { background: rgba(5, 150, 105, 0.12); color: #059669; }
.badge-upcoming-group { background: rgba(100, 116, 139, 0.12); color: #475569; }

/* [§2.4 CSS_JS_COMMONIZATION_REFACTOR_PLAN.md] .openrun-card/.openrun-card:hover/
   .openrun-card.card-fc/.openrun-card.card-lottery/.openrun-card-top의 구(舊) 정의
   (캘린더 리디자인 이전 버전)는 아래 "슬림 컴팩트 카드" 섹션의 재정의가 파일 내
   나중에 로드되어 항상 승리하므로 도달 불가능한 자기중복 데드코드였다 — 제거함.
   (.openrun-badge-row/.openrun-rule-tag/.openrun-time-tag/.tag-first-come/
   .tag-lottery는 신/구 카드 디자인이 공유하는 그대로 사용 중인 클래스라 유지) */

.openrun-badge-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.35rem;
}

.openrun-rule-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.openrun-time-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.tag-first-come {
    background: var(--cal-fc-bg-badge);
    color: var(--cal-fc-text-strong);
    border: 1px solid var(--cal-fc-border);
}

.tag-lottery {
    background: var(--cal-lottery-bg-badge);
    color: var(--cal-lottery-text-strong);
    border: 1px solid var(--cal-lottery-border);
}

/* ==========================================================================
   2.5 카드리스트 최상단 마스터 팁 박스 (Master Openrun Guide Card)
   ========================================================================== */
.openrun-master-tip-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(224, 93, 111, 0.07) 100%);
    border: 1px solid rgba(5, 150, 105, 0.25);
    border-left: 4px solid var(--accent-emerald);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
}

.openrun-master-tip-box.mode-lottery-theme {
    background: linear-gradient(135deg, rgba(91, 104, 223, 0.08) 0%, rgba(129, 140, 248, 0.07) 100%);
    border-color: rgba(91, 104, 223, 0.25);
    border-left-color: var(--cal-lottery-border-strong);
}

.master-tip-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.master-tip-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 260px;
}

.master-tip-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.master-tip-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.master-tip-headline {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.45;
}

.master-tip-headline b {
    color: var(--cal-fc-accent);
}

.openrun-master-tip-box.mode-lottery-theme .master-tip-headline b {
    color: var(--cal-lottery-accent);
}

.master-tip-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.btn-master-tip-modal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    min-height: 40px;
    background: var(--bg-primary);
    border: 1.5px solid var(--accent-emerald);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-emerald);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.10);
    flex-shrink: 0;
}

.btn-master-tip-modal:hover {
    background: var(--accent-emerald);
    color: #ffffff;
    border-color: var(--accent-emerald);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.openrun-master-tip-box.mode-lottery-theme .btn-master-tip-modal {
    border-color: var(--cal-lottery-accent);
    color: var(--cal-lottery-accent);
    box-shadow: 0 2px 6px rgba(91, 104, 223, 0.10);
}

.openrun-master-tip-box.mode-lottery-theme .btn-master-tip-modal:hover {
    background: var(--cal-lottery-accent);
    color: #ffffff;
    border-color: var(--cal-lottery-accent);
    box-shadow: 0 4px 12px rgba(91, 104, 223, 0.25);
}

@media (max-width: 640px) {
    .master-tip-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .btn-master-tip-modal {
        justify-content: center;
        width: 100%;
        min-height: 44px;
    }
}

/* ==========================================================================
   슬림 컴팩트 카드 & 세련된 소프트 틴트 팁 박스
   ========================================================================== */
.openrun-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.2rem;
    margin-bottom: 0.85rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.openrun-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    border-color: rgba(5, 150, 105, 0.3);
}

.openrun-card.card-fc {
    border-left: 3.5px solid var(--cal-fc-border-strong);
}

.openrun-card.card-lottery {
    border-left: 3.5px solid var(--cal-lottery-border-strong);
}

.openrun-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.45rem;
}

.openrun-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.2rem 0 0.15rem 0;
    line-height: 1.35;
}

.openrun-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.openrun-title a:hover {
    color: var(--accent-emerald);
}

.openrun-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.55rem;
}

/* 시설 특화 세련된 소프트 틴트 팁 박스 */
.openrun-facility-insight {
    font-size: 0.8rem;
    border-radius: var(--radius-md);
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.65rem;
    line-height: 1.45;
    transition: all 0.2s ease;
}

.openrun-facility-insight.insight-fc {
    background: var(--cal-fc-bg-subtle);
    border: 1px solid var(--cal-fc-border);
    border-left: 3px solid var(--cal-fc-border-strong);
    color: var(--cal-fc-text-tip);
}

.openrun-facility-insight.insight-lottery {
    background: var(--cal-lottery-bg-subtle);
    border: 1px solid var(--cal-lottery-border);
    border-left: 3px solid var(--cal-lottery-border-strong);
    color: var(--cal-lottery-text-tip);
}

.insight-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    margin-right: 6px;
    vertical-align: middle;
}

.insight-fc .insight-platform-badge {
    background: var(--cal-fc-bg-badge);
    color: var(--cal-fc-text-strong);
    border: 1px solid rgba(224, 93, 111, 0.25);
}

.insight-lottery .insight-platform-badge {
    background: var(--cal-lottery-bg-badge);
    color: var(--cal-lottery-text-strong);
    border: 1px solid rgba(91, 104, 223, 0.25);
}

.insight-tip-text {
    vertical-align: middle;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 추첨제 진행도 프로그레스 바 */
.lottery-progress-track {
    height: 6px;
    background: var(--cal-lottery-bg-badge);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.lottery-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cal-lottery-grad-start) 0%, var(--cal-lottery-grad-end) 100%);
    border-radius: 3px;
}

.openrun-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1.35fr;
    gap: 6px;
    align-items: center;
    margin-top: 0.75rem;
}

.btn-action-cal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0.45rem 0.35rem;
    min-height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: clamp(0.74rem, 2.4vw, 0.8rem);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    box-sizing: border-box;
}

.btn-action-cal:hover {
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    background: var(--accent-emerald-tint);
}

.btn-action-book-fc {
    background: var(--cal-fc-accent);
    color: #ffffff;
    border: 1px solid var(--cal-fc-accent);
    font-weight: 700;
    font-size: clamp(0.76rem, 2.5vw, 0.84rem);
    padding: 0.45rem 0.4rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    border-radius: var(--radius-md);
    box-sizing: border-box;
}

.btn-action-book-fc:hover {
    background: var(--cal-fc-hover);
    border-color: var(--cal-fc-hover);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--cal-fc-glow);
}

.btn-action-book-lottery {
    background: var(--cal-lottery-accent);
    color: #ffffff;
    border: 1px solid var(--cal-lottery-accent);
    font-weight: 700;
    font-size: clamp(0.76rem, 2.5vw, 0.84rem);
    padding: 0.45rem 0.4rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    border-radius: var(--radius-md);
    box-sizing: border-box;
}

.btn-action-book-lottery:hover {
    background: var(--cal-lottery-hover);
    border-color: var(--cal-lottery-hover);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--cal-lottery-glow);
}

.btn-fav-star {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #CBD5E1;
    transition: transform 0.2s ease, color 0.2s ease;
    padding: 6px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-fav-star.active { color: var(--cal-fc-accent); transform: scale(1.15); }

/* ==========================================================================
   5. 월간 달력 그리드 뷰 (Monthly Calendar Grid)
   ========================================================================== */
.monthly-calendar-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.calendar-month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.month-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.btn-month-nav {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-month-nav:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-emerald);
}

.calendar-grid-table {
    width: 100%;
    border-collapse: collapse;
}

.calendar-grid-table th {
    padding: 0.6rem 0.4rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.calendar-grid-table th.sun { color: var(--cal-fc-accent); }
.calendar-grid-table th.sat { color: var(--cal-lottery-accent); }

.calendar-day-cell {
    height: 90px;
    border: 1px solid var(--border-color);
    vertical-align: top;
    padding: 4px 6px;
    background: var(--bg-primary);
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (max-width: 640px) {
    .calendar-day-cell {
        height: 70px;
        padding: 3px;
    }
}

.calendar-day-cell:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-emerald);
}

.calendar-day-cell.other-month {
    opacity: 0.25;
    pointer-events: none;
}

.calendar-day-cell.today {
    border: 2px solid var(--accent-emerald);
    background: var(--accent-emerald-tint);
}

.day-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.calendar-day-cell.today .day-number {
    color: var(--accent-emerald);
}

.day-open-badge {
    display: block;
    margin-top: 4px;
    background: var(--cal-fc-bg-badge);
    color: var(--cal-fc-text-strong);
    border: 1px solid var(--cal-fc-border);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: var(--radius-xs);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-open-badge.lottery {
    background: var(--cal-lottery-bg-badge);
    color: var(--cal-lottery-text-strong);
    border-color: var(--cal-lottery-border);
}

/* ==========================================================================
   6. 일자별 상세 모달 (Day Detail Sheet Modal)
   ========================================================================== */
.day-detail-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 2500;
    padding: 1.25rem;
    padding-bottom: calc(1.25rem + var(--safe-bottom));
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    animation: drawerSlideUp 0.25s ease-out;
}

.day-detail-sheet.open {
    display: flex;
}

/* ==========================================================================
   7. 비교 가이드 박스
   ========================================================================== */
.compare-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-top: 2.5rem;
}

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.compare-col {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.compare-col.fc-guide { border-left: 3.5px solid var(--cal-fc-border-strong); }
.compare-col.fc-guide > div:first-child { color: var(--cal-fc-text-strong); }

.compare-col.lottery-guide { border-left: 3.5px solid var(--cal-lottery-border-strong); }
.compare-col.lottery-guide > div:first-child { color: var(--cal-lottery-text-strong); }

@media (max-width: 640px) {
    .cal-mode-segment { grid-template-columns: 1fr; gap: 4px; }
    .mode-seg-btn { min-height: 44px; padding: 0.4rem; }
    .compare-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   8. 오픈런 팁 헤더 & 가이드 모달 (KTDS v1.0.0 Standard)
   ========================================================================== */
.openrun-tip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.btn-openrun-guide-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--cal-fc-border);
    color: var(--cal-fc-text-strong);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 8px;
    min-height: 28px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-openrun-guide-trigger:hover {
    background: var(--cal-fc-bg-badge);
    border-color: var(--cal-fc-border-strong);
}

.openrun-tip-routine {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--cal-fc-text-tip);
}

/* 스마트폰 초단위 확인법 모달 / 바텀시트 */
.openrun-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.openrun-modal-overlay.open {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.openrun-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    position: relative;
    box-sizing: border-box;
}

.openrun-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.openrun-modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.openrun-modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.openrun-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.time-guide-box {
    background: var(--bg-primary);
    padding: 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.time-guide-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 4px;
}

.guide-title-tag {
    font-weight: 700;
    color: var(--accent-emerald);
}

.guide-title-tag.android {
    color: #2563EB;
}

.guide-title-tag.ios {
    color: #7C3AED;
}

.btn-naver-clock {
    font-size: 0.72rem;
    padding: 2px 8px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    background: var(--accent-emerald-tint);
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-naver-clock:hover {
    background: var(--accent-emerald);
    color: #ffffff;
}

.time-guide-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.time-guide-summary-box {
    background: var(--cal-fc-bg-subtle);
    border-left: 3px solid var(--cal-fc-border-strong);
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--cal-fc-text-tip);
}

@media (max-width: 640px) {
    .openrun-actions {
        display: grid;
        grid-template-columns: 1fr 1fr 1.3fr;
        gap: 5px;
        width: 100%;
        margin-top: 0.65rem;
    }

    .btn-action-cal {
        width: 100%;
        min-height: 40px;
        padding: 0.45rem 0.2rem;
        font-size: 0.74rem;
        text-align: center;
        margin-left: 0;
    }

    .btn-action-book-fc,
    .btn-action-book-lottery {
        grid-column: auto;
        width: 100%;
        min-height: 40px;
        padding: 0.45rem 0.25rem;
        font-size: 0.78rem;
        font-weight: 700;
        margin-left: 0;
    }

    .openrun-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .openrun-modal-content {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 80vh;
        padding-bottom: calc(1.5rem + var(--safe-bottom));
        animation: drawerSlideUp 0.25s ease-out;
    }
}

@media (max-width: 360px) {
    .openrun-actions {
        gap: 3px;
    }
    .btn-action-cal {
        font-size: 0.68rem;
        padding: 0.4rem 0.15rem;
    }
    .btn-action-book-fc,
    .btn-action-book-lottery {
        font-size: 0.72rem;
        padding: 0.4rem 0.15rem;
    }
}

