:root {
    --bg: #ffffff;
    --surface: rgba(255, 255, 255, 0.95);
    --card: #f8f9fa;
    --card-border: rgba(0, 0, 0, 0.15);
    --primary: #0066cc;
    --accent: #8c5bff;
    --positive: #26de81;
    --negative: #ff4757;
    --text: #1a1a1a;
    --text-muted: #666666;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --max-width: 1200px;
    --news-card-bg: #ffffff;
    --news-card-text: #1a1a1a;
    --news-card-text-muted: #424242;
    --chat-header-bg: var(--primary);
    --chat-header-text: #ffffff;
    --chat-user-bg: rgba(0, 102, 204, 0.18);
    --chat-user-border: rgba(0, 102, 204, 0.35);
    --chat-button-bg: var(--primary);
    --chat-button-text: #ffffff;
    --chat-button-hover: #0052a3;
    --auth-button-bg: var(--primary);
    --auth-button-text: #ffffff;
    --auth-button-hover: #0052a3;
    --new-button-bg: var(--primary);
    --new-button-text: #ffffff;
    --new-button-hover: #0052a3;
    --header-height: 72px;
    --bottom-nav-height: 58px;
    font-family: "Pretendard Variable", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
    height: 100%;
    min-height: 100vh;
    overflow: hidden;
    /* 방지: 모바일 브라우저 풀-투-리프레시로 전체가 끌려 내려오는 현상 */
    overscroll-behavior-y: none;
    /* 안드로이드/크롬 기반 풀-투-리프레시 차단 */
}

/* 실제 스크롤은 메인 컨텐츠만 사용 */
main {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* iOS 스크롤 관성 */
}

/* Scrollbar hidden (keep scrolling, hide UI) */
main,
.trading-list-scroll,
.side-modal-body {
    -ms-overflow-style: none;
    /* IE/Edge */
    scrollbar-width: none;
    /* Firefox */
}

main::-webkit-scrollbar,
.trading-list-scroll::-webkit-scrollbar,
.side-modal-body::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

[data-theme="dark"] {
    --bg: #0f0f0f;
    --surface: rgba(20, 20, 20, 0.95);
    --card: #1a1a1a;
    --card-border: rgba(255, 255, 255, 0.15);
    --primary: #0066cc;
    --accent: #8c5bff;
    --positive: #26de81;
    --negative: #ff4757;
    --text: #e0e0e0;
    --text-muted: #a0a0a0;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
    --news-card-bg: #ffffff;
    --news-card-text: #1a1a1a;
    --news-card-text-muted: #666666;
    --chat-header-bg: #ffffff;
    --chat-header-text: #1a1a1a;
    --chat-user-bg: rgba(255, 255, 255, 0.15);
    --chat-user-border: rgba(255, 255, 255, 0.3);
    --chat-button-bg: #ffffff;
    --chat-button-text: #1a1a1a;
    --chat-button-hover: #e0e0e0;
    --auth-button-bg: #ffffff;
    --auth-button-text: #1a1a1a;
    --auth-button-hover: #e0e0e0;
    --new-button-bg: #ffffff;
    --new-button-text: #1a1a1a;
    --new-button-hover: #e0e0e0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* left spacer | brand | actions */
    align-items: center;
    padding: 1.25rem 3vw;
    backdrop-filter: blur(12px);
    background: var(--surface);
    border-bottom: 2px solid var(--card-border);
    box-shadow: var(--shadow-soft);
}

.site-header .brand {
    grid-column: 2;
    justify-self: center;
}

.site-header .header-actions {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 바디 내 로그인/회원 영역 */
.body-auth {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 3vw 0;
}

.body-auth .auth-status {
    display: none;
}

.body-auth .auth-status.visible {
    display: inline-flex;
}

@media (min-width: 1025px) {
    .body-auth {
        display: flex;
    }
}

.theme-toggle {
    display: none !important;
    /* 다크모드 버튼 숨김 */
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: rgba(74, 201, 255, 0.16);
    color: var(--primary);
    transform: rotate(90deg);
}

.theme-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.brand {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.brand:hover {
    opacity: 0.8;
}

.brand-mark {
    font-size: 2rem;
    display: none;
    /* 아이콘 숨김 */
}

.brand-name {
    margin: 0;
    font-size: 1.3rem;
}

.brand-tagline {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-nav {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    font-size: 0.95rem;
}

.site-nav a {
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    background: rgba(74, 201, 255, 0.16);
    color: var(--primary);
}

.cta-button {
    background: var(--auth-button-bg);
    color: var(--auth-button-text);
    padding: 0.65rem 1.5rem;
    border: 1px solid var(--auth-button-bg);
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.cta-button:hover,
.cta-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: var(--auth-button-hover);
    border-color: var(--auth-button-hover);
}

.cta-button.full-width {
    width: 100%;
    justify-content: center;
}

.auth-trigger {
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--auth-button-bg);
    background: var(--auth-button-bg);
    color: var(--auth-button-text);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    font-weight: 600;
}

.auth-trigger:hover,
.auth-trigger:focus-visible {
    background: var(--auth-button-hover);
    border-color: var(--auth-button-hover);
    color: var(--auth-button-text);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-status {
    display: none;
    /* 기본 숨김 - JS로 로그인 시에만 표시 */
    align-items: center;
    gap: 0.65rem;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 0.5rem 1rem;
}

.auth-status.visible {
    display: inline-flex;
}

.auth-status span {
    font-size: 0.95rem;
    color: var(--text);
}

.auth-logout {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
}

.auth-logout:hover,
.auth-logout:focus-visible {
    color: var(--primary);
}

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 3vw 5rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* 매매일지 페이지는 패딩 최소화 */

/* 데스크탑 왼쪽 사이드 카테고리 */
.side-nav {
    position: fixed;
    top: 70px;
    left: 0;
    width: 200px;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem 1rem;
    border-right: 1px solid var(--primary);
}

.side-nav__item {
    display: block;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    color: var(--text);
    border: 1px solid transparent;
}

.side-nav__item:hover,
.side-nav__item:focus-visible {
    background: rgba(74, 201, 255, 0.12);
    border-color: rgba(74, 201, 255, 0.32);
}

.side-nav__item.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    font-weight: 600;
}

.side-nav__item.active:hover,
.side-nav__item.active:focus-visible {
    background: var(--primary);
    border-color: var(--primary);
    opacity: 0.9;
}

@media (min-width: 1025px) {
    .side-nav {
        display: flex;
    }

    main {
        /* Keep content visually centered while reserving space for the left sidebar */
        padding-left: 220px;
        /* reserve space for side-nav */
        max-width: calc(var(--max-width) + 220px);
        /* include sidebar space in centering calc */
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
        height: 100vh;
        padding-bottom: 5rem;
    }
    
    #trading.content-section {
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }

    /* Align header brand center with content area (account for left sidebar) */
    .site-header {
        display: none;
        /* hide header on desktop */
    }

    /* 데스크탑에서 커뮤니티 리스트 하단 패딩 */
    #community .trading-list-scroll {
        max-height: calc(100vh - 120px);
        padding-bottom: 3.5rem;
        /* FAB 버튼 공간 */
    }
}

/* 모바일 하단 바 카테고리 */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-nav-height);
    display: none;
    align-items: center;
    justify-content: space-around;
    gap: 0.5rem;
    background: var(--surface);
    border-top: 1px solid var(--card-border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    z-index: 1200;
    padding: 0 0.5rem env(safe-area-inset-bottom);
}

.bottom-nav__item {
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
}

.bottom-nav__item:focus-visible,
.bottom-nav__item:hover {
    background: rgba(74, 201, 255, 0.12);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }

    main {
        height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
        padding-bottom: calc(4rem + var(--bottom-nav-height));
    }

    /* 모바일에서 사이드 모달 전체 화면 표시 */
    .side-modal {
        width: 100%;
        max-width: 100vw;
        left: 0;
        right: 0;
    }

    .side-modal-header {
        padding: 1rem 1.25rem;
    }

    .side-modal-header h3 {
        font-size: 1.25rem;
    }

    .side-modal-body {
        padding: 1.25rem;
        padding-bottom: calc(1.25rem + var(--bottom-nav-height) + 1rem);
    }
}

/* 태블릿까지 하단바 고정 노출 */
@media (max-width: 1024px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
    }

    main {
        height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
        padding-bottom: calc(4rem + var(--bottom-nav-height));
    }
}

.highlight-card {
    background: var(--card);
    padding: 2.25rem;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
}

.highlight-card h2 {
    margin: 0 0 0.85rem;
}

.highlight-date {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.highlight-link {
    color: var(--primary);
    font-weight: 600;
}

.highlight-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: flex-start;
}

/* 커뮤니티 탭 */
.sub-tabs {
    display: inline-flex;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.35rem;
}

.sub-tab {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.sub-tab.active {
    background: var(--primary);
    color: #ffffff;
}

.news-tabs {
    display: flex;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.news-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.news-tab:hover {
    background: rgba(74, 201, 255, 0.1);
}

.news-tab.active {
    background: var(--primary);
    color: #ffffff;
}

.news-tab.active:hover {
    background: #0052a3;
}

.sub-tab-panel {
    margin-top: 0.75rem;
}

.vote-row {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.vote-btn {
    border: 1px solid var(--card-border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.vote-btn:hover:not(:disabled) {
    background: var(--card-hover);
}

.vote-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.vote-btn-active[data-type="up"] {
    border-color: var(--primary) !important;
    border-width: 2px !important;
    background: var(--surface) !important;
    color: var(--text) !important;
}

.vote-btn-active[data-type="up"]:hover:not(:disabled) {
    background: rgba(74, 201, 255, 0.1) !important;
}

.vote-btn-active[data-type="down"] {
    border-color: var(--negative) !important;
    border-width: 2px !important;
    background: var(--surface) !important;
    color: var(--text) !important;
}

.vote-btn-active[data-type="down"]:hover:not(:disabled) {
    background: rgba(255, 71, 87, 0.1) !important;
}

.vote-btn-small {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    gap: 0.15rem;
}

.vote-count {
    min-width: 2ch;
    font-weight: 600;
    margin-left: 0.15rem;
}

.post-card-clickable {
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.post-card-clickable:hover {
    background: var(--card-hover);
    transform: translateY(-1px);
}

.post-card-clickable:active {
    transform: translateY(0);
}

/* 댓글 아이템 스타일 */
.comment-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease;
}

.comment-item:hover {
    background: var(--card-hover);
}

.comment-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    flex-shrink: 0;
}

.comment-text {
    font-size: 0.9rem;
    color: var(--text);
    flex: 1;
    min-width: 0;
    word-break: break-word;
    line-height: 1.4;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: auto;
}

.comment-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    gap: 0.75rem;
}

.comment-vote-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.comment-edit-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.comment-edit-btn,
.comment-delete-btn {
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--card-border);
    background: var(--surface);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.comment-edit-btn:hover {
    background: rgba(74, 201, 255, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.comment-delete-btn:hover {
    background: rgba(255, 71, 87, 0.1);
    color: var(--negative);
    border-color: var(--negative);
}

.comment-edited {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 0.25rem;
}

.mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

.mention-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    transition: background-color 0.2s ease;
}

.mention-item:hover,
.mention-item.selected {
    background: var(--card-hover);
    color: var(--primary);
}

.mention-tag {
    color: var(--primary);
    font-weight: 600;
    background: rgba(74, 201, 255, 0.1);
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    right: 1rem;
    bottom: calc(var(--bottom-nav-height) + 0.75rem);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    font-size: 2rem;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1500;
}

.fab:hover,
.fab:focus-visible {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

@media (min-width: 1025px) {
    .fab {
        bottom: 1rem;
    }
}

.auth-panel {
    position: relative;
    background: #f8f9fa;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    display: none;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-panel[aria-hidden="false"] {
    display: flex;
}

.auth-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.auth-close:hover,
.auth-close:focus-visible {
    color: var(--text);
}

.auth-header {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    padding: 0.3rem;
    gap: 0.3rem;
}

.auth-tab {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
}

.auth-tab.active {
    background: rgba(74, 201, 255, 0.16);
    color: var(--primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-field label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-field input {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: var(--surface);
    color: var(--text);
}

.auth-message {
    min-height: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.auth-message.error {
    color: var(--negative);
}

.auth-message.success {
    color: var(--positive);
}

.content-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* 매매일지 페이지 전체화면 스타일 (대시보드와 동일) */
main.toss-main {
    padding: 20px;
    background-color: #ffffff;
    min-height: 100vh;
    box-sizing: border-box;
    max-width: 100% !important;
    overflow: hidden;
    height: 100vh;
}

@media (min-width: 1025px) {
    main.toss-main {
        padding-left: 240px;
        padding-right: 20px;
        overflow: hidden;
        height: 100vh;
    }
}

.toss-dashboard-container {
    position: relative;
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 20px;
    box-sizing: border-box;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#trading.content-section {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

#trading .section-header {
    padding: 0 0 1rem 0;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

#trading .trading-grid {
    padding: 0;
    box-sizing: border-box;
    flex: 1;
    display: grid;
    grid-template-columns: 3fr 3fr 1.2fr;
    gap: 1rem;
    overflow: hidden;
    min-height: 0;
}

@media (max-width: 1200px) {
    #trading .trading-grid {
        grid-template-columns: 2.5fr 1.5fr;
    }
    
    #trading .trading-grid .trading-section:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    #trading .trading-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    #trading .trading-grid {
        grid-template-columns: 2.5fr 1.5fr;
    }
    
    #trading .trading-grid .trading-section:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    #trading .trading-grid {
        grid-template-columns: 1fr;
    }
    
    #trading.content-section {
        height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    }
}

/* 커뮤니티 섹션 하단 여백 제거 */
#community.content-section {
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.8rem;
}

.section-header p {
    margin: 0;
    color: var(--text-muted);
    max-width: 600px;
}

.section-action {
    align-self: center;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.section-action:hover,
.section-action:focus-visible {
    color: #fff;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8f9fa;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notice-card {
    border: 2px solid #ff5757 !important;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* 뉴스 피드 카드 스타일 - 테마별 반대 색상 */
.card-grid .card {
    background: var(--news-card-bg);
    color: var(--news-card-text);
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-grid .card h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--news-card-text);
    line-height: 1.4;
}

.card-grid .card p {
    margin: 0;
    color: var(--news-card-text-muted);
    line-height: 1.5;
    font-size: 0.9rem;
}

.card-grid .card footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--news-card-text-muted);
}

.card-grid .card .news-link {
    color: var(--news-card-text);
}

.card-grid .card .news-link:hover,
.card-grid .card .news-link:focus-visible {
    color: var(--primary);
}

.card-grid .card .news-meta {
    color: var(--news-card-text-muted);
}

.card-grid .card .badge {
    background: rgba(74, 201, 255, 0.12);
    color: var(--primary);
}

.card-grid .card .news-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    display: block;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.card h3 {
    margin: 0;
    font-size: 1.2rem;
}

.card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.card footer {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.symbol-cell {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.symbol-cell span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-form input {
    flex: 1 1 220px;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: var(--surface);
    color: var(--text);
}

.search-form button {
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(140, 91, 255, 0.3);
}

.search-form button:hover,
.search-form button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(140, 91, 255, 0.4);
}

.search-results {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 0.75rem 0;
    max-height: 240px;
    overflow-y: auto;
}

.search-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item strong {
    font-size: 0.95rem;
}

.search-result-item span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-result-item .search-meta {
    font-size: 0.75rem;
    text-align: right;
}

.search-result-item:hover,
.search-result-item:focus-visible {
    background: rgba(74, 201, 255, 0.12);
}

.search-loading,
.search-error,
.search-empty {
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.market-detail-card {
    background: #f8f9fa;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.detail-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.detail-price span:first-child {
    font-size: 1.6rem;
    font-weight: 600;
}

.detail-change {
    font-size: 0.95rem;
}

.detail-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.detail-stats p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-stats strong {
    font-size: 1.1rem;
}

.chart-container {
    position: relative;
    height: 320px;
}

.chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
}

.range-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.range-control label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.range-control input[type="range"] {
    width: min(260px, 40vw);
    accent-color: var(--primary);
}

.ma-legend {
    display: flex;
    gap: 0.9rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ma-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.ma-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.ma-dot.ma-5 {
    background: #58f28a;
}

.ma-dot.ma-20 {
    background: #ffa034;
}

.ma-dot.ma-40 {
    background: #b474ff;
}

.ma-dot.ma-60 {
    background: #f2d45f;
}

.chart-insights {
    display: grid;
    gap: 1.25rem;
}

.recent-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.recent-table {
    min-width: 480px;
}

.recent-table thead {
    background: rgba(0, 0, 0, 0.03);
}

.ma-status {
    padding: 1.1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(74, 201, 255, 0.3);
    background: linear-gradient(135deg, rgba(74, 201, 255, 0.15), rgba(140, 91, 255, 0.1));
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.6;
}

.news-link {
    display: inline-block;
    color: inherit;
}

.news-link:hover,
.news-link:focus-visible {
    color: var(--primary);
}

.news-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(74, 201, 255, 0.12);
    color: var(--primary);
}

.market-overview {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 1.5rem;
}

.market-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.market-card {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    cursor: pointer;
    transition: border 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.market-card header {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.market-card header span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.market-card-price {
    font-size: 1.4rem;
    font-weight: 600;
}

.market-card-change {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.market-card:hover,
.market-card:focus-visible {
    border-color: rgba(74, 201, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 201, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.market-card.active {
    border-color: rgba(74, 201, 255, 0.7);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    text-align: left;
    padding: 0.75rem 1rem;
}

thead {
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--card-border);
}

tbody tr+tr {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.change-positive {
    color: var(--positive);
}

.change-negative {
    color: var(--negative);
}

.market-note {
    font-size: 0.9rem;
    color: var(--text);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(74, 201, 255, 0.15), rgba(140, 91, 255, 0.1));
    border: 1px solid rgba(74, 201, 255, 0.2);
}

.tools-grid .card {
    min-height: 220px;
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(140, 91, 255, 0.18);
    color: var(--text);
    font-size: 0.85rem;
}

.policies-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.recommendation-card {
    background: #f8f9fa;
    border-radius: 22px;
    border: 1px solid var(--card-border);
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.recommendation-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recommendation-card strong {
    font-size: 1.2rem;
}

.recommendation-meta {
    display: flex;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.site-footer {
    display: none !important;
}

.footer-brand {
    margin: 0 0 0.35rem;
    font-weight: 600;
}

.footer-copy {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.site-footer nav {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chat-widget {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 60px;
    height: 60px;
    background: var(--card);
    border-radius: 50%;
    border: 2px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.chat-widget:hover,
.chat-widget:not(.collapsed) {
    width: clamp(260px, 22vw, 360px);
    height: auto;
    border-radius: 24px;
    cursor: default;
}

.chat-widget:not(:hover).collapsed .chat-widget__body,
.chat-widget:not(:hover).collapsed .chat-widget__form {
    display: none;
}

.chat-widget:not(:hover):not(.expanded) .chat-widget__body,
.chat-widget:not(:hover):not(.expanded) .chat-widget__form {
    display: none;
}

.chat-widget:not(:hover):not(.expanded) .chat-widget__header {
    justify-content: center;
    padding: 0;
    min-height: 60px;
}

.chat-widget:not(:hover):not(.expanded) .chat-widget__title,
.chat-widget:not(:hover):not(.expanded) .chat-widget__subtitle,
.chat-widget:not(:hover):not(.expanded) .chat-widget__toggle {
    display: none;
}

.chat-widget:not(:hover):not(.expanded) .chat-widget__header::after {
    content: "💬";
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.chat-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.35rem;
    background: var(--chat-header-bg);
    color: var(--chat-header-text);
    gap: 1rem;
}

.chat-widget__header .chat-widget__title,
.chat-widget__header .chat-widget__subtitle {
    color: var(--chat-header-text);
}

.chat-widget__header .chat-widget__subtitle {
    opacity: 0.9;
}

.chat-widget__header .chat-widget__toggle {
    color: var(--chat-header-text);
}

.chat-widget__title {
    margin: 0;
    font-weight: 600;
}

.chat-widget__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chat-widget__toggle {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

.chat-widget__body {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1.2rem 1.35rem;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg);
}

.chat-message {
    display: inline-flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-message__text {
    margin: 0;
}

.chat-message__sources {
    margin-top: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chat-message__sources a {
    color: var(--primary);
    text-decoration: none;
}

.chat-message__sources a:hover,
.chat-message__sources a:focus {
    text-decoration: underline;
}

.empty-state {
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px dashed var(--card-border);
    background: var(--card);
    color: var(--text-muted);
    text-align: center;
    font-size: 0.95rem;
}

.empty-cell {
    text-align: center;
    padding: 1.2rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.chat-message.bot {
    align-self: flex-start;
    max-width: 90%;
    background: var(--surface);
    border: 1px solid var(--card-border);
    padding: 0.75rem 1rem;
    border-radius: 18px 18px 18px 6px;
    box-shadow: var(--shadow-soft);
}

.chat-message.user {
    align-self: flex-end;
    max-width: 90%;
    background: var(--chat-user-bg);
    border: 1px solid var(--chat-user-border);
    padding: 0.75rem 1rem;
    border-radius: 18px 18px 6px 18px;
}

.chat-widget__form {
    display: flex;
    gap: 0.8rem;
    padding: 1rem 1.35rem 1.3rem;
    background: var(--card);
    border-top: 1px solid var(--card-border);
}

.chat-widget__form input {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: var(--surface);
    color: var(--text);
}

.chat-widget__form button {
    border: none;
    border-radius: 14px;
    padding: 0.7rem 1.2rem;
    background: var(--chat-button-bg);
    color: var(--chat-button-text);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-widget__form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: var(--chat-button-hover, #0052a3);
    opacity: 0.9;
}

.chat-widget.collapsed .chat-widget__body,
.chat-widget.collapsed .chat-widget__form {
    display: none;
}

/* 매매내역 스타일 */
.trading-summary {
    margin-bottom: 2rem;
}

.summary-card {
    background: linear-gradient(135deg, #4ac9ff 0%, #8c5bff 100%);
    color: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.summary-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

.summary-amount {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.trading-grid {
    display: grid;
    grid-template-columns: 3fr 3fr 1.2fr;
    gap: 1rem;
    width: 100%;
}

@media (max-width: 1200px) {
    .trading-grid {
        grid-template-columns: 2.5fr 1.5fr;
    }
    
    /* 습관 분석을 두 번째 줄로 이동 */
    .trading-grid .trading-section:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .trading-grid {
        grid-template-columns: 1fr;
    }
}

.trading-sections {
    display: grid;
    gap: 2.5rem;
}

.trading-section {
    background: var(--card);
    border-radius: 20px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.trading-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--card-border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.trading-section-header:hover {
    background: var(--card);
}

.trading-section-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text);
}


.toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.trading-section-content {
    padding: 2rem;
    max-height: 5000px;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    overflow: visible;
    opacity: 1;
    display: flex;
    flex-direction: column;
}

.trading-section.trading-section-habit {
    overflow: visible;
}

.trading-section.trading-section-habit .trading-section-content {
    overflow: visible;
    max-height: none;
    height: auto;
    padding: 1.25rem 1.5rem;
}

.trading-section.trading-section-habit .habit-analysis-container {
    overflow: visible;
    height: auto;
    max-height: none;
}

.trading-section.collapsed .trading-section-content {
    max-height: 0;
    padding: 0 2rem;
    opacity: 0;
}

.trading-form-container {
    margin-bottom: 1.5rem;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 1;
}

.trading-form-container.collapsed {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
}

.trading-form {
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.cancel-btn {
    padding: 0.65rem 1.5rem;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: var(--card);
    border-color: var(--text-muted);
}

.new-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--new-button-bg, var(--primary));
    border-radius: 8px;
    background: var(--new-button-bg, var(--primary));
    color: var(--new-button-text, #ffffff);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-btn:hover {
    background: var(--new-button-hover, #0052a3);
    border-color: var(--new-button-hover, #3ab0e0);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 습관 분석 컴포넌트 스타일 */
.habit-analysis-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.habit-analysis-content {
    min-height: 60px;
    overflow: visible;
    max-height: none;
}

/* 습관 분석 기간 선택 드롭다운 */
.habit-period-selector {
    position: relative;
}

.period-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 80px;
    justify-content: space-between;
}

.period-dropdown-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.period-dropdown-menu.active .dropdown-arrow {
    transform: rotate(180deg);
}

.period-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.period-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.period-option {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease;
}

.period-option:hover {
    background: var(--surface-hover);
}

.period-option:first-child {
    border-radius: 6px 6px 0 0;
}

.period-option:last-child {
    border-radius: 0 0 6px 6px;
}

.period-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.period-dropdown-menu::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 3px;
}

.period-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.period-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 사이드 패널 모달 스타일 */
.side-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.side-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: var(--card);
    box-shadow: var(--shadow-soft);
    z-index: 2001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-modal.active {
    transform: translateX(0);
}

.side-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
    background: var(--surface);
    flex-shrink: 0;
}

.side-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.side-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.side-modal-close:hover {
    background: #f8f9fa;
    color: var(--text);
}

.side-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    padding-bottom: calc(2rem + var(--bottom-nav-height));
}

.side-modal-body .trading-form {
    max-width: 100%;
}

.side-modal-body .form-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.side-modal-body .form-field textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.side-modal-body .form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 201, 255, 0.1);
}

.form-field-full {
    grid-column: 1 / -1;
}

/* 이미지 업로드 스타일 */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-upload-input {
    display: none;
}

.image-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    border: 2px dashed var(--card-border);
    border-radius: 12px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-upload-label:hover {
    border-color: var(--primary);
    background: rgba(74, 201, 255, 0.05);
}

.upload-icon {
    font-size: 2rem;
}

.upload-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.image-preview {
    display: none;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.image-preview.active {
    display: block;
}

.image-preview img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.image-remove-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--negative);
    border-radius: 8px;
    background: var(--surface);
    color: var(--negative);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.image-remove-btn:hover {
    background: rgba(255, 71, 87, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.form-field input,
.form-field select {
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 201, 255, 0.1);
}

.trading-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trading-list-scroll {
    display: block;
    max-height: 300px;
    overflow: hidden;
    flex: 0 1 auto;
    min-height: 0;
}

.trading-list-scroll.expanded {
    max-height: none;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* 매매일지 페이지에서는 높이 제한 없이 flex 사용 */
#trading .trading-list-scroll {
    max-height: none;
    overflow-y: auto;
    flex: 1 1 auto;
}

.trading-list-scroll .empty-trading-list {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.trading-list-scroll::-webkit-scrollbar {
    width: 8px;
}

.trading-list-scroll::-webkit-scrollbar-track {
    background: var(--card);
    border-radius: 4px;
}

.trading-list-scroll::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
    opacity: 0.5;
}

.trading-list-scroll::-webkit-scrollbar-thumb:hover {
    opacity: 0.7;
}

.trading-item {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trading-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.trading-item-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-clickable {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.profile-clickable:hover {
    background-color: rgba(74, 201, 255, 0.1);
    transform: translateY(-2px);
}

.profile-value {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
}

#me .trading-item-label {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
}

#me .trading-item-value {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
}

.trading-item-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.trading-item-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}

.trading-item-value.profit-positive {
    color: var(--positive);
    font-weight: 600;
}

.trading-item-value.profit-negative {
    color: var(--negative);
    font-weight: 600;
}

.trading-item-result {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.trading-item-result.win {
    background: rgba(38, 222, 129, 0.15);
    color: var(--positive);
}

.trading-item-result.draw {
    background: rgba(168, 178, 209, 0.15);
    color: var(--text-muted);
}

.trading-item-result.loss {
    background: rgba(255, 71, 87, 0.15);
    color: var(--negative);
}

.trading-item-position {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.trading-item-position.long {
    background: rgba(74, 201, 255, 0.15);
    color: var(--primary);
}

.trading-item-position.short {
    background: rgba(140, 91, 255, 0.15);
    color: var(--accent);
}

.trading-item-position.swing {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.trading-item-position.scalping {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.trading-item-position.day {
    background: rgba(156, 39, 176, 0.15);
    color: #9c27b0;
}

.trading-item-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.trading-item-actions button {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.trading-item-actions button:hover {
    background: rgba(255, 71, 87, 0.1);
    color: var(--negative);
}

.trading-item-field-full {
    grid-column: 1 / -1;
}

.trading-item-chart {
    grid-column: 1 / -1;
    margin: 0.5rem 0;
}

.trading-item-chart img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trading-item-chart img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.empty-trading-list {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    background: #ffffff;
    border-radius: 12px;
    border: 1px dashed var(--card-border);
}

/* 원형 차트 스타일 */
.profit-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.profit-charts-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.profit-charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.profit-charts-row-center {
    justify-content: center;
    grid-template-columns: 1fr;
    max-width: 300px;
    margin: 0 auto;
}

.profit-chart-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.more-detail-btn {
    position: absolute;
    top: -1.8rem;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background: var(--surface);
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
}

.more-detail-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

.profit-detail-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.profit-detail-list::-webkit-scrollbar {
    width: 6px;
}

.profit-detail-list::-webkit-scrollbar-track {
    background: transparent;
}

.profit-detail-list::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

.profit-detail-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.profit-chart {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .profit-charts-grid {
        gap: 1rem;
    }

    .profit-charts-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .profit-charts-row-center {
        max-width: 100%;
    }

    .profit-chart {
        width: 110px;
        height: 110px;
    }

    .profit-chart-wrapper {
        gap: 0.5rem;
    }
}

.profit-pie-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.profit-pie-bg {
    stroke: #e0e0e0;
}

.profit-pie-slice {
    fill: none;
    stroke-width: 15;
    stroke-linecap: round;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.profit-pie-slice:hover {
    opacity: 0.8;
}

.profit-chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    width: 100%;
}

.profit-chart-center .summary-amount {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
}

.profit-summary-center {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.profit-center-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.profit-center-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profit-center-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
}

.profit-center-value.profit-positive {
    color: var(--primary);
}

.profit-center-value.profit-negative {
    color: #ff5757;
}

.profit-legend-container {
    position: relative;
    width: 100%;
    max-width: 270px;
    min-height: 220px;
}

.profit-legend {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    font-size: 0.75rem;
    overflow: visible;
    min-height: 220px;
}

.profit-legend::-webkit-scrollbar {
    width: 4px;
    /* Chrome/Safari */
}

.profit-legend::-webkit-scrollbar-track {
    background: transparent;
}

.profit-legend::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 2px;
}

.profit-legend::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 총 수익금 요약 리스트 */
.profit-summary-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.profit-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    transition: all 0.2s ease;
}

.profit-summary-item:hover {
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profit-summary-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.profit-summary-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.profit-summary-value.profit-positive {
    color: var(--primary);
}

.profit-summary-value.profit-negative {
    color: #ff5757;
}

.profit-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: #ffffff;
    transition: background 0.2s ease;
}

.profit-legend-item:hover {
    background: #f8f9fa;
}

.profit-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.profit-legend-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.profit-legend-stock {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.profit-legend-amount {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profit-legend-percent {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    min-width: 50px;
    text-align: right;
}

@media (max-width: 1024px) {
    .chat-widget {
        width: clamp(240px, 60vw, 320px);
        right: 1.5rem;
        bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .site-header {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem 4vw;
    }

    .brand-name {
        font-size: 1.1rem;
    }

    /* 모바일에서는 로고를 좌측 정렬 */
    .site-header .brand {
        grid-column: 1;
        justify-self: start;
    }


    .brand-tagline {
        font-size: 0.75rem;
    }

    .header-actions {
        width: auto;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .theme-toggle {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }

    .auth-trigger {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .site-nav {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .cta-button {
        align-self: flex-end;
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .auth-status {
        width: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    main {
        padding: 1.5rem 4vw 4rem;
        gap: 2.5rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-header p {
        font-size: 0.9rem;
    }

    .highlight-card {
        padding: 1.5rem;
    }

    .highlight-layout {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .card h3 {
        font-size: 1.1rem;
    }

    .card p {
        font-size: 0.9rem;
    }

    .card-grid .card .news-image {
        height: 180px;
        margin-bottom: 0.875rem;
    }

    .auth-panel {
        padding: 1.5rem;
    }

    .market-overview-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-price {
        align-items: flex-start;
    }

    .chart-container {
        height: 280px;
    }

    .site-footer {
        display: none !important;
    }

    .chat-widget {
        width: 60px;
        height: 60px;
        right: 1rem;
        bottom: 1rem;
    }

    .chat-widget.expanded,
    .chat-widget:not(.collapsed) {
        width: calc(100vw - 2rem);
        max-width: 360px;
        height: auto;
    }

    .chat-widget__header {
        padding: 1rem 1.25rem;
    }

    .chat-widget__body {
        padding: 1rem 1.25rem;
        max-height: 280px;
    }

    .chat-widget__form {
        padding: 0.875rem 1.25rem;
    }

    .chat-widget__form button {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .trading-section-header {
        padding: 1.25rem 1.5rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .trading-section-header h3 {
        font-size: 1.25rem;
    }

    .trading-section-content {
        padding: 1.5rem;
    }

    .new-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }

    .trading-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .trading-item-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .summary-amount {
        font-size: 1.75rem;
    }

    .trading-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        justify-items: stretch;
    }

    .trading-section {
        width: 100%;
    }

    .profit-chart {
        width: 200px;
        height: 200px;
    }

    .profit-chart-center .summary-amount {
        font-size: 1.25rem;
    }

    .profit-legend {
        gap: 0.75rem;
        max-height: calc(3 * 3.5rem + 2 * 0.75rem);
        /* 3개 항목(각 약 3.5rem) + 2개 gap */
        overflow-y: auto;
        overflow-x: hidden;
    }

    .side-modal {
        width: 100vw;
        max-width: 100vw;
    }

    .side-modal-header {
        padding: 1.25rem 1.5rem;
    }

    .side-modal-header h2 {
        font-size: 1.25rem;
    }

    .side-modal-body {
        padding: 1.5rem;
    }

    .search-modal {
        width: 95%;
        max-height: 90vh;
    }

    .search-modal-header {
        padding: 1.25rem 1.5rem;
    }

    .search-modal-header h3 {
        font-size: 1.25rem;
    }

    .search-modal-body {
        padding: 1.5rem;
    }

    .search-results-list {
        max-height: 300px;
    }

    .form-field input,
    .form-field select,
    .form-field textarea {
        padding: 0.65rem;
        font-size: 0.9rem;
    }

    .cancel-btn,
    .cta-button {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 0.875rem 4vw;
    }

    .brand-mark {
        font-size: 1.5rem;
    }

    .brand-name {
        font-size: 1rem;
    }

    main {
        padding: 1.25rem 4vw 4rem;
        gap: 2rem;
    }

    .section-header h2 {
        font-size: 1.35rem;
    }

    .highlight-card {
        padding: 1.25rem;
    }

    .card {
        padding: 1rem;
    }

    .trading-section-header {
        padding: 1rem 1.25rem;
    }

    .trading-section-content {
        padding: 1.25rem;
    }

    .trading-list-scroll {
        max-height: 250px;
    }

    .profit-chart {
        width: 180px;
        height: 180px;
    }

    .profit-chart-center .summary-amount {
        font-size: 1.1rem;
    }

    .chat-widget {
        width: 60px;
        height: 60px;
        right: 0.5rem;
        bottom: 0.5rem;
    }

    .chat-widget.expanded,
    .chat-widget:not(.collapsed) {
        width: calc(100vw - 1rem);
        height: auto;
    }

    .card-grid .card .news-image {
        height: 160px;
        margin-bottom: 0.75rem;
    }
}

/* 로그인 필요 오버레이 */
#trading {
    position: relative;
}

#community {
    position: relative;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 커뮤니티 페이지의 main 하단 패딩 조정 (FAB 버튼 고려) */
body:has(#community) main {
    padding-bottom: 0;
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

@media (min-width: 1025px) {
    body:has(#community) main {
        padding-bottom: 0;
        height: 100vh;
    }
}

/* 커뮤니티 리스트는 스크롤 가능하도록 */
#community .trading-list-scroll {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: calc(var(--bottom-nav-height) + 3.5rem);
    /* 하단 네비게이션 바 + FAB 버튼 공간 */
}

#community .trading-list-scroll .card {
    margin-bottom: 0;
}

#community .trading-list-scroll .card:not(:last-child) {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    #community .trading-list-scroll {
        max-height: calc(100vh - 150px);
        gap: 0.75rem;
        padding-bottom: calc(var(--bottom-nav-height) + 3.5rem);
        /* 하단 네비게이션 바 + FAB 버튼 공간 */
    }

    #community .trading-list-scroll .card:not(:last-child) {
        margin-bottom: 0.75rem;
    }
}

#me {
    position: relative;
}

/* 캘린더 스타일 */
.calendar-container {
    max-width: 900px;
    margin: 1.5rem auto;
    background: var(--card);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

/* 컴포넌트 내부 캘린더 스타일 */
.trading-section .calendar-container {
    max-width: 100%;
    margin: 0;
    padding: 0.5rem;
    box-shadow: none;
    background: transparent;
}

.trading-section .calendar-header {
    margin-bottom: 0.5rem;
}

.trading-section .calendar-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.trading-section .calendar-nav-btn {
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
    border-radius: 4px;
}

.trading-section .calendar-weekdays {
    gap: 0.2rem;
    margin-bottom: 0.2rem;
}

.trading-section .calendar-weekday {
    padding: 0.15rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.trading-section .calendar-days {
    gap: 0.05rem;
}

.trading-section .calendar-day {
    font-size: 0.75rem;
    padding: 0.15rem;
    min-height: 32px;
    max-height: 32px;
    border-radius: 4px;
    aspect-ratio: 1;
}

.trading-section .calendar-day-number {
    font-size: 0.75rem;
    margin-bottom: 0.08rem;
    line-height: 1;
}

.trading-section .calendar-day-trades {
    font-size: 0.55rem;
    padding: 0.08rem 0.12rem;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.calendar-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.calendar-nav-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: #0052a3;
    transform: scale(1.05);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.5rem;
    font-size: 0.9rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.2s ease;
    min-height: 75px;
    max-height: 75px;
    overflow: hidden;
}

.calendar-day:hover {
    background: rgba(74, 201, 255, 0.1);
    border-color: var(--primary);
}

.calendar-day-other-month {
    opacity: 0.4;
}

.calendar-day-today {
    background: rgba(74, 201, 255, 0.15);
    border-color: var(--primary);
    border-width: 2px;
}

.calendar-day-has-trade {
    background: rgba(74, 201, 255, 0.2);
    border-color: var(--primary);
}

.calendar-day-number {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.25rem;
    flex-shrink: 0;
    line-height: 1.2;
}

.calendar-day-trades {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    margin-top: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    max-height: 1.2em;
    line-height: 1.2;
    flex-shrink: 0;
}

@media (min-width: 1025px) {
    .calendar-container {
        max-width: 800px;
        padding: 1.25rem;
        margin: 1rem auto;
    }

    .calendar-header {
        margin-bottom: 1rem;
    }

    .calendar-header h3 {
        font-size: 1.25rem;
    }

    .calendar-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .calendar-weekdays {
        gap: 0.35rem;
        margin-bottom: 0.35rem;
    }

    .calendar-weekday {
        padding: 0.4rem;
        font-size: 0.85rem;
    }

    .calendar-days {
        gap: 0.35rem;
    }

    .calendar-day {
        min-height: 70px;
        max-height: 70px;
        padding: 0.4rem;
        aspect-ratio: 1;
        overflow: hidden;
    }

    .calendar-day-number {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .calendar-day-trades {
        font-size: 0.7rem;
        line-height: 1.2;
    }
}

@media (max-width: 768px) {
    .calendar-container {
        padding: 0.75rem;
        margin: 0.5rem;
        border-radius: 12px;
    }

    .calendar-header {
        margin-bottom: 1rem;
    }

    .calendar-header h3 {
        font-size: 1.1rem;
    }

    .calendar-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    .calendar-weekdays {
        gap: 0.25rem;
        margin-bottom: 0.25rem;
    }

    .calendar-weekday {
        padding: 0.35rem 0.25rem;
        font-size: 0.8rem;
    }

    .calendar-days {
        gap: 0.25rem;
    }

    .calendar-day {
        min-height: 50px;
        max-height: 50px;
        padding: 0.25rem;
        aspect-ratio: 1;
        overflow: hidden;
    }

    .calendar-day-number {
        font-size: 0.85rem;
        margin-bottom: 0.15rem;
    }

    .calendar-day-trades {
        font-size: 0.6rem;
        line-height: 1.2;
    }
}

.login-block-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.45));
    backdrop-filter: blur(2px);
    z-index: 2000;
}

.login-block-overlay.active {
    display: flex;
}

.login-block-content {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem 2.25rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
    max-width: 420px;
    width: 88%;
}

.login-block-content h3 {
    margin: 0 0 0.5rem;
}

.login-block-content p {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
}

.login-block-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    background: var(--auth-button-bg);
    color: var(--auth-button-text);
    border: 1px solid var(--auth-button-bg);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.login-block-button:hover,
.login-block-button:focus-visible {
    background: var(--auth-button-hover);
    border-color: var(--auth-button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Trading section compact adjustments to reduce scrolling */
#trading .trading-grid {
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: 0;
    grid-template-columns: 3fr 3fr 1.2fr;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

@media (max-width: 1200px) {
    #trading .trading-grid {
        grid-template-columns: 2.5fr 1.5fr;
    }
}

#trading .trading-section-header {
    padding: 1rem 1.25rem;
}

#trading .trading-section-header h3 {
    font-size: 1.2rem;
}

#trading .trading-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

#trading .trading-section-header {
    flex-shrink: 0;
}

#trading .trading-section-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

#trading .trading-list-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -ms-overflow-style: auto;
    scrollbar-width: thin;
}

#trading .trading-list-scroll::-webkit-scrollbar {
    display: block;
    width: 6px;
}

#trading .trading-list-scroll::-webkit-scrollbar-track {
    background: transparent;
}

#trading .trading-list-scroll::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

#trading .trading-list-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

#trading .profit-charts-grid {
    height: 100%;
    overflow: hidden;
}

#trading .habit-analysis-container {
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#trading .habit-analysis-content {
    overflow: visible;
    max-height: none;
}

#trading .calendar-container {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}

#trading .calendar-header {
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

#trading .calendar-header h3 {
    font-size: 0.95rem;
}

#trading .calendar-nav-btn {
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
    border-radius: 4px;
}

#trading .calendar-weekdays {
    gap: 0.2rem;
    margin-bottom: 0.2rem;
    flex-shrink: 0;
}

#trading .calendar-weekday {
    padding: 0.2rem;
    font-size: 0.7rem;
}

#trading .calendar-days {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    gap: 0.2rem;
    -ms-overflow-style: auto;
    scrollbar-width: thin;
}

#trading .calendar-days::-webkit-scrollbar {
    display: block;
    width: 4px;
}

#trading .calendar-days::-webkit-scrollbar-track {
    background: transparent;
}

#trading .calendar-days::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 2px;
}

#trading .calendar-day {
    min-height: 28px;
    max-height: 28px;
    padding: 0.15rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

#trading .calendar-day-number {
    font-size: 0.7rem;
    margin-bottom: 0.05rem;
    line-height: 1;
}

#trading .calendar-day-trades {
    font-size: 0.5rem;
    padding: 0.05rem 0.1rem;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#trading .profit-chart-container {
    gap: 1rem;
}

#trading .profit-chart {
    width: 220px;
    height: 220px;
}

#trading .profit-chart-center .summary-amount {
    font-size: 1.4rem;
}

#trading .profit-legend {
    max-width: 240px;
    gap: 0.5rem;
    max-height: calc(3 * 3.5rem + 2 * 0.5rem);
    /* 3개 항목(각 약 3.5rem) + 2개 gap */
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    /* IE/Edge */
    scrollbar-width: thin;
    /* Firefox */
}

#trading .profit-legend::-webkit-scrollbar {
    width: 4px;
    /* Chrome/Safari */
}

#trading .profit-legend::-webkit-scrollbar-track {
    background: transparent;
}

#trading .profit-legend::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 2px;
}

#trading .profit-legend::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.more-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    flex-shrink: 0;
}

.more-btn:hover,
.more-btn:focus-visible {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 매매내역 테이블 스타일 */
.trading-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.trading-table thead {
    background: var(--card);
    border-bottom: 2px solid var(--card-border);
}

.trading-table th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
}

.trading-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--text);
}

.trading-table tbody tr:hover {
    background: var(--card);
}

.trading-table tbody tr:last-child td {
    border-bottom: none;
}

.trading-position-badge,
.trading-result-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.trading-position-badge.long {
    background: rgba(74, 201, 255, 0.2);
    color: var(--primary);
}

.trading-position-badge.short {
    background: rgba(255, 87, 87, 0.2);
    color: #ff5757;
}

.trading-position-badge.swing {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.trading-position-badge.scalping {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.trading-position-badge.day {
    background: rgba(156, 39, 176, 0.2);
    color: #9c27b0;
}

.trading-result-badge.win {
    background: rgba(74, 201, 255, 0.2);
    color: var(--primary);
}

.trading-result-badge.draw {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

.trading-result-badge.loss {
    background: rgba(255, 87, 87, 0.2);
    color: #ff5757;
}

.trading-profit {
    font-weight: 600;
}

.trading-profit.profit-positive {
    color: var(--primary);
}

.trading-profit.profit-negative {
    color: #ff5757;
}

.detail-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.detail-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* 매매내역 상세 모달 스타일 */
.trading-detail-field {
    margin-bottom: 1.5rem;
}

.trading-detail-field label {
    display: block;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.trading-detail-field>div {
    color: var(--text);
    font-size: 1rem;
}

.trading-detail-chart {
    margin: 1.5rem 0;
}

.trading-detail-chart h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.trading-detail-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.trading-detail-actions .edit-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trading-detail-actions .edit-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

.trading-detail-actions .delete-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #ff5757;
    border-radius: 8px;
    background: transparent;
    color: #ff5757;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trading-detail-actions .delete-btn:hover {
    background: #ff5757;
    color: #ffffff;
}

@media (max-width: 768px) {
    .trading-table {
        font-size: 0.8rem;
    }

    .trading-table th,
    .trading-table td {
        padding: 0.5rem 0.25rem;
    }

    .trading-table th:nth-child(1),
    .trading-table td:nth-child(1) {
        min-width: 80px;
    }

    .trading-table th:nth-child(2),
    .trading-table td:nth-child(2) {
        min-width: 60px;
    }

    .detail-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    /* 모바일에서 상세 모달 내용 스타일 */
    .trading-detail-field {
        margin-bottom: 1.25rem;
    }

    .trading-detail-field label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }

    .trading-detail-field>div {
        font-size: 0.95rem;
        word-break: break-word;
    }

    .trading-detail-chart {
        margin: 1.25rem 0;
    }

    .trading-detail-chart h4 {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }

    .trading-detail-chart img {
        max-width: 100%;
        height: auto;
    }

}

/* AI 분석 선택 버튼 스타일 */
.analysis-selection {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    min-height: 400px;
    padding: 2rem;
}

.analysis-btn-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.analysis-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 4rem;
    border: 2px solid var(--card-border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    min-height: 200px;
}

.analysis-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74, 201, 255, 0.3);
}

.analysis-btn-icon {
    font-size: 4rem;
    line-height: 1;
}

.analysis-btn-text {
    font-size: 1.3rem;
}

.help-btn {
    margin-top: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #0052a3 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 201, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.help-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.help-btn:hover::before {
    width: 300px;
    height: 300px;
}

.help-btn:hover {
    background: linear-gradient(135deg, #0052a3 0%, var(--primary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 201, 255, 0.4);
}

.help-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(74, 201, 255, 0.3);
}

.help-btn span {
    position: relative;
    z-index: 1;
}

.help-icon-wrapper {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 10;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    cursor: help;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.help-icon:hover {
    background: var(--primary-hover, #0052a3);
    transform: scale(1.1);
}

.help-icon::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 16px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: normal;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 280px;
    text-align: left;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: keep-all;
}

.help-icon::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--card-border);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1001;
}

.help-icon:hover::before,
.help-icon:hover::after {
    opacity: 1;
}

.analysis-result {
    margin-top: 2rem;
}

/* 분석 로딩 상태 */
.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 200px;
    padding: 2rem;
}

.analysis-loading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
}

/* 로딩 스피너 */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--card-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.back-btn {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--card);
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 768px) {
    .analysis-selection {
        flex-direction: column;
        gap: 1.5rem;
        min-height: auto;
        padding: 2rem 1rem;
    }

    .help-icon::before {
        width: 240px;
        font-size: 0.8rem;
        padding: 10px 14px;
        line-height: 1.5;
    }

    .analysis-btn {
        width: 100%;
        max-width: 300px;
        padding: 2rem;
        min-height: 150px;
    }

    .analysis-btn-icon {
        font-size: 3rem;
    }

    .analysis-btn-text {
        font-size: 1.1rem;
    }
}

/* 프로필 페이지 스타일 */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.profile-avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 600;
    flex-shrink: 0;
}

.profile-avatar-initial {
    line-height: 1;
}

.profile-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

.profile-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.profile-stat-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.profile-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: var(--primary);
    background: var(--surface);
}

.profile-stat-card.profile-clickable {
    cursor: pointer;
}

.profile-stat-content {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.profile-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.profile-menu-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-menu-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* 내정보 페이지 로그인/로그아웃 UI */
.profile-auth-section {
    margin-bottom: 0.5rem;
}

.profile-auth-trigger {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.profile-auth-trigger:hover {
    background: var(--primary-hover, var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-auth-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 8px;
}

.profile-auth-display-name {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.profile-auth-logout {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.profile-auth-logout:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
}

/* 로그아웃 및 회원탈퇴 버튼 */
.profile-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.profile-logout-btn {
    padding: 0;
    border: none;
    background: none;
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    text-decoration: none;
}

.profile-logout-btn:hover {
    color: var(--primary);
    text-decoration: underline;
}

.profile-delete-btn {
    padding: 0;
    border: none;
    background: none;
    color: #dc3545;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    text-decoration: none;
}

.profile-delete-btn:hover {
    color: #c82333;
    text-decoration: underline;
}

.profile-menu-item-email {
    cursor: default;
    background: var(--surface);
}

.profile-menu-item-email:hover {
    transform: none;
    border-color: var(--card-border);
    background: var(--surface);
}

.profile-email {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    margin-left: auto;
}

.profile-email:hover {
    color: var(--primary);
}

.profile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.profile-menu-item:hover {
    background: var(--card);
    border-color: var(--primary);
    transform: translateX(4px);
}

.profile-menu-text {
    flex: 1;
    font-weight: 500;
}

.profile-menu-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 300;
}

.profile-menu-item:hover .profile-menu-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

.profile-edit-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-edit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.profile-edit-item:hover {
    background: var(--card);
    border-color: var(--primary);
    transform: translateX(4px);
}

.profile-edit-text {
    flex: 1;
    font-weight: 500;
}

.profile-edit-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 300;
}

.profile-edit-item:hover .profile-edit-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .profile-header {
        margin-bottom: 1.5rem;
        gap: 0.75rem;
    }

    .profile-avatar-circle {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .profile-name {
        font-size: 1.25rem;
    }

    .profile-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .profile-stat-card {
        padding: 0.875rem;
    }

    .profile-stat-value {
        font-size: 1.25rem;
    }

    .profile-menu-card {
        padding: 1.25rem;
    }


    .profile-menu-item {
        padding: 0.875rem;
    }
}

/* 대시보드 스타일 */
.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-form-inline {
    display: flex;
    gap: 0.5rem;
}

.search-form-inline input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-size: 0.9rem;
    min-width: 200px;
}

.search-form-inline button {
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.search-modal-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.search-modal-btn:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 검색 모달 스타일 */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal-overlay[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

.search-modal {
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.search-modal-overlay[style*="display: flex"] .search-modal {
    transform: scale(1);
}

.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
    background: var(--surface);
}

.search-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.search-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-modal-close:hover {
    background: var(--card);
    color: var(--text);
}

.search-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-search-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.modal-search-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
}

.modal-search-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 201, 255, 0.1);
}

.modal-search-form button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.modal-search-form button:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.search-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.search-results-list .search-placeholder,
.search-results-list .search-loading,
.search-results-list .search-empty,
.search-results-list .search-error {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.search-result-item {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: var(--card);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-result-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-symbol {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.search-result-name {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.search-result-exchange {
    font-size: 0.8rem;
    color: var(--primary);
    background: rgba(74, 201, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.favorite-btn,
.interest-category-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--card);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.favorite-btn:hover,
.interest-category-btn:hover {
    background: var(--surface);
    transform: scale(1.1);
}

.favorite-btn.active {
    background: var(--negative);
}

.favorite-btn.active #favorite-icon {
    content: "❤️";
}

.chart-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--card);
    border-radius: 8px;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.time-interval-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.time-interval-selector label {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.interval-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--card-border);
    background: var(--bg);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 100px;
    transition: all 0.2s;
}

.interval-dropdown-btn:hover {
    background: var(--card);
    border-color: var(--primary);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.interval-dropdown-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.interval-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    z-index: 1000;
    min-width: 120px;
    max-height: 200px;
    overflow: hidden;
}

.interval-scroll-list {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.interval-scroll-list::-webkit-scrollbar {
    width: 6px;
}

.interval-scroll-list::-webkit-scrollbar-track {
    background: var(--bg);
}

.interval-scroll-list::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.interval-scroll-list::-webkit-scrollbar-thumb:hover {
    background: var(--text);
}

.interval-option {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: all 0.2s;
    border-bottom: 1px solid var(--card-border);
}

.interval-option:last-child {
    border-bottom: none;
}

.interval-option:hover {
    background: var(--surface);
}

.interval-option.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.period-selector {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--card-border);
    background: var(--bg);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.period-btn:hover {
    background: var(--card);
}

.period-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

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

.dashboard-chart-section {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
}

.chart-container-large {
    width: 100%;
    height: 400px;
    margin-bottom: 1rem;
    position: relative;
}

.chart-container-large #dashboard-chart {
    width: 100%;
    height: 100%;
}

.chart-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.price-info {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.price-change {
    font-size: 1rem;
    font-weight: normal;
}

.price-change.positive {
    color: var(--positive);
}

.price-change.negative {
    color: var(--negative);
}

.price-percent {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.chart-stats>div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chart-stats span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chart-stats strong {
    font-size: 1.1rem;
    color: var(--text);
}

.dashboard-orderbook-section {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
}

.dashboard-orderbook-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.orderbook-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.orderbook-sell,
.orderbook-buy {
    flex: 1;
}

.orderbook-header {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.orderbook-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
}

.orderbook-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.orderbook-sell .orderbook-item {
    background: rgba(255, 71, 87, 0.1);
}

.orderbook-buy .orderbook-item {
    background: rgba(38, 222, 129, 0.1);
}

.orderbook-price {
    font-weight: 600;
}

.orderbook-volume {
    color: var(--text-muted);
}

.orderbook-spread {
    text-align: center;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 6px;
    margin: 0.5rem 0;
}

.orderbook-spread #orderbook-spread-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text);
}

.orderbook-spread #orderbook-spread-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.interest-category-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.category-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text);
}

.favorite-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.favorite-stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--card);
    border-radius: 6px;
}

.favorite-stock-item .stock-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.favorite-stock-item .stock-symbol {
    font-weight: 600;
    font-size: 1rem;
}

.favorite-stock-item .stock-name {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.favorite-stock-item .remove-btn {
    padding: 0.25rem 0.75rem;
    background: var(--negative);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.sector-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--card);
    border-radius: 6px;
}

.sector-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sector-item label {
    cursor: pointer;
    flex: 1;
}

.notification-settings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--card);
    border-radius: 6px;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-item label {
    cursor: pointer;
    flex: 1;
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .chart-controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .time-interval-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .scroll-selector {
        width: 100%;
    }

    .chart-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================
   Toss Dashboard Redesign
   ========================================= */

/* Main Container */
.toss-main {
    padding: 20px;
    background-color: #ffffff;
    /* White background */
    min-height: 100vh;
    box-sizing: border-box;
    max-width: 100% !important;
    /* Override default max-width */
    overflow: hidden;
    height: 100vh;
}

@media (min-width: 1025px) {
    .toss-main {
        padding-left: 240px;
        padding-right: 20px;
        /* 사이드바(220px) + 여백(20px) */
    }
}

.toss-dashboard-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    margin-bottom: 10px;
}

.stock-info-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stock-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stock-title h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.stock-code {
    font-size: 18px;
    color: #6b7684;
    font-weight: 500;
}

.stock-badge {
    background-color: #e5e8eb;
    color: #6b7684;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.stock-price-large {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.current-price {
    font-size: 28px;
    font-weight: 700;
    color: #f04452;
    /* Red for up, blue for down (dynamic) */
}

.price-change,
.price-percent {
    font-size: 18px;
    font-weight: 500;
    color: #f04452;
}

.header-controls .search-btn {
    background: #f2f4f6;
    border: 1px solid #e5e8eb;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.header-controls .search-btn:hover {
    background-color: #e5e7eb;
}

.header-controls .search-btn svg {
    flex-shrink: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-controls .profile-btn {
    background: #f2f4f6;
    border: 1px solid #e5e8eb;
    padding: 10px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.header-controls .profile-btn:hover {
    background-color: #e5e7eb;
}

.header-controls .profile-btn svg {
    flex-shrink: 0;
}

.profile-modal {
    max-width: 400px;
}

.profile-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

/* Grid Layout */
.dashboard-grid-layout {
    display: grid;
    grid-template-columns: 1fr 320px 400px;
    /* Chart | 호가&즐겨찾기 | AI 분석 사이드바 */
    gap: 20px;
    align-items: start;
    height: fit-content;
    min-height: calc(100vh - 150px);
    max-height: calc(100vh - 150px);
    overflow: hidden;
}

/* Common Card Style */
.grid-col-chart,
.grid-col-hoga,
.grid-col-order,
.grid-col-account,
.grid-col-analysis {
    background: #f2f4f6;
    border-radius: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    height: 100%;
}

.grid-col-chart {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
    min-height: 0;
    max-height: calc(100vh - 150px);
}

.grid-col-hoga-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.grid-col-hoga {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 0 0 50%;
    min-height: 0;
}

.grid-col-favorites {
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #f2f4f6;
    border-radius: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    flex: 0 0 50%;
    min-height: 0;
}

.grid-col-analysis {
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--card);
    height: 100%;
    max-height: calc(100vh - 150px);
    overflow: hidden;
}

.grid-col-analysis .analysis-sidebar-content {
    padding-top: 15px;
    padding-bottom: 15px;
}

.analysis-sidebar-content {
    padding: 15px 20px;
    overflow-y: auto;
    overflow-x: visible;
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    /* 스크롤바 숨기기 */
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none; /* Firefox */
}

.analysis-sidebar-content::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.analysis-sidebar-content .analysis-section {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f2f4f6;
    flex-shrink: 0;
}

.analysis-sidebar-content .analysis-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.analysis-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.2rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.section-header.simple {
    gap: 0.4rem;
}

.section-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.section-subtitle {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.indicator-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.indicator-card {
    border-radius: 18px;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fbff 0%, #eef2ff 100%);
    border: 1px solid rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
}

.indicator-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.indicator-card-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    word-break: keep-all;
}

.indicator-card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.indicator-card-desc {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.indicator-card.indicator-rsi {
    background: radial-gradient(circle at top, rgba(147, 197, 253, 0.45), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.indicator-card.indicator-macd {
    background: radial-gradient(circle at top, rgba(248, 113, 113, 0.45), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.indicator-card.indicator-bb {
    background: radial-gradient(circle at top, rgba(16, 185, 129, 0.45), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.indicator-card.indicator-default {
    background: radial-gradient(circle at top, rgba(148, 163, 184, 0.3), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.signal-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    text-transform: none;
    color: #0f172a;
}

.signal-badge.buy {
    background: rgba(38, 222, 129, 0.25);
    color: var(--positive);
}

.signal-badge.sell {
    background: rgba(255, 71, 87, 0.2);
    color: var(--negative);
}

.signal-badge.neutral {
    background: rgba(100, 116, 139, 0.2);
    color: #475569;
}

.signal-badge.warn {
    background: rgba(249, 115, 22, 0.2);
    color: #c2410c;
}

.signal-badge.info {
    background: rgba(14, 165, 233, 0.2);
    color: #0369a1;
}

.indicator-progress {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.indicator-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #22d3ee);
    transition: width 0.3s ease;
}

.indicator-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #94a3b8;
}

.indicator-trend {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.25rem;
}

.indicator-trend.up {
    color: var(--positive);
}

.indicator-trend.down {
    color: var(--negative);
}

.indicator-hint {
    margin: 0;
    font-size: 0.72rem;
    color: #94a3b8;
}

.signal-card {
    border-radius: 18px;
    padding: 1.1rem;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(226, 232, 240, 0.8));
    border: 1px solid rgba(148, 163, 184, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.signal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.signal-label {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.signal-value {
    font-size: 1.6rem;
    font-weight: 800;
    margin-top: 0.1rem;
    color: var(--text);
}

.signal-card.indicator-positive {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(255, 255, 255, 0.95));
    border-color: rgba(16, 185, 129, 0.4);
}

.signal-card.indicator-negative {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(255, 255, 255, 0.95));
    border-color: rgba(248, 113, 113, 0.5);
}

.signal-card.indicator-neutral {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(255, 255, 255, 0.95));
    border-color: rgba(148, 163, 184, 0.45);
}

.signal-confidence {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.signal-price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.6rem;
}

.signal-price-grid div {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 0.6rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.signal-price-grid strong {
    font-size: 1rem;
    color: var(--text);
}

.signal-reason {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
}

.sr-group {
    border-radius: 18px;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sr-group + .sr-group {
    margin-top: 0.9rem;
}

.sr-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.sr-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.08);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.sr-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sr-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.sr-row-values {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sr-row-values strong {
    font-size: 1.05rem;
    color: var(--text);
}

.sr-chip {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: none;
}

.sr-chip.support {
    background: rgba(38, 222, 129, 0.2);
    color: var(--positive);
}

.sr-chip.resistance {
    background: rgba(255, 71, 87, 0.2);
    color: var(--negative);
}

.sr-strength {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.pattern-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pattern-card {
    border-radius: 16px;
    padding: 1rem;
    background: linear-gradient(140deg, rgba(79, 70, 229, 0.12), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(79, 70, 229, 0.2);
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.pattern-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    font-weight: 700;
}

.pattern-confidence-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f172a;
    background: rgba(241, 245, 249, 0.85);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.pattern-card.pattern-bullish {
    border-left: 4px solid var(--positive);
}

.pattern-card.pattern-bearish {
    border-left: 4px solid var(--negative);
}

.pattern-card.pattern-neutral {
    border-left: 4px solid #94a3b8;
}

.pattern-desc {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.risk-card {
    border-radius: 18px;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(255, 255, 255, 0.96));
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.2);
}

.risk-card.risk-high {
    border-left: 4px solid var(--negative);
}

.risk-card.risk-medium {
    border-left: 4px solid #facc15;
}

.risk-card.risk-low {
    border-left: 4px solid var(--positive);
}

.risk-highlight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
}

.risk-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.risk-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.risk-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.risk-stats div {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    font-size: 0.76rem;
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.risk-stats strong {
    font-size: 1rem;
    color: var(--text);
    margin-top: 0.15rem;
}

.empty-copy {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

body.prevent-scroll {
    overflow: hidden;
}

.drawing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 25, 0.9);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.drawing-overlay.active {
    display: flex;
}

.drawing-overlay-inner {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    width: min(1200px, 95vw);
    height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    color: #f8fafc;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.drawing-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.drawing-info strong {
    display: block;
    font-size: 1.1rem;
}

.drawing-info span {
    font-size: 0.85rem;
    color: rgba(248, 250, 252, 0.75);
}

.drawing-tools {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.drawing-tool-btn {
    border: 1px solid rgba(226, 232, 240, 0.5);
    background: rgba(248, 250, 252, 0.15);
    color: #f8fafc;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.drawing-tool-btn.active {
    background: #f8fafc;
    color: #0f172a;
    border-color: #f8fafc;
}

.drawing-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.drawing-buttons button {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

#drawing-undo-btn {
    background: rgba(248, 250, 252, 0.18);
    color: #f8fafc;
    border: 1px solid rgba(248, 250, 252, 0.35);
}

#drawing-clear-btn {
    background: rgba(248, 113, 113, 0.2);
    color: #fee2e2;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.drawing-close-btn {
    background: #f8fafc;
    color: #0f172a;
}

.drawing-chart-wrapper {
    position: relative;
    flex: 1 1 auto;
    margin-top: 1rem;
    border-radius: 18px;
    overflow: hidden;
    background: #0f172a;
}

.drawing-chart {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    background: transparent;
    z-index: 10;
    pointer-events: auto;
}

.drawing-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    font-size: 1rem;
}

.analysis-sidebar-content .analysis-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.analysis-sidebar-content .analysis-section:first-child {
    margin-top: 0;
}

.analysis-sidebar-content .indicators-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.analysis-sidebar-content .indicator-item {
    padding: 0.75rem;
    font-size: 13px;
}

.analysis-sidebar-content .indicator-item .indicator-name {
    font-size: 12px;
    margin-bottom: 0.4rem;
}

.analysis-sidebar-content .indicator-item .indicator-value {
    font-size: 16px;
    margin-bottom: 0.4rem;
}

.analysis-sidebar-content .indicator-item .indicator-desc {
    font-size: 11px;
}

.analysis-sidebar-content .signal-main {
    padding: 1rem;
    font-size: 13px;
}

.analysis-sidebar-content .signal-main .signal-type {
    font-size: 18px;
    margin-bottom: 0.4rem;
}

.analysis-sidebar-content .signal-main .signal-confidence {
    font-size: 12px;
    margin-bottom: 0.5rem;
}

.analysis-sidebar-content .signal-main .signal-reason {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    font-size: 11px;
}

.analysis-sidebar-content .sr-item {
    padding: 0.6rem 0.75rem;
    font-size: 13px;
}

.analysis-sidebar-content .sr-item .sr-level {
    font-size: 14px;
}

.analysis-sidebar-content .sr-item .sr-strength {
    font-size: 11px;
}

.analysis-sidebar-content .patterns-list {
    gap: 0.75rem;
}

.analysis-sidebar-content .pattern-item {
    padding: 0.75rem;
    font-size: 13px;
}

.analysis-sidebar-content .pattern-item .pattern-name {
    font-size: 13px;
    margin-bottom: 0.4rem;
}

.analysis-sidebar-content .pattern-item .pattern-confidence {
    font-size: 11px;
    margin-bottom: 0.4rem;
}

.analysis-sidebar-content .pattern-item .pattern-desc {
    font-size: 11px;
}

.analysis-sidebar-content .risk-item {
    padding: 1rem;
    font-size: 13px;
}

.analysis-sidebar-content .risk-item > div {
    margin-bottom: 0.4rem;
    font-size: 12px;
}

.analysis-sidebar-content .summary-text {
    padding: 0.5rem;
    font-size: 11px;
    line-height: 1.3;
}

.grid-col-order {
    padding: 20px;
    background: white;
}

.grid-col-account {
    padding: 0;
    background: transparent;
    /* Account column has separate cards */
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: visible;
}

/* Chart Section */
.chart-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

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

.draw-mode-btn {
    border: 1px solid var(--primary);
    background: rgba(74, 201, 255, 0.15);
    color: var(--primary);
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.draw-mode-btn:hover {
    background: var(--primary);
    color: #fff;
}

.period-selector {
    display: flex;
    gap: 4px;
    background: #f2f4f6;
    padding: 4px;
    border-radius: 12px;
}

.period-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7684;
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn.active {
    background: white;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chart-area {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 400px;
    max-height: 600px;
}

.chart-overlay-info {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    z-index: 10;
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chart-range-label {
    background: rgba(7, 12, 31, 0.8);
    color: #fff;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-left: auto;
    white-space: nowrap;
}

.chart-range-label::before {
    content: "📅";
    font-size: 0.9rem;
}

.chart-crosshair-label {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    color: #f4f6fb;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(6, 10, 25, 0.25);
    pointer-events: none;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.info-item {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.analysis-highlights {
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.highlight-card {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 150px;
    position: relative;
    overflow: hidden;
}

.highlight-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.highlight-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
}

.highlight-sub {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.highlight-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
}

.highlight-card.signal-buy {
    border-color: rgba(38, 222, 129, 0.5);
    box-shadow: 0 8px 25px rgba(38, 222, 129, 0.2);
}

.highlight-card.signal-sell {
    border-color: rgba(255, 71, 87, 0.5);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.2);
}

.highlight-card.signal-neutral {
    border-color: rgba(107, 114, 128, 0.3);
}

.highlight-card.risk-high {
    border-color: rgba(255, 71, 87, 0.4);
}

.highlight-card.risk-medium {
    border-color: rgba(255, 193, 7, 0.5);
}

.highlight-card.risk-low {
    border-color: rgba(38, 222, 129, 0.4);
}

.highlight-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    overflow: hidden;
}

.highlight-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: inherit;
    transition: width 0.3s ease;
}

.highlight-pair {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    gap: 0.5rem;
}

.highlight-pair strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.highlight-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
}

.highlight-tag-support {
    background: rgba(38, 222, 129, 0.15);
    color: var(--positive);
}

.highlight-tag-resistance {
    background: rgba(255, 71, 87, 0.15);
    color: var(--negative);
}

.info-item .label {
    color: #6b7684;
}

.info-item strong {
    color: #333;
}

/* Bottom Widgets */
/* AI 분석 패널 스타일 */
.ai-analysis-panel {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    max-height: none;
    overflow: visible;
    flex-shrink: 0;
}

.ai-analysis-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-analysis-panel .panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.ai-analysis-panel .analyze-btn {
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ai-analysis-panel .analyze-btn:hover:not(:disabled) {
    background: var(--chat-button-hover);
    transform: translateY(-1px);
}

.ai-analysis-panel .analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-analysis-panel .panel-content {
    margin-top: 1rem;
    max-height: none;
    overflow: visible;
}

.analysis-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.analysis-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.analysis-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* 기술적 지표 그리드 */
.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.indicator-item {
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.indicator-item .indicator-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.indicator-item .indicator-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.indicator-item .indicator-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.indicator-item.signal-buy .indicator-value {
    color: var(--positive);
}

.indicator-item.signal-sell .indicator-value {
    color: var(--negative);
}

.indicator-item.signal-neutral .indicator-value {
    color: var(--text);
}

/* 매매 신호 박스 */
.signal-box {
    margin-top: 0.5rem;
    max-height: none;
    overflow: visible;
}

.signal-main {
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid;
    min-height: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.signal-main.signal-buy {
    background: rgba(38, 222, 129, 0.1);
    border-color: var(--positive);
}

.signal-main.signal-sell {
    background: rgba(255, 71, 87, 0.1);
    border-color: var(--negative);
}

.signal-main.signal-neutral {
    background: var(--surface);
    border-color: var(--card-border);
}

.signal-main .signal-type {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.signal-main.signal-buy .signal-type {
    color: var(--positive);
}

.signal-main.signal-sell .signal-type {
    color: var(--negative);
}

.signal-main .signal-confidence {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.signal-main .signal-reason {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* 지지/저항선 리스트 */
.sr-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sr-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: 6px;
    border: 1px solid var(--card-border);
}

.sr-item .sr-type {
    font-weight: 600;
    color: var(--text);
    min-width: 60px;
}

.sr-item .sr-level {
    font-weight: 700;
    color: var(--text);
    flex: 1;
    text-align: center;
}

.sr-item .sr-strength {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 패턴 리스트 */
.patterns-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pattern-item {
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.pattern-item.pattern-bullish {
    background: rgba(38, 222, 129, 0.1);
    border-color: var(--positive);
}

.pattern-item.pattern-bearish {
    background: rgba(255, 71, 87, 0.1);
    border-color: var(--negative);
}

.pattern-item.pattern-neutral {
    background: var(--surface);
}

.pattern-item .pattern-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.pattern-item .pattern-confidence {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.pattern-item .pattern-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 리스크 분석 박스 */
.risk-box {
    margin-top: 0.5rem;
}

.risk-item {
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid;
}

.risk-item.risk-high {
    background: rgba(255, 71, 87, 0.1);
    border-color: var(--negative);
}

.risk-item.risk-medium {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

.risk-item.risk-low {
    background: rgba(38, 222, 129, 0.1);
    border-color: var(--positive);
}

.risk-item > div {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.risk-item > div:last-child {
    margin-bottom: 0;
}

/* 요약 텍스트 */
.summary-text {
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
}

/* 분석 결과 모달 스타일 (사이드바 형식) */
#analysis-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px);
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 지표 신뢰 테스트 모달 스크롤바 숨김 */
#indicator-reliability-modal .modal-content {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#indicator-reliability-modal .modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 지표 신뢰 테스트 모달 내부 카드 스크롤바 숨김 */
#indicator-reliability-modal .modal-content > div > div > div {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#indicator-reliability-modal .modal-content > div > div > div::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.modal-content {
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--surface);
    color: var(--text);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* 지표 신뢰 테스트 모달 본문 중앙 정렬 */
#indicator-reliability-modal .modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 2rem;
}

/* 지표 신뢰 테스트 모달 컨텐츠 중앙 정렬 */
#indicator-reliability-modal .modal-body > div {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#analysis-modal-overlay[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

.analysis-modal-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background: var(--card);
    box-shadow: var(--shadow-soft);
    z-index: 3001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#analysis-modal-overlay[style*="display: flex"] .analysis-modal-content {
    transform: translateX(0);
}

.analysis-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
    height: calc(100vh - 80px);
}

.analysis-modal-content .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
    background: var(--surface);
    flex-shrink: 0;
}

.analysis-modal-content .modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.analysis-modal-content .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.analysis-modal-content .modal-close:hover {
    background: var(--card);
    color: var(--text);
}

.analysis-modal-body .analysis-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.analysis-modal-body .analysis-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.analysis-modal-body .analysis-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* 툴팁 스타일 */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: help;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.tooltip-icon:hover {
    background: var(--chat-button-hover);
}

.tooltip-text {
    display: none;
    position: fixed;
    bottom: auto;
    left: auto;
    transform: none;
    margin-bottom: 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.85rem;
    line-height: 1.5;
    border-radius: 6px;
    white-space: pre-line;
    min-width: 200px;
    max-width: 300px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.tooltip-icon:hover .tooltip-text {
    display: block;
}

.bottom-widgets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    height: 200px;
}

.widget-box {
    background: #f9fafb;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e5e8eb;
}

.widget-box h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.news-preview {
    max-height: 300px;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.news-preview::-webkit-scrollbar {
    display: none;
}

.dashboard-news-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    transition: opacity 0.2s ease;
}

.dashboard-news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dashboard-news-item:hover {
    opacity: 0.8;
}

.dashboard-news-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.dashboard-news-item h4 {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.dashboard-news-item p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dashboard-news-item .news-meta {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
}

/* Hoga (Orderbook) */
.hoga-header {
    padding: 10px 15px;
    border-bottom: 1px solid #f2f4f6;
}

.hoga-header h3 {
    margin: 0;
    font-size: 14px;
}

.orderbook-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.favorites-header {
    padding: 10px 15px;
    border-bottom: 1px solid #f2f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorites-header h3 {
    margin: 0;
    font-size: 14px;
}

.settings-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.settings-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.favorite-toggle-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-toggle-btn:hover {
    transform: scale(1.1);
}

.favorite-toggle-btn.active {
    transform: scale(1.15);
}

.favorites-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 0.5rem;
}

.favorites-list .favorite-stock-item {
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.favorites-list .favorite-stock-item:hover {
    background: #f9fafb;
}

.favorites-list .favorite-stock-item .stock-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.favorites-list .favorite-stock-item .stock-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.favorites-list .favorite-stock-item .stock-symbol {
    font-size: 12px;
    color: var(--text-muted);
}

.favorites-list .empty-message {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.orderbook-list {
    display: flex;
    flex-direction: column;
}

.orderbook-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 20px;
    font-size: 13px;
    cursor: pointer;
    position: relative;
}

.orderbook-sell .orderbook-item {
    background-color: rgba(74, 144, 226, 0.05);
    /* Blue tint */
}

.orderbook-buy .orderbook-item {
    background-color: rgba(240, 68, 82, 0.05);
    /* Red tint */
}

.orderbook-price {
    font-weight: 600;
    color: #333;
    z-index: 1;
}

.orderbook-volume {
    color: #6b7684;
    z-index: 1;
}

.orderbook-spread {
    padding: 10px 0;
    text-align: center;
    background: white;
    border-top: 1px solid #e5e8eb;
    border-bottom: 1px solid #e5e8eb;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* Order Form */
.order-form-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-tabs {
    display: flex;
    background: #f2f4f6;
    border-radius: 12px;
    padding: 4px;
}

.order-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    color: #6b7684;
    cursor: pointer;
}

.order-tab.active {
    background: white;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.order-tab.active[data-type="buy"] {
    color: #f04452;
}

.order-tab.active[data-type="sell"] {
    color: #4a90e2;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 13px;
    color: #6b7684;
    font-weight: 600;
}

.price-input-box,
.quantity-input-box {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid transparent;
}

.price-input-box:focus-within,
.quantity-input-box:focus-within {
    border-color: #333;
    background: white;
}

.price-input-box input,
.quantity-input-box input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 10px;
    text-align: right;
    font-size: 16px;
    font-weight: 600;
    outline: none;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.percent-btns {
    display: flex;
    gap: 8px;
}

.percent-btns button {
    flex: 1;
    border: 1px solid #e5e8eb;
    background: white;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7684;
    cursor: pointer;
}

.percent-btns button:hover {
    background: #f9fafb;
}

.order-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f2f4f6;
}

.submit-order-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: auto;
}

.submit-order-btn.buy {
    background-color: #f04452;
}

.submit-order-btn.sell {
    background-color: #4a90e2;
}

.submit-order-btn:hover {
    opacity: 0.9;
}

/* Account Column */
.account-summary-card,
.my-stocks-card {
    background: white;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.account-balance {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-balance .value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.empty-stocks {
    color: #6b7684;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* Responsive */
@media (max-width: 1600px) {
    .dashboard-grid-layout {
        grid-template-columns: minmax(500px, 1fr) 240px 350px;
    }

    .grid-col-account {
        display: none;
        /* Hide account on smaller desktops for now */
    }
}

@media (max-width: 1200px) {
    .dashboard-grid-layout {
        grid-template-columns: 1fr 300px 350px;
        grid-template-rows: auto auto;
    }

    .grid-col-hoga {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    
    .grid-col-analysis {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .grid-col-order {
        grid-column: 1;
        grid-row: 2;
    }
}

@media (max-width: 768px) {
    .dashboard-grid-layout {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .toss-dashboard-container {
        padding-bottom: 80px;
    }

    .grid-col-chart,
    .grid-col-hoga,
    .grid-col-order,
    .grid-col-account,
    .grid-col-analysis {
        height: auto;
        min-height: 0;
    }
    
    .grid-col-analysis {
        order: 3;
        margin-top: 20px;
    }
    
    .analysis-sidebar-content {
        height: auto;
        max-height: 500px;
    }

    .chart-area {
        min-height: 300px;
    }
}

/* Dashboard Container Style */
.toss-dashboard-container {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 24px;
    margin-top: 20px;
}

.dashboard-body {
    background-color: #ffffff !important;
}