@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800;900&display=swap");

*, *:before, *:after {
    box-sizing: border-box;
}

@keyframes donbo-spin {
    to { transform: rotate(360deg); }
}
.donbo-spin {
    animation: donbo-spin 0.7s linear infinite;
}

:root {
    --header-height: 64px;
    --sidebar-width-expanded: 260px;
    
    /* ── 프리미엄 모던 컬러 팰럿 ── */
    --primary: #1a73e8;          /* 메인 블루 (돈보 블루) */
    --primary-hover: #1557b0;
    --primary-light: rgba(26, 115, 232, 0.06);
    --secondary: #4f46e5;        /* 서브 인디고 */
    --success: #10b981;          /* 초록 (상승/정상) */
    --danger: #f43f5e;           /* 장밋빛 빨강 (신고가/해제) */
    
    --bg-main: #f8fafc;          /* 슬레이트 계열 초경량 그레이 */
    --bg-card: #ffffff;
    --text-main: #1e293b;        /* 짙은 슬레이트 그레이 */
    --text-muted: #64748b;       /* 서브 슬레이트 그레이 */
    --text-light: #94a3b8;
    --border-light: #e2e8f0;     /* 얇은 경계선 */
    --border-hover: #cbd5e1;
    
    /* ── 미세 그림자 효과 ── */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.03), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    max-width: 100%;
    scroll-behavior: smooth;
}

body {
    max-width: 100%;
    overflow-x: hidden;
    font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg-main);
    margin: 0;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.025em; /* 한글 가독성 최적화 자간 */
}

/* ── 1. 헤더 영역 (Header) ── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-base);
}

/* 로고(header-left)는 사이드바와 같은 좌측 끝에 그대로 두고, 헤더 우측 라인만
   본문(.content-wrapper) 우측 라인에 맞춘다. 그래서 좌측정렬(margin-left:0)은 그대로 두고
   너비만 "0부터 본문 우측 끝까지"의 거리로 계산한다 — 본문 우측 끝 공식과 동일하게
   min()/max()로 좁은 화면(본문이 눌리는 경우)까지 전부 커버한다. */
.header-inner {
    width: calc(
        var(--sidebar-width-expanded)
        + max(0px, (100% - var(--sidebar-width-expanded) - 1240px) / 2)
        + min(1240px, 100% - var(--sidebar-width-expanded))
    );
    margin-left: 0;
    margin-right: auto;
    padding: 0 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.header-left { 
    display: flex; 
    align-items: center;
    height: 100%;
}
.logo {
    display: flex;
    align-items: center;
    margin: 0;
}
.logo a { 
    font-size: 22px; 
    font-weight: 850; 
    color: var(--text-main); 
    text-decoration: none; 
    letter-spacing: -0.04em;
    display: inline-flex;
    align-items: center;
}
/* 검색창을 본문(.content-wrapper) 좌측 카드 라인에 맞춘다. flex 흐름 안에서는
   로고 폭에 따라 위치가 흔들리므로, 뷰포트 기준(vw)으로 본문 좌측 안쪽 여백과
   동일한 절대 위치에 고정한다 (헤더 우측 랭킹 카드를 본문 우측에 맞춘 것과 대칭). */
.header-center {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: calc(var(--sidebar-width-expanded) + 24px);
    max-width: 640px;
    width: 640px;
    display: flex;
    margin: 0;
}


.search-form { 
    width: 100%; 
    display: flex; 
}
.search-form input { 
    width: 100%; 
    height: 40px; 
    padding: 0 16px; 
    border: 1px solid var(--border-light); 
    border-radius: 10px; 
    font-size: 14px; 
    font-weight: 500;
    background-color: #f1f5f9;
    color: var(--text-main);
    transition: var(--transition-base);
    font-family: inherit;
}
.search-form input:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}
.search-form input::placeholder {
    color: var(--text-light);
}
.header-right { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
}
.mobile-btn { 
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 8px;
    color: var(--text-muted);
    transition: var(--transition-base);
}
.mobile-btn:hover {
    background-color: #f1f5f9;
    color: var(--text-main);
}
.mobile-btn svg { 
    width: 22px; 
    height: 22px; 
}
#mobileMenuToggle {
    display: none;
}
#mobileMapBtn {
    display: none;
    text-decoration: none;
    color: var(--text-muted);
}

/* ── 2. 사이드바 및 페이지 구조 ── */
.page-wrapper { 
    display: flex; 
    position: relative; 
}
.sidebar {
    width: var(--sidebar-width-expanded); 
    flex-shrink: 0; 
    background-color: #ffffff;
    border-right: 1px solid var(--border-light); 
    height: calc(100vh - var(--header-height));
    position: sticky; 
    top: var(--header-height); 
    box-sizing: border-box;
    transition: var(--transition-base); 
    overflow: hidden;
}
.sidebar-inner { 
    padding: 20px 14px; 
    width: var(--sidebar-width-expanded); 
    box-sizing: border-box; 
    height: 100%; 
    overflow-y: auto; 
}
.sidebar-toggle {
    background: #ffffff; 
    border: 1px solid var(--border-light); 
    cursor: pointer; 
    padding: 0; 
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 26px; 
    height: 26px;
    position: fixed; 
    top: calc(var(--header-height) + 18px); 
    left: calc(var(--sidebar-width-expanded) - 13px);
    transition: var(--transition-base); 
    z-index: 1005;
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
}
.sidebar-toggle:hover { 
    background-color: #f8fafc; 
    color: var(--text-main);
    border-color: var(--border-hover);
}
.sidebar-nav { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}
.sidebar-nav ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}
.sidebar-nav li:not(:last-child) { 
    margin-bottom: 6px; 
}
.sidebar-nav a, .sidebar-nav .submenu-toggle {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%; 
    padding: 10px 14px;
    text-decoration: none; 
    color: var(--text-muted); 
    font-size: 14px; 
    font-weight: 600; 
    border-radius: 8px;
    transition: var(--transition-base); 
    white-space: nowrap; 
    box-sizing: border-box; 
    background: none; 
    border: none; 
    cursor: pointer; 
    font-family: inherit;
}
.sidebar-nav a:hover, .sidebar-nav .submenu-toggle:hover { 
    background-color: #f1f5f9; 
    color: var(--text-main); 
}
.sidebar-nav .active > a,
.sidebar-nav li.active > .submenu-toggle {
    background-color: var(--primary-light);
    color: var(--primary);
}
.sidebar-nav .active > a .menu-icon,
.sidebar-nav li.active > .submenu-toggle .menu-icon {
    color: var(--primary);
}
.submenu-toggle .arrow { 
    transition: transform 0.2s ease; 
}
.sidebar-nav .active > .submenu-toggle .arrow { 
    transform: rotate(180deg); 
}
.sidebar-nav .submenu {
    list-style: none;
    padding: 2px 0;
    margin: 4px 0 4px 36px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}
.sidebar-nav .submenu.open { 
    max-height: 400px; 
}
.submenu li {
    position: relative;
}
.submenu a {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px 8px 22px;
    color: var(--text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    position: relative;
}
.submenu a::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--text-light);
    transition: var(--transition-base);
}
.submenu a:hover::before {
    background-color: var(--text-main);
}
.submenu li.active > a {
    background-color: transparent;
    color: var(--primary);
    font-weight: 700;
}
.submenu li.active > a::before {
    background-color: var(--primary);
    width: 6px;
    height: 6px;
}

.menu-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.menu-icon {
    color: var(--text-light);
    transition: var(--transition-base);
    flex-shrink: 0;
}
.sidebar-nav a:hover .menu-icon,
.sidebar-nav .submenu-toggle:hover .menu-icon {
    color: var(--text-main);
}

/* 사이드바 축소 모드 */
body.sidebar-collapsed .sidebar { 
    width: 0px; 
    border-right: none;
}
body.sidebar-collapsed .sidebar-toggle { 
    left: 12px; 
}
body.sidebar-collapsed .sidebar-toggle svg { 
    transform: rotate(180deg); 
}

/* ── 3. 메인 콘텐츠 및 레이아웃 공통 ── */
.main-content { 
    flex-grow: 1; 
    min-width: 0; 
}
.content-wrapper {
    padding: 24px 32px;
    max-width: 1240px; 
    margin: 0 auto;    
    width: 100%;       
    box-sizing: border-box;
}
.content-box { 
    background-color: var(--bg-card); 
    border-radius: 16px; 
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm); 
    padding: 28px; 
    transition: var(--transition-base);
}
.content-box:hover {
    box-shadow: var(--shadow-md);
}

.site-footer { 
    background-color: #ffffff; 
    border-top: 1px solid var(--border-light); 
    padding: 40px 24px; 
    text-align: center; 
    color: var(--text-light);
    font-size: 13px;
}

/* ── 4. 반응형 레이아웃 스타일 ── */
@media screen and (max-width: 992px) {
    /* 이 폭부터는 사이드바가 고정(overlay)으로 빠져서 본문이 다시 뷰포트 전체 폭을 쓰므로,
       헤더도 사이드바 폭을 빼지 않은 원래의 단순 중앙정렬로 되돌린다. */
    .header-inner {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    /* 이 폭부터는 사이드바가 폭을 차지하지 않으므로, 검색창도 사이드바 오프셋을 뺀
       단순 중앙정렬(원래 flex 흐름)로 되돌린다. */
    .header-center {
        position: relative;
        left: auto;
        transform: none;
        flex: 1;
        max-width: 400px;
        width: auto;
        margin: 0 auto;
    }
    .sidebar-toggle {
        display: none;
    }
    .header-left { 
        flex-shrink: 0; 
    }
    .header-right { 
        display: flex; 
    }
    #mobileMenuToggle {
        display: flex;
    }
    #mobileMapBtn {
        display: flex;
    }
    .sidebar { 
        position: fixed; 
        left: 0; 
        top: var(--header-height); 
        transform: translateX(-100%); 
        z-index: 1100; 
        height: calc(100% - var(--header-height)); 
        box-shadow: var(--shadow-lg); 
        width: var(--sidebar-width-expanded); 
        padding: 0;
    }
    body.sidebar-collapsed .sidebar { 
        transform: translateX(-100%); 
    }
    .sidebar.is-open { 
        transform: translateX(0); 
    }
    .overlay { 
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100%; 
        background-color: rgba(15, 23, 42, 0.4); 
        backdrop-filter: blur(4px);
        z-index: 1050; 
        opacity: 0; 
        visibility: hidden; 
        transition: var(--transition-base); 
    }
    .overlay.is-visible { 
        opacity: 1; 
        visibility: visible; 
    }
}

@media screen and (max-width: 768px) {
    .header-inner {
        padding: 0 !important;
    }
    .logo a {
        font-size: 19px;
    }
    
    .header-center {
        position: relative;
        display: none;
        margin: 0;
        min-width: 0;
        max-width: none;
        flex-grow: 1;
    }

    /* 모바일 검색창 활성화 (.search-active) */
    .site-header.search-active .header-left,
    .site-header.search-active .header-right {
        display: none !important;
    }
    .site-header.search-active .header-center {
        position: relative !important;
        display: flex !important;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    
    .mobile-search-close, .mobile-search-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        padding: 8px;
        flex-shrink: 0;
        border-radius: 8px;
    }
    .mobile-search-close:hover, .mobile-search-toggle:hover {
        background-color: #f1f5f9;
    }
    
    .search-form {
        width: 100%;
        min-width: 0;
        flex-grow: 1;
    }
    .search-form input {
        width: 100%;
        min-width: 0;
        font-size: 13px;
        height: 38px;
        padding: 0 16px;
        border-radius: 20px;
        border: 1px solid var(--border-light);
        background-color: #f1f5f9;
    }
    
    .header-right {
        gap: 8px;
    }
    .content-wrapper {
        padding: 8px 6px !important;
    }
    .content-box {
        padding: 16px 14px;
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-light);
        margin-bottom: 12px;
    }

    .sidebar {
        top: 0 !important;
        height: 100% !important;
        background-color: #ffffff !important;
    }
    .sidebar-mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 18px 20px;
        border-bottom: 1px solid var(--border-light);
        margin-bottom: 8px;
    }
    .sidebar-brand {
        font-size: 18px;
        font-weight: 850;
        color: var(--primary);
    }
    .btn-sidebar-close {
        background: none;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
        border-radius: 8px;
    }
    .btn-sidebar-close:hover {
        background-color: #f1f5f9;
    }
}

/* ── 5. 자동완성 검색창 (Autocomplete) ── */
.search-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.autocomplete-section {
    margin-bottom: 10px;
}
.autocomplete-section:last-child {
    margin-bottom: 0;
}

.autocomplete-section-title {
    font-size: 11px;
    font-weight: 750;
    color: var(--text-light);
    padding: 6px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 13.5px;
    color: var(--text-main);
    text-decoration: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.autocomplete-item.active {
    font-weight: 600;
}

.autocomplete-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    min-width: 0;
}

.autocomplete-item-icon {
    font-size: 14px;
    color: var(--text-light);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.autocomplete-item-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.autocomplete-item-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-highlight {
    font-weight: 700;
    color: var(--primary);
}

.autocomplete-region-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 6px;
}

.autocomplete-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--text-light);
    padding: 4px 6px;
    border-radius: 6px;
}

.autocomplete-back-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.autocomplete-region-path {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.btn-clear-recent {
    background: none;
    border: none;
    font-size: 11px;
    color: var(--text-light);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition-base);
}
.btn-clear-recent:hover {
    background-color: #f1f5f9;
    color: var(--text-muted);
}

.recent-delete-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

/* ── 전역 헤더 실시간 롤링 바 & TOP 10 드롭다운 완벽 표준 스타일 ── */
.header-rank-area {
    position: relative;
    margin-left: auto;
    margin-right: 0;
    width: 320px;
    flex-shrink: 0;
}

.realtime-rank-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0 12px;
    height: 38px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
    user-select: none;
}
.realtime-rank-bar:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37,99,235,0.12);
}

.rank-ticker-window {
    flex: 1;
    height: 24px;
    overflow: hidden;
    position: relative;
}

.rank-ticker-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ticker-item {
    height: 24px;
    line-height: 24px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.rank-expand-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    margin-left: 8px;
    flex-shrink: 0;
}

.expand-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

/* 롤링 배너 클릭 시 펼쳐지는 TOP 10 레이어 팝업 */
.realtime-rank-dropdown {
    display: none;
    position: absolute;
    top: 46px;
    right: 0;
    width: 520px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
    padding: 16px;
    z-index: 9999;
}

.rank-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 6px;
}
.rank-dropdown-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}
.rank-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
}
.rank-tab-btn {
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rank-tab-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.rank-dropdown-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 2px;
}


/* 모바일 (768px 이하) 미니 롤링 칩 및 중앙 고정 팝업 */
@media screen and (max-width: 768px) {
    .site-header {
        padding: 0 10px !important;
    }
    .header-inner {
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 8px !important;
    }
    .header-left, .header-left .logo, .header-left .logo a {
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
    }
    /* 모바일에서는 로고 옆 "부동산" 배지를 삭제하여 롤링 창 공간 극대화 */
    .logo-badge {
        display: none !important;
    }
    /* 모바일 평시 상태: 검색창 영역을 0px로 숨겨 롤링바가 100% 넓이를 독점 */
    .header-center {
        display: none !important;
    }
    .site-header.search-active .header-center {
        display: flex !important;
    }
    .site-header.search-active .header-rank-area {
        display: none !important;
    }
    .header-rank-area {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }
    .realtime-rank-bar {
        height: 36px !important;
        padding: 0 10px !important;
        border-radius: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .header-right {
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    .rank-ticker-window {
        height: 24px;
        width: 100%;
    }
    .ticker-item {
        height: 24px;
        line-height: 24px;
        font-size: 14px !important;
    }
    .ticker-item span:first-child {
        font-size: 14.5px !important;
    }
    .ticker-item span:last-child {
        font-size: 12px !important;
    }
    .realtime-rank-dropdown {
        position: fixed !important;
        top: 56px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25) !important;
        z-index: 10000 !important;
    }
}
.recent-delete-btn:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

.favorite-toggle-btn {
    background: none;
    border: none;
    font-size: 15px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    flex-shrink: 0;
}

.favorite-toggle-btn:hover {
    background-color: #fef3c7;
}

.favorite-toggle-btn.active {
    color: #f59e0b;
}

.autocomplete-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.search-autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}
.search-autocomplete-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.search-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
.search-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
/* Sidebar toggle arrow micro-interaction */
.sidebar-toggle svg {
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sidebar-toggle:hover svg {
    transform: translateX(-3px);
}
body.sidebar-collapsed .sidebar-toggle:hover svg {
    transform: rotate(180deg) translateX(-3px);
}

/* ── 전역 헤더 실시간 롤링 바 & 반응형 드롭다운 스타일 ── */
.header-rank-area {
    position: relative;
    margin-left: auto;
    margin-right: 0;
    width: 260px;
    flex-shrink: 0;
}



/* ── 전역 헤더 실시간 롤링 바 & TOP 10 드롭다운 표준 전역 스타일 ── */
.header-rank-area {
    position: relative;
    margin-left: auto;
    margin-right: 0;
    width: 320px;
    flex-shrink: 0;
}

.realtime-rank-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0 12px;
    height: 38px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}
.realtime-rank-bar:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37,99,235,0.12);
}

.realtime-rank-dropdown {
    display: none;
    position: absolute;
    top: 46px;
    right: 0;
    width: 520px !important;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
    padding: 16px;
    z-index: 9999;
}

.rank-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 6px;
}
.rank-dropdown-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}
.rank-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
}
.rank-tab-btn {
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rank-tab-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.rank-dropdown-body {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 12px !important;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 2px;
}

/* 모바일 (768px 이하) 미니 롤링 칩 및 중앙 고정 팝업 */
@media screen and (max-width: 768px) {
    .site-header.search-active .header-rank-area {
        display: none !important;
    }
    .header-rank-area {
        display: block;
        margin-left: auto;
        margin-right: 0;
        width: 150px;
        max-width: 160px;
        flex-shrink: 1;
    }
    .realtime-rank-bar {
        height: 32px;
        padding: 0 8px;
        border-radius: 8px;
    }
    .realtime-rank-dropdown {
        position: fixed !important;
        top: 56px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25) !important;
        z-index: 10000 !important;
    }
}




