/* ═══════════════════════════════════════════════════════════
   deng.gg — 공통 스타일시트 (common.css)
   GNB · 드로어 · 사이드바 · 푸터 · 레이아웃 · 반응형  
   dashboard.css / briefing.css 양쪽에서 참조
   ═══════════════════════════════════════════════════════════ */

/* ── CSS 변수 (다크 테마 기본) ── */
:root {
    --bg-primary: #0b0e14;
    --bg-secondary: #0d1017;
    --bg-card: #131720;
    --bg-hover: #1a1f2c;
    --border: #1e2330;
    --border-light: #252b3a;
    --border-subtle: rgba(42, 48, 66, 0.4);
    --border-subtle-bg: rgba(42, 48, 66, 0.3);
    --text-primary: #e8eaed;
    --text-secondary: #b0b8c1;
    --text-muted: #8b95a8;
    --accent: #2e6bd4;
    --accent-glow: rgba(46, 113, 212, 0.15);
    --up: #d24f45;
    --up-bg: rgba(210, 79, 69, 0.08);
    --down: #2b72e2;
    --down-bg: rgba(43, 114, 226, 0.08);
    --flat: #8b95a1;
    --glass: rgba(19, 22, 28, 0.95);
    --glass-border: #1e2330;
    --radius: 0px;
    --radius-sm: 0px;
    --shadow: none;
    --transition: 0.1s ease-out;
    --gnb-bg: #003597;
    --header-h: 55px;
    --ticker-h: 88px;
    --tab-active: #2e6bd4;
    --sidebar-w: 400px;
    --max-w: 1560px;
    --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Roboto', monospace;

    /* ── 시맨틱 alias (briefing.css 호환) ── */
    --border-color: var(--border);
    --bg-surface: #161b26;
    --bg-card-hover: var(--bg-hover);
    --bg-body: var(--bg-primary);
    --shadow-card: 0 4px 16px rgba(0,0,0,0.25);

    /* ── 감성 뱃지 색상 ── */
    --color-bullish: #4ae168;
    --color-bearish: #ff7b72;
    --color-neutral: #b1bac4;

    /* ── 거래소 브랜드 색상 (대시보드 기준 통일) ── */
    --source-1: #f59e0b;                     /* 바로템 — 앰버 */
    --source-1-bg: rgba(245, 158, 11, 0.1);
    --source-1-border: rgba(245, 158, 11, 0.3);
    --source-2: #10b981;                     /* 아이템매니아 — 에메랄드 */
    --source-2-bg: rgba(16, 185, 129, 0.1);
    --source-2-border: rgba(16, 185, 129, 0.3);
    --source-3: #8b5cf6;                     /* 아이템베이 — 퍼플 */
    --source-3-bg: rgba(139, 92, 246, 0.1);
    --source-3-border: rgba(139, 92, 246, 0.3);

    /* ── 공통 간격 토큰 ── */
    --gap-xs: 8px;
    --gap-sm: 12px;
    --gap-md: 16px;
    --gap-lg: 20px;

    /* ── 테이블 토큰 ── */
    --table-th-padding: 7px 12px;
    --table-td-padding: 7px 12px;
    --table-th-bg: var(--bg-secondary);
    --table-font-size: 0.82rem;
    --table-th-font-size: 0.72rem;
}

/* ── 라이트 모드 ── */
[data-theme="light"] {
    --bg-primary: #f5f6f8;
    --bg-secondary: #eef0f4;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f5;
    --border: #e2e4ea;
    --border-light: #d5d8e0;
    --text-primary: #1a1d26;
    --text-secondary: #4a5060;
    --text-muted: #8b92a0;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-subtle-bg: rgba(0, 0, 0, 0.05);
    --accent: #2e6bd4;
    --accent-glow: rgba(46, 113, 212, 0.1);
    --up: #d24f45;
    --up-bg: rgba(210, 79, 69, 0.06);
    --down: #2b72e2;
    --down-bg: rgba(43, 114, 226, 0.06);
    --flat: #8b95a1;
    --glass: rgba(255, 255, 255, 0.95);
    --glass-border: #e2e4ea;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);

    /* ── 시맨틱 alias (briefing.css 호환) ── */
    --bg-surface: #f0f2f5;
    --shadow-card: 0 4px 16px rgba(0,0,0,0.08);
    --color-bullish: #26a641;
    --color-bearish: #f85149;
    --color-neutral: #8b949e;
}

/* ── 리셋 + body ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-width: 1400px;
}

/* 글로벌 스크롤바 — 모든 스크롤 영역 통일 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* ═══════════════════════════════════════
   GNB (업비트 시그니처 블루 상단 메뉴)
   ═══════════════════════════════════════ */
.gnb {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--gnb-bg);
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    border-bottom: none;
}

[data-theme="light"] .gnb {
    background: var(--gnb-bg);
}

.gnb-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gnb-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.gnb-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.gnb-logo-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.gnb-logo-eng {
    font-weight: 600;
    font-size: 0.85rem;
    opacity: 0.7;
    letter-spacing: 1px;
}

.gnb-menu {
    display: flex;
    gap: 4px;
}

.gnb-item {
    padding: 0 12px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.gnb-item:hover {
    color: rgba(255,255,255,0.85);
}

.gnb-item.active {
    color: #fff;
    font-weight: 700;
    border-bottom-color: #fff;
}

.gnb-right {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}

#header { display: none; }

.update-badge {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.55);
    padding: 0 10px;
    height: 28px;
    line-height: 28px;
    min-width: 80px;
    text-align: center;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

[data-theme="light"] .update-badge {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.12);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}
.theme-toggle-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* ═══════════════════════════════════════
   프리미엄 지수 롤링 티커
   ═══════════════════════════════════════ */
.premium-ticker {
    position: sticky;
    top: var(--header-h);
    z-index: 99;
    height: 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
}
.premium-ticker-track {
    display: flex;
    gap: 32px;
    white-space: nowrap;
    animation: premiumScroll linear infinite;
    will-change: transform;
}
.premium-ticker:hover .premium-ticker-track {
    animation-play-state: paused;
}
@keyframes premiumScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.pt-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: 'Roboto', 'Pretendard', sans-serif;
}
.pt-name { font-weight: 600; color: var(--text-primary); }
.pt-price { font-variant-numeric: tabular-nums; }
.pt-tag {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0.7;
    margin-left: 6px;
    margin-right: 2px;
}
.pt-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-pct.up { color: var(--up); }
.pt-pct.down { color: var(--down); }
.pt-pct.base { color: #10b981; font-weight: 700; }
.pt-src-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}
.pt-src {
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.pt-src.pt-lowest { color: #10b981; font-weight: 700; }
.pt-src-sep { font-size: 0.55rem; color: var(--border); margin: 0 1px; }
@media (max-width: 500px) {
    .premium-ticker { height: 24px; }
    .premium-ticker-track { gap: 20px; }
    .pt-item { font-size: 0.68rem; }
}
@media (max-width: 500px) {
    .premium-ticker-track { gap: 12px; }
}

/* ═══════════════════════════════════════
   햄버거 버튼 (모바일 전용)
   ═══════════════════════════════════════ */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    -webkit-tap-highlight-color: transparent;
}
.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ═══════════════════════════════════════
   모바일 드로어 (우측 슬라이딩)
   ═══════════════════════════════════════ */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.drawer-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 78vw;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    z-index: 510;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
.mobile-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--gnb-bg);
}
.drawer-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.drawer-close:hover { background: rgba(255,255,255,0.2); }

.drawer-options {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.drawer-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.drawer-update-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.drawer-update-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}
.drawer-option-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.drawer-option-label i {
    font-size: 1rem;
}

/* 테마 토글 스위치 */
.drawer-theme-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.25s;
    padding: 0;
}
[data-theme="dark"] .drawer-theme-toggle {
    background: var(--accent);
}
.drawer-theme-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-theme="dark"] .drawer-theme-knob {
    transform: translateX(20px);
}

.drawer-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.drawer-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 24px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
    position: relative;
}
.drawer-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.drawer-menu-item.active {
    color: var(--accent);
    font-weight: 700;
    background: rgba(59, 130, 246, 0.06);
}
.drawer-menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}
.drawer-menu-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.drawer-menu-badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    padding: 2px 7px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.drawer-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.drawer-sns {
    display: flex;
    gap: 12px;
}
.drawer-sns a {
    color: var(--text-muted);
    font-size: 1.15rem;
    text-decoration: none;
    transition: color 0.2s;
}
.drawer-sns a:hover { color: var(--text-primary); }
.drawer-copy {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ═══════════════════════════════════════
   page-wrapper / page-content 레이아웃
   ═══════════════════════════════════════ */
.page-wrapper {
    display: flex;
    max-width: var(--max-w);
    margin: 0 auto;
    min-height: calc(100vh - var(--header-h));
}

.page-content {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - var(--sidebar-w) - 160px);
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════
   서버 사이드바
   ═══════════════════════════════════════ */
.server-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-h) + 28px);
    height: calc(100vh - var(--header-h) - 28px);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── 검색 헤더 ── */
.sidebar-header {
    padding: 0 12px;
    height: 40px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    gap: 8px;
}

.sidebar-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    padding: 0;
    background: none;
    border: none;
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 14px;
}

.sidebar-search {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
}
.sidebar-search::placeholder {
    color: var(--text-muted);
}

/* ── 전체/관심 탭 (호가 모드 탭과 동일 언어) ── */
.sidebar-sub-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: transparent;
}

.sub-tab {
    flex: 1;
    padding: 9px 0;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    letter-spacing: 0.01em;
}
.sub-tab:hover { color: var(--text-secondary); }
.sub-tab.active {
    color: var(--text-primary);
    font-weight: 700;
    border-bottom-color: var(--accent);
}
.sub-tab i { font-size: 0.85rem; }

.sidebar-open-info {
    padding: 5px 12px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(59, 130, 246, 0.04);
    border-bottom: 1px solid var(--border-subtle);
    text-align: center;
    letter-spacing: 0.02em;
}
.sidebar-open-info .open-date {
    color: var(--accent);
    font-weight: 700;
    margin-left: 2px;
}

/* ── 컬럼 헤더 ── */
.sidebar-cols {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    gap: 4px;
}

.col-head {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.col-head:hover { color: var(--text-secondary); }
.col-head.active { color: var(--text-primary); }

.col-head::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
}

.sidebar-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ── 서버 행 ── */
.server-row {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    gap: 4px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle, rgba(42, 48, 66, 0.4));
    transition: background 0.15s ease;
    position: relative;
}
.server-row:hover {
    background: var(--bg-hover);
}
.server-row.active {
    background: rgba(46, 107, 212, 0.1);
}
.server-row.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    border-radius: 0 1px 1px 0;
}

/* 즐겨찾기 별 */
.server-row .srv-fav {
    width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.4;
    flex-shrink: 0;
}
.server-row:hover .srv-fav { opacity: 0.7; }
.server-row .srv-fav.active { color: #f59e0b; opacity: 1; }
.server-row .srv-fav:hover { transform: scale(1.15); color: #f59e0b; opacity: 1; }

/* 서버명 */
.server-row .srv-name {
    flex: 1.3;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 현재가 */
.server-row .srv-price {
    width: 72px;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}
.server-row .srv-change {
    width: 62px;
    text-align: right;
    font-size: 0.7rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.server-row .srv-volume {
    width: 72px;
    text-align: right;
    font-size: 0.68rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    letter-spacing: -0.01em;
}
.server-row .srv-change.rise,
.server-row .srv-change.up { color: var(--color-up, #f04452); }
.server-row .srv-change.fall,
.server-row .srv-change.down { color: var(--color-down, #3182f6); }
.server-row .srv-price.up { color: var(--color-up, #f04452); }
.server-row .srv-price.down { color: var(--color-down, #3182f6); }

/* ── 서버 리스트 스크롤 ── */
.server-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 사이드바 오버레이 (모바일) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* 모바일 FAB (서버 사이드바 토글) */
.mobile-server-fab {
    display: none;
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    z-index: 200;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}
.mobile-server-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
}
.mobile-server-fab:active {
    transform: scale(0.92);
}

/* ═══════════════════════════════════════
   YouTube 플로팅 배너 (좌측 하단 고정)
   ═══════════════════════════════════════ */
.yt-floating-banner {
    width: 160px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-h) + 28px);
    height: calc(100vh - var(--header-h) - 28px);
    z-index: 10;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    order: -1;
}

.yt-floating-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 40px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 0.75rem;
    font-weight: 700;
    color: #ff0000;
    flex-shrink: 0;
}
.yt-floating-header span {
    flex: 1;
    letter-spacing: 1px;
}

.yt-floating-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.yt-floating-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 6px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.12s;
}
.yt-floating-item:hover { background: var(--bg-hover); }

.yt-floating-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}
.yt-floating-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-floating-title {
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.yt-floating-meta {
    font-size: 0.58rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.yt-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff0000;
    margin-right: 3px;
    animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.yt-floating-footer {
    padding: 6px 10px;
    border-top: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
}
.yt-floating-footer a {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.yt-floating-footer a:hover { color: #ff0000; }

.yt-floating-loading {
    padding: 20px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.7rem;
}
.yt-floating-loading i {
    animation: spin 1s linear infinite;
    display: block;
    margin-bottom: 6px;
    font-size: 1.2rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   통일 푸터
   ═══════════════════════════════════════ */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 0;
    position: relative;
    z-index: 20;
}

.site-footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

/* 상단: 브랜드 + 내비 */
.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 0;
}

/* 100% 브라우저 너비 구분선 */
.footer-divider {
    border-bottom: 1px solid var(--border);
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-brand-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.footer-brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}
.footer-brand-sub {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.footer-nav {
    display: flex;
    gap: 6px;
}
.footer-nav a {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s;
}
.footer-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* 하단: SNS + 출처 + 저작권 */
.footer-bottom {
    text-align: center;
    padding: 12px 0 14px;
}

.footer-sns-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 8px;
}
.footer-sns-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    background: transparent;
}
.footer-sns-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    transform: translateY(-1px);
}
.footer-sns-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 4px;
}
.footer-sns-link.footer-email {
    width: auto;
    gap: 4px;
    padding: 0 8px;
    font-size: 0.9rem;
}
.footer-sns-link.footer-email span {
    font-size: 0.68rem;
    font-weight: 500;
}

.footer-source,
.footer-copy {
    margin: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}
.footer-source {
    margin-bottom: 2px;
}
.footer-copy {
    opacity: 0.6;
}
.footer-copy a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-copy a:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════
   공통 반응형 (860px 이하 — 모바일)
   ═══════════════════════════════════════ */
@media (max-width: 500px) {
    body {
        min-width: unset;
    }

    .gnb-menu { display: none; }
    .hamburger-btn { display: flex; }
    .gnb-desktop-only { display: none !important; }

    .page-wrapper {
        flex-direction: column;
    }

    .page-content {
        max-width: 100%;
    }

    .server-sidebar {
        position: fixed;
        top: var(--header-h);
        left: -85vw;
        right: auto;
        width: 85vw;
        max-width: 360px;
        height: calc(100vh - var(--header-h));
        z-index: 150;
        transition: left 0.3s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }
    .server-sidebar.open {
        left: 0;
    }

    .mobile-server-fab {
        display: flex;
        align-items: center;
    }

    /* 모바일: YT 플로팅 숨김 */
    .yt-floating-banner {
        display: none !important;
    }

    /* 모바일: 푸터 세로 스택 */
    .footer-top {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════
   500px 미만 — 소형 모바일 전용 최적화
   ═══════════════════════════════════════ */
@media (max-width: 500px) {
    /* 프리미엄 티커: 거래소별 가격 숨김 */
    .pt-src-group { display: none; }
    .pt-item { gap: 4px; font-size: 0.62rem; }

    /* 햄버거 버튼 터치 영역 확대 */
    .hamburger-btn {
        width: 44px;
        height: 44px;
        padding: 8px;
    }

    /* 드로어 너비 확대 */
    .mobile-drawer {
        width: 82vw;
        max-width: 360px;
    }

    /* 드로어 메뉴 아이템 터치 대상 확대 */
    .drawer-menu-item {
        padding: 16px 24px;
        min-height: 48px;
    }
}
