/*
 * 사용자 사이트 새 디자인 (2026-10 개편 1단계)
 *  - 밤하늘 남색 헤더 · 맑은 회색 바탕 · 흰 카드에 얇은 선
 *  - 금색(--cs-gold)은 회원 공간으로 가는 길에만 쓴다 (2단계)
 *  - 빨강 · 파랑은 지금처럼 오름 · 내림 · 천INDEX 구간에만 쓴다
 *  - chun-free-theme · chun-free-ui · chun-free-dark 뒤에 로드해 색 변수와 헤더 · 바닥글만 덮어쓴다
 */
:root {
	--cs-bg: #F2F4F8;
	--cs-surface: #FFFFFF;
	--cs-surface-2: #F4F6FA;
	--cs-ink: #131A33;
	--cs-ink-2: #283052;
	--cs-muted: #4E5675;
	--cs-faint: #626A86;
	--cs-line: #E1E5EE;
	--cs-solid: #151C3D;
	--cs-radius: 20px;
	--cs-radius-sm: 14px;

	--cs-night: #10163A;
	--cs-night-2: #1B2350;
	--cs-night-ink: #ECEFF8;
	--cs-night-muted: #A6AECB;
	--cs-gold: #A87A22;
	--cs-gold-ink: #7A5714;
	--cs-gold-soft: #F5ECD7;
}
html[data-theme="dark"] {
	--cs-bg: #0B0F1D;
	--cs-surface: #141A2D;
	--cs-surface-2: #1B2238;
	--cs-ink: #E7EAF4;
	--cs-ink-2: #C9CFE2;
	--cs-muted: #A0A8C2;
	--cs-faint: #7A83A0;
	--cs-line: #283050;
	--cs-solid: #2C3760;

	--cs-night: #070B19;
	--cs-night-2: #151C38;
	--cs-night-ink: #ECEFF8;
	--cs-night-muted: #9AA3C0;
	--cs-gold: #E1B65C;
	--cs-gold-ink: #F0CD82;
	--cs-gold-soft: #3A2F17;

	--chun-bg: #0B0F1D;
	--chun-surface: #141A2D;
	--chun-surface-2: #1B2238;
	--chun-line: #283050;
}

html body { background: var(--cs-bg); }
html body #content-wrapper { background: var(--cs-bg) !important; }

/* ---------- 카드 : 그림자 없이 얇은 선 ---------- */
.cs-card { border: 1px solid var(--cs-line); }
.cs-card.is-dark { border-color: transparent; }
html body .chun_ui_new_mlgroup > .chun_ui_new_card { border: 1px solid var(--cs-line) !important; }
.cs-head h1 { letter-spacing: -0.025em; }

/* ---------- 상단 헤더 : 흰 바탕 · 얇은 선 · 지금 메뉴는 밑줄 · 펼침 패널 ---------- */
.cs-top { background: var(--cs-surface); border-bottom: 1px solid var(--cs-line); }
.cs-top-inner { padding-top: 0; padding-bottom: 0; min-height: 64px; }
.cs-top .cs-nav { background: transparent; padding: 0; gap: 0; align-self: stretch; }
.cs-top .cs-nav-group { display: flex; align-items: stretch; }
html body .cs-top .cs-nav-item { position: relative; height: 64px; padding: 0 16px; border-radius: 0; background: transparent !important; color: var(--cs-muted) !important; font-size: 15px; font-weight: 600; }
html body .cs-top .cs-nav-item:hover,
html body .cs-top .cs-nav-group:hover > .cs-nav-item,
html body .cs-top .cs-nav-group.is-open > .cs-nav-item { color: var(--cs-ink) !important; }
html body .cs-top .cs-nav-item.is-active,
html body .cs-top .cs-nav-group.is-active > .cs-nav-item { background: transparent !important; color: var(--cs-ink) !important; font-weight: 800; }
html body .cs-top .cs-nav-item.is-active::after,
html body .cs-top .cs-nav-group.is-active > .cs-nav-item::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; background: var(--cs-ink); }
.cs-top .cs-nav-item:focus-visible { outline: 2px solid var(--cs-ink); outline-offset: -4px; }
.cs-top .cs-caret { margin-left: 2px; font-size: 10px; opacity: .5; }
.cs-top .cs-nav-group::after { height: 2px; }

/* 펼침 패널 : 화면 이름 + 한 줄 설명, 항목이 많으면 두 줄 */
html body .cs-top .cs-menu {
	top: 100%; left: -8px; min-width: 280px; padding: 10px;
	display: none; grid-template-columns: minmax(0, 1fr); gap: 2px;
	border: 1px solid var(--cs-line); border-radius: 16px;
	box-shadow: 0 24px 48px -12px rgba(16, 22, 58, 0.18);
}
html body .cs-top .cs-nav-group:hover .cs-menu,
html body .cs-top .cs-nav-group.is-open .cs-menu { display: grid; }
html body .cs-top .cs-menu:has(> a:nth-of-type(7)) { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 520px; }
html body .cs-top .cs-menu a { padding: 10px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 700; color: var(--cs-ink) !important; }
html body .cs-top .cs-menu a small { margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--cs-faint); }
html body .cs-top .cs-menu a:hover { background: var(--cs-surface-2); }
html body .cs-top .cs-menu a.is-active { background: var(--cs-surface-2); }
html body .cs-top .cs-menu-title { grid-column: 1 / -1; margin: 6px 12px 2px; font-size: 12px; font-weight: 700; color: var(--cs-faint); }

/* 오른쪽 버튼 */
.cs-top .cs-btn,
.cs-top .cs-theme-btn,
.cs-top .cs-menu-btn,
.cs-top .cs-search-btn { height: 38px; background: var(--cs-surface-2); color: var(--cs-ink) !important; }
.cs-top .cs-theme-btn, .cs-top .cs-menu-btn { width: 38px; }
.cs-top .cs-btn:hover,
.cs-top .cs-theme-btn:hover,
.cs-top .cs-menu-btn:hover,
.cs-top .cs-search-btn:hover { background: var(--cs-line); }
html body .cs-top .cs-btn.is-dark { padding: 0 16px; background: var(--cs-ink) !important; color: var(--cs-surface) !important; }
@media (max-width: 1100px) { html body .cs-top .cs-nav-item { padding: 0 11px; font-size: 14px; } }

/* ---------- 바닥글 : 본문 폭, 위쪽 선 하나로 ---------- */
html body footer.cs-footer-wrap > .cs-card.cs-foot { background: transparent; border: 0; border-top: 1px solid var(--cs-line); border-radius: 0; padding: 22px 4px 4px; }
.cs-foot-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.cs-foot-brand b { font-size: 15px; font-weight: 800; color: var(--cs-ink); letter-spacing: 0.02em; }
.cs-foot-brand span { font-size: 13px; color: var(--cs-muted); }
.cs-foot-links a { background: var(--cs-surface); box-shadow: inset 0 0 0 1px var(--cs-line); }

/* ---------- 첫 화면 '오늘의 시장' 띠 : 흰 카드, 글이 주인공 ---------- */
.cs-today {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 16px 28px;
	align-items: center;
	padding: 22px 28px;
	border-radius: var(--cs-radius);
	background: var(--cs-surface);
	border: 1px solid var(--cs-line);
	color: var(--cs-ink);
}
.cs-today-date { font-size: 13px; font-weight: 600; color: var(--cs-faint); }
.cs-today-line { margin: 6px 0 0; font-size: 20px; font-weight: 800; line-height: 1.45; letter-spacing: -0.025em; color: var(--cs-ink); text-wrap: balance; }
.cs-today-sub { margin: 6px 0 0; font-size: 14px; line-height: 1.65; color: var(--cs-muted); }
.cs-today-sub b { color: var(--cs-ink); font-weight: 700; }
.cs-today-nums { display: flex; gap: 0; border-left: 1px solid var(--cs-line); }
.cs-today-num { min-width: 120px; padding: 2px 0 2px 24px; }
.cs-today-num em { display: block; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--cs-faint); }
.cs-today-num b { display: inline-block; margin-top: 2px; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--cs-ink); }
.cs-today-num small { margin-left: 6px; font-size: 13px; font-weight: 700; }
.cs-today-num small.is-up { color: var(--cs-up); }
.cs-today-num small.is-down { color: var(--cs-down); }
.cs-today-num i { display: block; margin-top: 4px; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--cs-muted); }
.cs-today-num i::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--cs-faint); vertical-align: 1px; }
.cs-today-num i[data-z="1"]::before { background: var(--cs-zone-1); }
.cs-today-num i[data-z="2"]::before { background: var(--cs-zone-2); }
.cs-today-num i[data-z="3"]::before { background: var(--cs-zone-3); }
.cs-today-num i[data-z="4"]::before { background: var(--cs-zone-4); }
@media (max-width: 767.98px) {
	.cs-today { grid-template-columns: minmax(0, 1fr); padding: 18px 18px; }
	.cs-today-line { font-size: 17px; }
	.cs-today-nums { border-left: 0; border-top: 1px solid var(--cs-line); padding-top: 14px; }
	.cs-today-num { flex: 1 1 0; min-width: 0; padding-left: 0; }
}

/* ---------- 빨간 알약 뱃지 줄이기 : '읽는 법' · '뉴스' 는 차분한 회색 꼬리표 ---------- */
html body .chun-guide-badge,
html body .cs-home .cs-newsbar-tag { background: var(--cs-surface-2) !important; color: var(--cs-ink-2) !important; box-shadow: inset 0 0 0 1px var(--cs-line); font-weight: 700 !important; }

/* 다크 : 헤더 아래 선 */
html[data-theme="dark"] .cs-top { border-bottom-color: var(--cs-line); }

/* '읽는 법' 카드 : 카드 사이 간격(16px)만 쓰고 아래 여백은 뺀다 */
.cs-page > #chun-guide-slot .chun-guide { margin-bottom: 0; }

/* =====================================================================
 * 본문 : 편집 디자인 — 제목과 숫자가 주인공
 * ===================================================================== */
.cs-head { padding: 6px 4px 4px; }
.cs-head-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--cs-faint); }
.cs-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.2; }
.cs-head p { font-size: 15.5px; color: var(--cs-muted); }
@media (max-width: 575.98px) { .cs-head h1 { font-size: 26px; } }

/* 첫 화면 브리핑 : 카드 없이 바탕 위에 큰 글자 */
.cs-today { background: transparent; border: 0; border-bottom: 1px solid var(--cs-line); border-radius: 0; padding: 10px 4px 26px; gap: 18px 40px; }
.cs-today-date { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--cs-faint); }
.cs-today-line { margin-top: 10px; font-size: 30px; font-weight: 800; line-height: 1.32; letter-spacing: -0.04em; max-width: 30em; }
.cs-today-sub { margin-top: 10px; font-size: 15px; max-width: 52em; }
.cs-today-nums { border-left: 0; gap: 36px; }
.cs-today-num { padding: 0; min-width: 0; }
.cs-today-num b { font-size: 52px; letter-spacing: -0.04em; line-height: 1; margin-top: 6px; }
.cs-today-num small { font-size: 15px; }
.cs-today-num i { margin-top: 8px; font-size: 13px; }
@media (max-width: 767.98px) {
	.cs-today { padding: 6px 2px 20px; }
	.cs-today-line { font-size: 22px; }
	.cs-today-nums { border-top: 0; padding-top: 4px; gap: 24px; }
	.cs-today-num b { font-size: 40px; }
}
html[data-theme="dark"] .cs-today { box-shadow: none; }

/* 한글 줄바꿈 : 낱말 중간에서 끊지 않기 */
.cs-today-line, .cs-today-sub, .cs-head h1, .cs-head p, .cs-card-title, .chun-guide-summary { word-break: keep-all; overflow-wrap: anywhere; }

/* =====================================================================
 * 회원 공간 안내 (2단계) : 금색은 여기에만, 크기는 작게
 * ===================================================================== */
/* 메뉴 펼침 패널 맨 아래 한 줄 */
html body .cs-top .cs-menu a.cs-menu-member {
	grid-column: 1 / -1; margin-top: 6px; padding: 10px 12px; border-top: 1px solid var(--cs-line); border-radius: 0 0 10px 10px;
	font-size: 13px; font-weight: 500; color: var(--cs-muted) !important;
}
html body .cs-top .cs-menu a.cs-menu-member b { font-weight: 700; color: var(--cs-gold-ink); }
html body .cs-top .cs-menu a.cs-menu-member:hover { background: var(--cs-gold-soft); color: var(--cs-ink) !important; }

/* 첫 화면 브리핑 끝 작은 글씨 */
.cs-today-more { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--cs-muted) !important; text-decoration: none !important; }
.cs-today-more b { color: var(--cs-gold-ink); font-weight: 700; }
.cs-today-more:hover { color: var(--cs-ink) !important; }

/* 화면 맨 아래 '다음 단계' 카드 */
.cs-bridge {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: center;
	margin-top: 8px; padding: 22px 26px; border-radius: var(--cs-radius);
	background: var(--cs-surface); border: 1px solid var(--cs-line); box-shadow: inset 3px 0 0 var(--cs-gold);
}
.cs-bridge-q { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--cs-ink); word-break: keep-all; }
.cs-bridge-t { margin: 6px 0 0; font-size: 14px; line-height: 1.7; color: var(--cs-muted); word-break: keep-all; max-width: 60em; }
.cs-bridge-pages { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--cs-gold-ink); }
.cs-bridge-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cs-bridge-go { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--cs-line); background: var(--cs-surface); color: var(--cs-ink) !important; font-size: 14px; font-weight: 700; text-decoration: none !important; white-space: nowrap; }
.cs-bridge-go:hover { border-color: var(--cs-gold); background: var(--cs-gold-soft); }
.cs-bridge-x { border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 12.5px; color: var(--cs-faint); cursor: pointer; }
.cs-bridge-x:hover { color: var(--cs-ink); text-decoration: underline; }
@media (max-width: 767.98px) {
	.cs-bridge { grid-template-columns: minmax(0, 1fr); padding: 18px 18px; }
	.cs-bridge-side { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* =====================================================================
 * 그래프 툴팁 (chun-page.js 가 기본 툴팁을 이 모양으로 바꿈)
 * ===================================================================== */
.highcharts-tooltip .cs-tt { min-width: 168px; font-family: var(--cs-font); }
.highcharts-tooltip .cs-tt-h { margin: 0 0 6px; padding-bottom: 7px; border-bottom: 1px solid var(--cs-line); font-size: 12.5px; font-weight: 800; letter-spacing: -0.01em; color: var(--cs-ink); white-space: nowrap; }
.highcharts-tooltip .cs-tt-r { display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.75; color: var(--cs-ink-2); }
.highcharts-tooltip .cs-tt-r i { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 3px; }
.highcharts-tooltip .cs-tt-r span { flex: 1 1 auto; white-space: nowrap; }
.highcharts-tooltip .cs-tt-r b { margin-left: 16px; font-weight: 800; color: var(--cs-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.highcharts-tooltip .cs-tt-r i.is-empty { background: transparent; }
.highcharts-tooltip .cs-tt-r.is-sub { padding-left: 17px; font-size: 12px; line-height: 1.6; color: var(--cs-muted); }
.highcharts-tooltip .cs-tt-r.is-sub i { display: none; }
.highcharts-tooltip .cs-tt-r.is-sub b { font-weight: 700; color: var(--cs-ink-2); }
.highcharts-tooltip .cs-tt-r b span { font-weight: inherit; }

/* 첫 화면 경제속보 (공개 맛보기 3건) */
.cs-brk-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 8px; }
.cs-brk-note { font-size: 13px; color: var(--cs-faint); }
.cs-brk-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.cs-brk-list li { display: flex; gap: 12px; padding: 14px 18px 4px 0; min-width: 0; }
.cs-brk-list li + li { padding-left: 18px; border-left: 1px solid var(--cs-line); }
.cs-brk-list img { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--cs-surface-2); }
.cs-brk-list div { min-width: 0; }
.cs-brk-list a, .cs-brk-list b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; font-weight: 800; line-height: 1.45; color: var(--cs-ink) !important; text-decoration: none !important; word-break: keep-all; }
.cs-brk-list a:hover { text-decoration: underline !important; }
.cs-brk-list em { margin-right: 6px; padding: 1px 6px; border-radius: 6px; background: var(--cs-surface-2); font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--cs-muted); vertical-align: 2px; }
.cs-brk-list p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--cs-muted); word-break: keep-all; }
.cs-brk-list span { display: block; margin-top: 6px; font-size: 12px; color: var(--cs-faint); }
@media (max-width: 991.98px) {
	.cs-brk-list { grid-template-columns: minmax(0, 1fr); }
	.cs-brk-list li, .cs-brk-list li + li { padding: 12px 0; border-left: 0; border-top: 1px solid var(--cs-line); }
	.cs-brk-list li:first-child { border-top: 0; }
}

/* =====================================================================
 * 검토 반영 (디자이너 · 퍼블리셔 · 기획자, 2026-10-17)
 * ===================================================================== */
/* 빨강은 오름 데이터 전용 : 제목 위 분류 글자 · 바로 가기 아이콘 · 그래프 설명 아이콘은 회색 */
html body .cs-head-eyebrow { color: var(--cs-faint) !important; }
.cs-toc-label i { color: var(--cs-faint); }
.cs-chart-note > i { background: transparent; color: var(--cs-faint); box-shadow: inset 0 0 0 1.5px var(--cs-faint); font-size: 9px; }

/* 툴팁 : 옛 !important 규칙보다 우선 · 다크에서도 ▲ ▼ 색 유지 · 휴대폰은 보조 줄 숨김 */
div.highcharts-tooltip .highcharts-label .cs-tt-r { font-size: 12.5px !important; line-height: 1.75 !important; }
div.highcharts-tooltip .highcharts-label .cs-tt-h { font-size: 12.5px !important; line-height: 1.4 !important; }
div.highcharts-tooltip .highcharts-label .cs-tt-r.is-sub { font-size: 12px !important; line-height: 1.6 !important; }
html[data-theme="dark"] div.highcharts-tooltip .cs-tt-r span { color: var(--cs-ink-2) !important; }
html[data-theme="dark"] div.highcharts-tooltip .cs-tt-r b,
html[data-theme="dark"] div.highcharts-tooltip .cs-tt-h { color: var(--cs-ink) !important; }
html[data-theme="dark"] div.highcharts-tooltip .cs-tt-r b span[style*="red"] { color: var(--cs-up) !important; }
html[data-theme="dark"] div.highcharts-tooltip .cs-tt-r b span[style*="blue"] { color: #7FA2EA !important; }
@media (max-width: 575.98px) { div.highcharts-tooltip .cs-tt-r.is-sub { display: none !important; } .highcharts-tooltip .cs-tt { min-width: 140px; } }

/* 다크 : 천INDEX 큰 숫자 대비 (진한 파랑 → 밝은 파랑) */
html[data-theme="dark"] .cs-home .cs-score-num[data-z="1"],
html[data-theme="dark"] .cs-score-diff.cs-down,
html[data-theme="dark"] .cs-today-num small.is-down { color: #7FA2EA !important; }

/* 키보드 초점 표시 */
.cs-bridge-go:focus-visible, .cs-bridge-x:focus-visible, .cs-top .cs-menu a:focus-visible, .cs-mem-faq summary:focus-visible,
.cs-mem-btn:focus-visible, .cs-brk-list a:focus-visible, .cs-today-more:focus-visible { outline: 2px solid var(--cs-ink); outline-offset: 2px; border-radius: 8px; }

/* 상단 로그인 글자 링크 */
.cs-top .cs-login { padding: 0 8px; font-size: 14px; font-weight: 600; color: var(--cs-muted) !important; text-decoration: none !important; white-space: nowrap; }
.cs-top .cs-login:hover { color: var(--cs-ink) !important; }
@media (max-width: 575.98px) { .cs-top .cs-login { display: none; } }
