/* RankLab STEP 11-2 - 공통 반응형 1차 통합 */

/* 공통 컨테이너 */
.rl-container,
.rl-stock-page,
.rl-dashboard-v2,
.rl-tv,
.rl91,
.rl91v,
.rl93,
.rl101,
.rl103,
.rl104-wrap,
.rl95-section,
.rl-home-news-section,
.rl-home-theme-section{
    max-width:100%;
    box-sizing:border-box;
}

/* 메인 상단 3열 */
.rl-dashboard-v2 .rl-dashboard-grid.rl-dashboard-top{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:16px !important;
    width:100% !important;
}
.rl-dashboard-v2 .rl-dashboard-grid.rl-dashboard-top > *{
    min-width:0 !important;
    width:100% !important;
    box-sizing:border-box !important;
}

/* 급등주 / 거래대금 */
.rl-dashboard-v2 .rl-section-grid{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:16px !important;
    width:100% !important;
}
.rl-dashboard-v2 .rl-section-grid > *{
    min-width:0 !important;
}

/* 카드 공통 */
.rl-dashboard-v2 .rl-card,
.rl-home-theme-card,
.rl95-card,
.rl-home-news-main,
.rl-home-news-side{
    min-width:0 !important;
    max-width:100% !important;
    box-sizing:border-box !important;
}

/* 검색 공통 */
.rl104-form,
.rl102-search form,
.rl101-home-search form,
.rl101-search{
    min-width:0 !important;
}
.rl104-input,
.rl102-search input,
.rl101-home-search input,
.rl101-search input,
.rl101-search select{
    min-width:0 !important;
    max-width:100% !important;
    box-sizing:border-box !important;
}

/* 테마/해외주식 카드 */
.rl-home-theme-grid{
    display:grid !important;
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    gap:12px !important;
}
.rl95-grid{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:14px !important;
}

/* 뉴스 */
.rl-home-news-grid{
    display:grid !important;
    grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr) !important;
    gap:16px !important;
}

/* 표 공통 */
.rl-table-wrap,
.rl91-table-wrap,
.rl101-table-wrap{
    max-width:100% !important;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
}
table{
    max-width:100%;
}

/* 이미지/캔버스 */
img,canvas,svg{
    max-width:100%;
}
canvas{
    width:100% !important;
}

/* ===== 태블릿 ===== */
@media (max-width:1024px){
    .rl-container{
        padding-left:18px !important;
        padding-right:18px !important;
    }

    .rl-dashboard-v2 .rl-dashboard-grid.rl-dashboard-top{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    }

    .rl-dashboard-v2 .rl-dashboard-grid.rl-dashboard-top > :nth-child(3){
        grid-column:1 / -1;
    }

    .rl-home-theme-grid{
        grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    }

    .rl95-grid{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    }

    .rl-home-news-grid{
        grid-template-columns:1fr !important;
    }

    .rl104-drop{
        right:0 !important;
    }
}

/* ===== 모바일 ===== */
@media (max-width:767px){
    html,body{
        overflow-x:hidden !important;
    }

    .rl-container{
        padding-left:14px !important;
        padding-right:14px !important;
    }

    .rl-page-heading{
        display:flex !important;
        flex-direction:column !important;
        align-items:flex-start !important;
        gap:8px !important;
    }

    .rl-page-heading h1{
        font-size:26px !important;
        line-height:1.3 !important;
    }

    .rl-page-heading p{
        font-size:13px !important;
        line-height:1.6 !important;
    }

    .rl-update-time{
        font-size:11px !important;
    }

    /* 메인 3열 -> 1열 */
    .rl-dashboard-v2 .rl-dashboard-grid.rl-dashboard-top{
        grid-template-columns:1fr !important;
        gap:12px !important;
    }

    .rl-dashboard-v2 .rl-dashboard-grid.rl-dashboard-top > :nth-child(3){
        grid-column:auto !important;
    }

    /* 급등주 / 거래대금 -> 1열 */
    .rl-dashboard-v2 .rl-section-grid{
        grid-template-columns:1fr !important;
        gap:12px !important;
    }

    /* 검색 */
    .rl104-form,
    .rl102-search form,
    .rl101-home-search form,
    .rl101-search{
        grid-template-columns:1fr !important;
    }

    .rl104-submit,
    .rl102-search button,
    .rl101-home-search button,
    .rl101-search button{
        width:100% !important;
    }

    .rl104-drop,
    .rl102-suggest{
        left:0 !important;
        right:0 !important;
        width:auto !important;
    }

    .rl104-popular-line{
        overflow-x:auto !important;
        white-space:nowrap !important;
        scrollbar-width:none;
    }
    .rl104-popular-line::-webkit-scrollbar{
        display:none;
    }

    /* 테마 - 모바일 1열 */
    .rl-home-theme-grid{
    grid-template-columns:1fr !important;
    gap:12px !important;
    }

    /* 해외주식 */
    .rl95-grid{
        grid-template-columns:1fr !important;
    }

    /* 뉴스 */
    .rl-home-news-grid{
        grid-template-columns:1fr !important;
    }

    .rl-home-news-item{
        grid-template-columns:1fr !important;
        gap:5px !important;
    }

    .rl-home-news-stock{
        text-align:left !important;
    }

    /* 섹션 제목 */
    .rl-section-head,
    .rl-home-theme-section .rl-section-head,
    .rl-home-news-head,
    .rl95-head{
        display:flex !important;
        flex-direction:column !important;
        align-items:flex-start !important;
        gap:6px !important;
    }

    /* 메인 종목 행 */
    .rl-dashboard-v2 .rl-table-card .rl-stock-table > a{
        grid-template-columns:24px minmax(0,1fr) 72px 58px !important;
        gap:5px !important;
    }

    .rl-dashboard-v2 .rl-table-card .rl-stock-table > a > em{
        width:72px !important;
        min-width:72px !important;
        max-width:72px !important;
        font-size:12px !important;
    }

    .rl-dashboard-v2 .rl-table-card .rl-stock-table > a > strong{
        width:58px !important;
        min-width:58px !important;
        max-width:58px !important;
        font-size:12px !important;
    }

    /* 상세 페이지 공통 */
    .rl-detail-summary,
    .rl-tv-stats,
    .rl91v-grid,
    .rl93-grid{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    }

    /* 목록/뉴스 */
    .rl-news83-item,
    .rl-theme-news-item,
    .rl84-item,
    .rl101-item,
    .rl93-list a{
        grid-template-columns:1fr !important;
        gap:5px !important;
    }

    .rl-news83-side,
    .rl-theme-news-side,
    .rl84-side,
    .rl101-side,
    .rl93-list span{
        text-align:left !important;
    }

    /* 테이블은 가로 스크롤 */
    .rl-tv-table,
    .rl91-table,
    .rl101-table{
        min-width:820px !important;
    }
}

/* ===== 초소형 모바일 ===== */
@media (max-width:480px){
    .rl-home-theme-grid{
        grid-template-columns:1fr !important;
    }

    .rl-detail-summary,
    .rl-tv-stats,
    .rl91v-grid,
    .rl93-grid{
        grid-template-columns:1fr !important;
    }

    .rl104-input{
        font-size:14px !important;
        height:48px !important;
    }

    .rl104-submit{
        height:46px !important;
    }

    .rl-home-theme-card,
    .rl95-card{
        padding:14px !important;
    }

    .rl-card,
    .rl93-panel,
    .rl91v-hero,
    .rl-tv-hero{
        border-radius:14px !important;
    }
}
