        * {
            box-sizing: border-box;
        }
        body {
            margin: 0;
            padding: 15px;
            width: 100vw;
            height: 100vh;
            background: #f8f9fa;
            font-family: 'Samsung One', sans-serif;
            color: #333;
            overflow: hidden;
        }

        .main-container {
            display: flex;
            width: 100%;
            height: 100%;
            gap: 15px;
        }

        /* [모바일 및 태블릿(가로 포함) 반응형 대응] */
        .mobile-only-footer { display: none; } /* PC에서는 숨김 */
        .mobile-footer { display: none; }      /* PC에서는 숨김 */

        .glass-panel {
            background: #fff;
            border-radius: 12px;
            border: 1.5px solid #333;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-sizing: border-box;
            flex-shrink: 0;
            /* 내용이 길어져도 패널이 찌그러지지 않도록 고정 */
        }

        .scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 5px;
    padding-bottom: 30px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

        input,
        select,
        button {
            font-family: 'Samsung One', sans-serif;
            font-size: 11px;
            color: #333;
        }

        .left-area {
            width: 240px;
            display: flex;
            flex-direction: column;
            height: 100%;
            flex-shrink: 0;
            overflow: hidden;
        }

        .l1-title {
            height: 90px;
            padding: 0 15px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            background: #333;
            color: #fff;
            border: none;
            flex-shrink: 0;
            margin-bottom: 15px;
            border-radius: 12px;
            cursor: pointer;
            position: sticky;
            top: 0;
            z-index: 1000;
            /* 스크롤 시에도 최상단 고정 */
        }

        .slogan-top {
            font-size: 11px;
            font-weight: normal;
            opacity: 0.9;
            line-height: 1.4;
            text-align: left;
        }

        .brand-main {
            font-size: 17px;
            font-weight: bold;
            margin: 2px 0;
            text-align: left;
        }

        .scroll-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 15px;
            overflow-y: auto;
            scrollbar-width: none;
        }

        .scroll-container::-webkit-scrollbar {
            display: none;
        }

        .l2-search {
            padding: 12px;
            flex-shrink: 0;
        }

        .input-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        input,
        select {
            width: 100%;
            border: 1px solid #ddd;
            padding: 6px;
            border-radius: 4px;
            box-sizing: border-box;
        }

        .btn-search {
            width: 100%;
            margin-top: 10px;
            padding: 8px;
            border: none;
            border-radius: 4px;
            background: #333;
            color: white;
            font-weight: bold;
            font-size: 12px;
            cursor: pointer;
        }

        .l3-summary {
            height: 40px;
            padding: 0 15px;
            display: block;
            line-height: 40px;
            background: #f0f4f8;
            font-weight: bold;
            font-size: 12px;
            flex-shrink: 0;
            width: 100%;
            text-align: left;
            white-space: nowrap;
        }

      .l4-list {
    height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 10px;
    background: #fff;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

        .card {
            min-height: 40px;
            padding: 8px 10px;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
            border: 1px solid #eee;
            border-radius: 6px;
            font-size: 12px;
            margin-bottom: 8px;
            background: #fff;
            cursor: pointer;
            word-break: keep-all;
            /* 단어 단위 줄바꿈으로 깔끔하게 유지 */
            line-height: 1.4;
        }

        .l5-local-news {
            min-height: 100px;
            padding: 12px;
            flex-shrink: 0;
        }

        #detail-mode-left {
            display: none;
            flex-direction: column;
            flex: 1;
            gap: 15px;
            /* overflow: hidden 삭제하여 스크롤 활성화 */
        }

        .l2-profile {
            padding: 12px;
            background: #fff;
            flex-shrink: 0;
            position: relative;
        }

        .profile-expanded {
            display: block;
            margin-top: 10px;
            font-size: 11px;
            line-height: 1.8;
            color: #555;
            border-top: 1px solid #eee;
            padding-top: 10px;
            word-break: keep-all;
        }

        .prof-page-nav {
            display: flex;
            gap: 8px;
            margin-top: 8px;
            justify-content: center;
            font-size: 10px;
            color: #999;
        }

        .prof-page-btn {
            cursor: pointer;
            padding: 2px 5px;
            border: 1px solid #eee;
            border-radius: 3px;
        }

        .prof-page-btn.active {
            color: #1a73e8;
            font-weight: bold;
            border-color: #1a73e8;
        }

        .l6-footer {
            padding: 15px;
            font-size: 11px;
            line-height: 1.6;
            color: #666;
            background: #f1f3f5;
            flex-shrink: 0;
            border-top: 1.5px solid #333;
        }

        .right-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 15px;
            height: 100%;
        }

        .r1-map {
            flex: 1;
            background: #fff;
            position: relative;
            border-radius: 12px;
            border: 1.5px solid #333;
            overflow: hidden;
        }

        .r2-ad-grid {
            height: 140px;
            display: flex;
            gap: 15px;
            flex-shrink: 0;
        }

        .ad-unit {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            text-align: center;
            color: #555;
            font-weight: bold;
        }

        .r3-news-ticker {
            height: 45px;
            background: #333;
            color: #fff;
            display: flex;
            align-items: center;
            padding: 0 15px;
            border-radius: 10px;
            flex-shrink: 0;
            white-space: nowrap;
            overflow: hidden;
        }

        .report-overlay {
            position: absolute;
            bottom: 20px; /* 하단 중앙으로 변경해봄 (더 잘 보이게) */
            left: 50%;
            transform: translateX(-50%);
            width: 320px;
            background: #fff;
            border: 1.5px solid #333;
            border-radius: 16px;
            z-index: 9999;
            display: none;
            flex-direction: column;
            padding: 0;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            animation: fadeInUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        }

        .pop-header {
            padding: 12px 15px;
            background: #fff;
            border-bottom: 1px solid #eee;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: move; /* 드래그 가능 표시 */
            user-select: none; /* 드래그 시 텍스트 선택 방지 */
        }

        .pop-close-btn {
            color: #888;
            background: none;
            border: none;
            font-size: 18px;
            cursor: pointer;
            line-height: 1;
            transition: 0.2s;
        }
        .pop-close-btn:hover { color: #333; }

        .pop-title-text {
            font-size: 13px;
            font-weight: 800;
            color: #111;
            word-break: keep-all;
            overflow-wrap: break-word;
        }

        .pop-category-badge {
            font-size: 9px;
            padding: 2px 7px;
            background: #f0f4ff;
            color: #1a73e8;
            border-radius: 4px;
            border: 1px solid #c7d9f9;
            font-weight: 700;
        }

        .pop-info-grid {
            padding: 12px 18px;
            background: #fff;
            display: flex;
            flex-direction: column;
            gap: 6px;
            border-bottom: 1px solid #f0f0f0;
        }

        .pop-grid-item { display: flex; gap: 10px; align-items: center; }
        .pop-grid-label { font-size: 9px; color: #aaa; width: 35px; font-weight: bold; }
        .pop-grid-value { font-size: 10px; color: #333; font-weight: 600; }

        .pop-body {
            padding: 15px 18px;
            font-size: 11px;
            color: #666;
            line-height: 1.6;
            max-height: 80px;
            overflow-y: auto;
            word-break: keep-all;
        }

        /* 팝업 스크롤바 커스텀 */
        .pop-body::-webkit-scrollbar {
            width: 4px;
        }
        .pop-body::-webkit-scrollbar-track {
            background: #f1f1f1;
        }
        .pop-body::-webkit-scrollbar-thumb {
            background: #ccc;
            border-radius: 10px;
        }
        .pop-body::-webkit-scrollbar-thumb:hover {
            background: #1a73e8;
        }

        .pop-footer {
            padding: 10px 15px 15px;
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        /* 추천 버튼 스타일 */
        .btn-like {
            background: #fff;
            border: 1.5px solid #eee;
            color: #666;
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 10px;
            font-weight: bold;
            cursor: pointer;
            transition: 0.2s;
        }
        .btn-like:hover { background: #f8f9fa; border-color: #ccc; }
        .btn-like.active { background: #fee2e2; border-color: #fca5a5; color: #ef4444; }

        /* [수정] 자세히 보기 버튼 - 프리미엄 스타일 */
        .btn-more-detail {
            background: none;
            border: 1.5px solid #1a73e8;
            color: #1a73e8;
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 10px;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .btn-more-detail:hover {
            background: #1a73e8;
            color: #fff;
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(26, 115, 232, 0.2);
        }
        .btn-more-detail::after { content: ' →'; font-size: 12px; }

        /* [신규] 상세 보기 모달 스타일 */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.7);
            backdrop-filter: blur(8px);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
        }
        .modal-content {
            width: 95%; max-width: 500px;
            max-height: 85vh; /* 화면의 85%만 차지하도록 제한 */
            background: #fff;
            border-radius: 24px;
            overflow-y: auto; /* 내용이 길면 전체 스크롤 발생 */
            -webkit-overflow-scrolling: touch; /* 모바일 부드러운 스크롤 */
            box-shadow: 0 30px 60px rgba(0,0,0,0.4);
            animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
            display: flex;
            flex-direction: column;
            scrollbar-width: thin; /* PC에서도 스크롤바가 보이도록 설정 */
        }
        
        .modal-header { padding: 25px 30px 15px; display: flex; justify-content: space-between; align-items: center; }
        .modal-title { 
            font-size: 19px; 
            font-weight: 800; 
            color: #111; 
            word-break: keep-all; /* 단어 단위 줄바꿈 */
            line-height: 1.4;
        }
        
        .modal-info-box { 
            margin: 0 30px; 
            padding: 15px 20px; 
            background: #f8f9fa; 
            border-radius: 12px;
            display: grid; 
            grid-template-columns: 1fr 1fr; 
            gap: 10px; 
        }

        .modal-media { 
            margin: 20px 30px 10px; 
            height: 140px; 
            background: #f1f3f5; 
            border-radius: 16px; /* 둥근 사각형 처리 */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            border: 1px dashed #ddd;
        }

        .modal-body { 
            padding: 20px 30px 10px; 
            font-size: 14px; 
            line-height: 1.8; 
            color: #333; 
            word-break: keep-all;
        }

        /* [개선] 댓글 섹션 - 아코디언 스타일 */
        .comment-section {
            background: #fafafa;
            border-top: 1px solid #eee;
        }
        .comment-toggle-btn {
            width: 100%;
            box-sizing: border-box;
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            font-size: 13px;
            font-weight: 800;
            color: #333;
            transition: 0.2s;
        }
        .comment-toggle-btn:hover { background: #f1f3f5; }
        
        .comment-content-area {
            display: none; /* 초기 상태: 닫힘 */
            padding: 0 30px 30px;
            animation: fadeIn 0.3s ease;
        }
        
        .comment-input-wrap {
            display: flex;
            gap: 10px;
            margin: 10px 0 20px;
        }
        .comment-input {
            flex: 1;
            padding: 12px 15px;
            border: 1px solid #ddd;
            border-radius: 10px;
            font-size: 12px;
            outline: none;
        }
        .comment-submit {
            padding: 0 20px;
            background: #1a73e8;
            color: #fff;
            border: none;
            border-radius: 10px;
            font-weight: bold;
            font-size: 12px;
            cursor: pointer;
        }
        
        .comment-item {
            margin-bottom: 15px;
            font-size: 13px;
            color: #555;
            line-height: 1.5;
        }
        .comment-user-info { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
        .comment-user-name { font-weight: bold; color: #333; }
        .comment-date { font-size: 10px; color: #aaa; }

        /* [신규] 의원실 답변 스타일 */
        .reply-box {
            margin-top: 8px;
            margin-left: 15px;
            padding: 12px 15px;
            background: #eef2ff;
            border-radius: 12px;
            border-left: 3px solid #1a73e8;
            font-size: 12px;
        }
        .reply-tag {
            display: inline-block;
            background: #1a73e8;
            color: #fff;
            font-size: 9px;
            padding: 1px 5px;
            border-radius: 4px;
            font-weight: bold;
            margin-bottom: 5px;
        }
        .reply-text { color: #1e40af; font-weight: 500; }

        .modal-content-card {
            background: #fff;
            border: 1px solid #eee;
            border-radius: 12px;
            padding: 15px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.02);
        }

        .pop-drag-handle {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 15px;
            background: #333;
            cursor: move;
            border-radius: 8px 8px 0 0;
        }

        .task-detail-container {
            display: none;
            height: 160px;
            /* 헤더 공간을 위해 높이를 약간 확보 */
            gap: 15px;
            flex-shrink: 0;
        }

        .task-ctrl-group {
            width: 240px;
            display: flex;
            flex-direction: column;
            gap: 10px; /* 두 박스 사이의 간격 */
            flex-shrink: 0;
            height: 100%;
        }

        .task-ctrl-a {
            background: #fff;
            border-radius: 12px;
            border: 1.5px solid #333;
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
            box-shadow: 0 4px 12px rgba(0,0,0,0.05);
            overflow: hidden;
            flex-shrink: 0;
        }

        .ctrl-header {
            height: 34px;
            /* 딱 한 줄 느낌의 높이 */
            padding: 0 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            background: #f8f9fa;
        }

        .ctrl-header span {
            font-size: 11px;
            font-weight: bold;
            color: #333;
        }

        #task-welcome-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            background: #fff;
            border-radius: 12px;
            border: 1.5px solid #333;
            box-sizing: border-box;
            padding: 10px;
            transition: all 0.3s ease;
        }

        .ctrl-body {
            flex: 1;
            padding: 12px;
            display: none; 
            flex-direction: column;
            gap: 10px; /* 여유 공간을 활용한 간격 확장 */
            border-top: 1px solid #eee; 
            background: #fff;
            justify-content: center; /* 세로 중앙 정렬로 균형 확보 */
        }

        .ctrl-filters {
            display: flex;
            background: #f1f3f5;
            border-radius: 8px;
            padding: 3px;
            gap: 2px;
        }

        .filter-btn {
            flex: 1;
            text-align: center;
            padding: 4px 0;
            cursor: pointer;
            color: #888;
            font-size: 10px;
            font-weight: 500;
            border-radius: 6px;
            transition: all 0.2s ease;
        }

        .filter-btn.active {
            background: #fff;
            color: #333;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            font-weight: bold;
        }

        .ctrl-dates-row {
            display: flex;
            gap: 4px;
            align-items: center;
            justify-content: space-between;
        }

        .ctrl-dates-row input {
            flex: 1;
            height: 24px;
            border: 1px solid #eee;
            border-radius: 6px;
            padding: 0 8px;
            font-size: 10px;
            color: #333;
            background: #f8f9fa;
        }

        .ctrl-action-row {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .btn-action-search {
            flex: 1.2;
            height: 26px;
            background: #333;
            color: #fff;
            border: none;
            border-radius: 6px;
            font-weight: bold;
            font-size: 10px;
            cursor: pointer;
        }

        .ctrl-pager {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 2px;
            background: #f8f9fa;
            padding: 0 4px;
            border-radius: 6px;
            border: 1px solid #eee;
            height: 26px;
            box-sizing: border-box;
            justify-content: space-between;
        }

        .pager-btn {
            cursor: pointer;
            font-size: 14px;
            color: #999;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .pager-btn:hover {
            background: #eee;
            color: #333;
        }

        #task-page-indicator {
            font-size: 10px;
            color: #333;
            font-weight: bold;
            min-width: 30px;
            text-align: center;
        }

        .task-slider-b {
            flex: 1;
            background: #fff;
            border-radius: 12px;
            border: 1.5px solid #333;
            padding: 10px;
            box-sizing: border-box;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .task-container {
            width: 100%;
            height: 100%;
            display: flex; /* 가로 슬라이드를 위해 flex 유지 */
            flex-direction: row;
            flex-wrap: nowrap;
            gap: 0;
            overflow: hidden;
            scroll-behavior: smooth;
        }

        /* 각 페이지(4개씩)를 담는 래퍼 */
        .task-page-wrapper {
            flex: 0 0 100%;
            width: 100%;
            height: 100%;
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
            padding: 5px;
            box-sizing: border-box;
        }

        .task-card {
            width: 100%;
            height: 100%;
            min-width: 0; /* 중요: 그리드 내부에서 짤림 방지 */
            background: #fff;
            border: 1.5px solid #333;
            border-radius: 8px;
            padding: 10px;
            font-size: 11px;
            cursor: pointer;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .task-card.active {
            background: #e0f2fe !important;
            border-color: #1a73e8;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        // [v1.8.8] 초기 로딩 시 최민희 의원 상세 페이지 자동 진입
        await goDetail("NAT-41-360-01");

        // [v1.8.8] 카테고리 탭 이벤트 바인딩
        initCategoryTabs();

        // [v1.8.3] 초기 로딩 시 전체 지역 의정 리포트 5개 표시
        updateMainActivityFeed("", "");
    } catch (err) {
        console.error("데이터 로드 실패:", err);
    }
}

// [v1.8.8] 카테고리 탭 클릭 시 필터링 로직
function initCategoryTabs() {
    const tabs = document.querySelectorAll('#task-category-tabs .filter-btn');
    tabs.forEach(tab => {
        tab.onclick = function() {
            tabs.forEach(t => t.classList.remove('active'));
            this.classList.add('active');
            const cat = this.dataset.cat;
            
            // 현재 의정 활동 리스트 필터링
            if (currentDetailUid) {
                fetchTaskData(currentDetailUid).then(data => {
                    renderTasks(currentDetailUid, cat, data.tasks || []);
                });
            }
        };
    });
}

.mobile-footer { display: none !important; }