@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');
/* 서브탭 전환 시 세로 스크롤바 유무(탭마다 콘텐츠 길이가 달라 발생)로 뷰포트 폭이
   바뀌어 가운데 정렬된 헤더/컨테이너가 수평으로 흔들리는 것을 방지한다
   (scrollbar-gutter-layout-shift-and-subtab-jump, #107). */
html{scrollbar-gutter:stable;overflow-y:scroll}
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:Pretendard,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#f6f6ef;color:#111;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:inherit}
/* 2단 헤더(tier1 GNB + tier2 서브탭)를 하나의 sticky 블록으로 상단에 고정한다(#107).
   position:sticky 는 일반 흐름(in-flow)을 유지하므로 fixed 처럼 별도의 본문
   top padding 보정이 필요 없다 — 스크롤 시 두 단이 함께 뷰포트 상단에 붙는다. */
.hn-header-wrapper{background:#ffffff;border-bottom:1px solid #e5e7eb;position:sticky;top:0;z-index:100}
.hn-header{max-width:1160px;margin:0 auto;padding:13px 18px;display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:10px 16px}
/* 브랜드 로고: 투명 PNG 심볼(logo-symbol.png) + "MK Investment" 텍스트를 inline-flex 로
   묶어 심볼과 텍스트 사이 간격을 gap 으로 통일한다(apply-logo-symbol-and-favicon, #107). */
.hn-header .hn-title{display:inline-flex;align-items:center;gap:9px;font-size:18px;font-weight:800;color:#111827;text-decoration:none;letter-spacing:-.01em;white-space:nowrap}
.hn-logo-img{width:26px;height:26px;object-fit:contain;vertical-align:middle;display:block}
/* 로고와 GNB 메뉴 사이의 구분선. 클린 화이트 헤더 전환(gnb-header-clean-white, #107)에
   맞춰 밝은 배경용 중립 경계색(#e5e7eb)으로 갱신했다. */
.hn-header-divider{display:inline-block;width:1px;height:16px;background:#e5e7eb;margin:0 4px}
.hn-header .hn-updated{font-size:13px;color:#6b7280;white-space:nowrap;margin-left:auto;text-align:right}
/* GNB(글로벌 내비게이션) — 3개 섹션 탭(경제 지표/산업 섹터/인기 종목), 현재 페이지에 active.
   개별 탭은 배경 박스(pill) 없이 언더라인으로 강조하므로(adjust-logo-badge-size-and-gnb-underline,
   #107), 탭 사이 구분은 배경색이 아니라 탭 간 gap 만으로 표현하고, hover/active 는 색상과
   하단 border 만 바뀐다(배경 박스는 쓰지 않음). */
/* 좌(hn-title)/중(gnb)/우(hn-updated) 3영역 레이아웃: DOM 순서(title→gnb→updated)를
   그대로 따르고, hn-updated 의 margin-left:auto 가 남는 여백을 흡수해 항상 우측 끝에
   고정된다. gnb 에는 별도 order 를 주지 않는다(DOM 순서 자체가 이미 중앙 위치). */
.gnb{display:flex;align-items:center;gap:6px}
.gnb-item{font-size:14.5px;font-weight:600;color:#4b5563;text-decoration:none;padding:4px 12px 6px;white-space:nowrap;background:transparent;border-bottom:2px solid transparent}
.gnb-item:hover{color:#111827}
.gnb-item.active{background:transparent;color:#111827;font-weight:700;border-bottom:2px solid #5b8def}
@media (max-width:768px){
.hn-header{padding:15px 18px 8px;gap:8px 12px}
.hn-header .hn-title{font-size:20.5px;font-weight:800}
.hn-logo-img{width:30px;height:30px}
.hn-header-divider{display:none}
.gnb{order:3;width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid #f0f0ea;padding-top:6px;padding-bottom:2px;margin-top:4px;height:26px}
.gnb-item{font-size:14px;font-weight:600;line-height:1;padding:0 10px;color:#6b7280;display:inline-flex;align-items:center;justify-content:center;height:100%;border-top:2px solid transparent;border-bottom:2px solid transparent}
.gnb-item.active{color:#111;font-weight:700;border-bottom-color:#5b8def}
.hn-header .hn-updated{font-size:12px;color:#828282}
}
/* 헤더 tier2 — 현재 페이지의 서브탭 바(macro/sector/watchlist.html). hn-header 와 같은
   sticky wrapper 안에 있으므로 스크롤 시 tier1 과 함께 고정된다. 서브탭이 없는 페이지
   (index.html/articles.html 등)는 이 요소 자체를 렌더링하지 않아 빈 바가 보이지 않는다.
   배경은 어두운 tier1(GNB)과 구분되도록 body 배경(#f6f6ef)과 동일하게 맞춰, 서브탭이
   없는 index.html 대비 페이지가 갑자기 "두꺼워" 보이지 않게 한다 — sticky 상태에서도
   body 가 실제로 비쳐 보이는 게 아니므로(고정 오버레이) transparent 대신 명시적으로
   같은 색을 지정해야 한다(#107, refine-subtab-design-and-alignment). */
.hn-subnav{background:#f6f6ef;border-top:1px solid #e5e7eb;border-bottom:1px solid #e5e5df}
/* font-size 를 tier1 GNB(14.5px/600)보다 뚜렷이 작게(13px) 낮춰 "GNB 하위" 위계를 표현.
   .subtab 자체의 색상/hover/active 규칙은 재정의하지 않고 본문(article 목록)에서 쓰는
   기본 .subtab/.subtab:hover/.subtab.active(#555→#111, active 시 밑줄)를 그대로 물려받아
   같은 컴포넌트가 밝은 배경 위에서 자연스럽게 보이도록 한다(불필요한 색상 재정의 제거). */
.hn-subnav .subtabs{max-width:1160px;margin:0 auto;padding:7px 18px 8px;font-size:13px;gap:8px 14px}
/* 3번 요구사항: 서브탭이 상위 GNB 탭과 아무 위치 관계 없이 항상 좌측 끝에 붙어 있던
   문제를 완화하기 위해, _subtabs_html()이 이미 부여하는 data-tab-group 속성(deploy.py)을
   그대로 재사용해 그룹별로 GNB상 대응 탭 위치에 근사한 좌측 오프셋을 준다. GNB 탭 폭은
   폰트 렌더링/뷰포트에 따라 달라지므로 이 값들은 어디까지나 시각적 근사치이며, 모든
   윈도우 폭에서 픽셀 단위로 정확히 맞아떨어지는 것을 보장하지 않는다. */
.hn-subnav .subtabs[data-tab-group="macro"]{padding-left:140px}
.hn-subnav .subtabs[data-tab-group="sector"]{padding-left:210px}
.hn-subnav .subtabs[data-tab-group="watchlist"]{padding-left:295px}
@media (max-width:768px){
.hn-subnav{background:#fbfbf8;border-top:1px solid #e5e7eb;border-bottom:1px solid #e2e2da}
.hn-subnav .subtabs{padding:2px 14px 3px;gap:4px 10px;font-size:11px;line-height:1.2}
.hn-subnav .subtab{padding-bottom:1px;font-size:11px;color:#6b7280;line-height:1.2}
.hn-subnav .subtab.active{color:#111;border-bottom-width:1.5px}
/* 모바일에서는 GNB 자체가 title 아래 별도 줄로 내려와 가운데 정렬되므로(.gnb 모바일 규칙,
   3bdeacd/72913b5 참고) 데스크톱 GNB 위치 기반 오프셋이 더 이상 의미가 없다 — 컨테이너와
   동일한 좌측 여백으로 리셋한다(안전한 좌측 정렬; 탭 개수가 많은 watchlist 는 기존처럼
   flex-wrap 으로 여러 줄로 감싼다). */
.hn-subnav .subtabs[data-tab-group]{padding-left:14px}
}
.hn-container{max-width:1160px;margin:0 auto;padding:22px 18px 56px}
h2.sec-title{font-size:19px;font-weight:800;color:#111;margin:0;letter-spacing:-.01em}
.hn-container>h2.sec-title{margin:22px 0 10px}
.hn-container>h2.sec-title:first-child{margin-top:4px}
.sec-header{display:flex;justify-content:space-between;align-items:baseline;margin:36px 0 10px}
.sec-header:first-child{margin-top:4px}
a.sec-more{font-size:14px;color:#6b7280;font-weight:600;text-decoration:none;white-space:nowrap}
a.sec-more:hover{color:#111;text-decoration:underline}
.back{display:inline-block;margin:2px 0 14px;font-size:14px;color:#555;text-decoration:none}
.back:hover{color:#111;text-decoration:underline}
footer{max-width:1160px;margin:44px auto 0;padding:16px 18px;border-top:1px solid #e5e5df;font-size:12px;color:#999;text-align:center}
.footer-divider{margin:0 6px;color:#ccc}
.footer-feeds{color:#777}
.footer-feeds a{color:#666;text-decoration:none}
.footer-feeds a:hover{color:#111;text-decoration:underline}
.subtabs{display:flex;flex-wrap:wrap;gap:14px 18px;margin:2px 0 14px;font-size:15px}
.subtab{position:relative;color:#555;text-decoration:none;cursor:pointer;padding-bottom:3px;border-bottom:2px solid transparent}
/* active 상태의 font-weight:700 이 텍스트 폭을 넓혀 옆 탭이 밀리는 것을 막기 위해,
   보이지 않는 bold 사본(::before)으로 항상 bold 기준 폭을 미리 확보해둔다(#107). */
.subtab::before{content:attr(data-label);display:block;height:0;overflow:hidden;visibility:hidden;font-weight:700}
.subtab:hover{color:#111}
.subtab.active{color:#111;font-weight:700;border-bottom-color:#111}
.tab-panel[hidden]{display:none}
/* 토픽 행 */
.topics{margin-top:2px}
.topic_row{display:flex;gap:11px;padding:11px 0;border-bottom:1px solid #e5e5df}
.topic_row:last-child{border-bottom:none}
.votenum{font-size:16px;color:#828282;min-width:26px;text-align:right;flex-shrink:0;line-height:1.5}
.topic_main{min-width:0;flex:1}
.topic_head{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.topic_title_wrap{min-width:0;flex:1}
.topictitle{font-size:17.5px;font-weight:700;color:#000;text-decoration:none;line-height:1.4}
.topictitle:hover{text-decoration:underline}
.topicsource{font-size:13.5px;color:#828282;margin-left:6px;font-weight:400}
.topictime{font-size:13px;color:#828282;white-space:nowrap;flex-shrink:0;font-variant-numeric:tabular-nums}
@media (max-width:480px){.topic_head{flex-wrap:wrap;gap:4px 8px}}
.report-badge{font-size:12.5px;font-weight:700;color:#2b6cb0;background:#eaf2fb;padding:1px 6px;border-radius:4px;white-space:nowrap;vertical-align:middle}
.topicdesc{font-size:15px;color:#374151;line-height:1.68;margin-top:4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.topicinfo{font-size:13px;color:#828282;margin-top:5px}
.topicinfo a{color:#828282;text-decoration:none}
.topicinfo a:hover{text-decoration:underline}
.view-more-row{padding:13px 0 2px;font-size:14px}
.view-more-row a{color:#6b7280;font-weight:600;text-decoration:none}
.view-more-row a:hover{color:#111;text-decoration:underline}
/* 대시보드 상단 — 주요 지수 티커 스트립 (index.html, #107 재구성).
   구 2x2 테마 브리핑 타일(.brief-grid/.brief-tile/.brief-history)은 대시보드로 대체되며
   제거되었다. 브리핑 히스토리로 연결할 페이지가 아직 없어 진입점 링크는 두지 않는다. */
.market-bar{background:#fff;border:1px solid #e5e5df;border-radius:8px;padding:12px 16px;margin-top:4px}
.indicator-strip{display:grid;grid-template-columns:repeat(6,1fr);gap:10px}

.ind-card{display:flex;flex-direction:column;gap:4px;padding:8px 10px;background:#f6f6ef;border:1px solid #e5e5df;border-radius:6px;min-width:0}
.ind-name{font-size:12px;color:#6b7280;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.ind-data{display:flex;align-items:baseline;justify-content:space-between;gap:6px;min-width:0}
.ind-value{font-size:14px;color:#111;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.ind-change{font-size:12px;font-weight:700;white-space:nowrap;margin-left:auto;flex-shrink:0}
.ind-card.ind-up .ind-change{color:#15803d}
.ind-card.ind-down .ind-change{color:#c53030}
.ind-card.ind-flat .ind-change,.ind-card.ind-flat .ind-value{color:#999}
@media (max-width:1024px){
.indicator-strip{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:768px){
.market-bar{padding:12px 14px}
.indicator-strip{gap:8px}
.ind-card{padding:6px 8px}
}
@media (max-width:640px){
.indicator-strip{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:380px){
.indicator-strip{grid-template-columns:1fr}
}
/* 대시보드 하단 2열 그리드 — 헤드라인 Pick / 리서치 레이더 (index.html, #107 재구성).
   항목 렌더링은 새 클래스를 만들지 않고 기존 .topics/.topic_row/.report-badge 를
   그대로 재사용한다(_topic_row) — 여기서는 레이아웃(그리드/카드 박스/구분선)과
   추천/목표주가 배지만 추가한다. */
.dashboard-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:24px}
@media (max-width:768px){.dashboard-grid{grid-template-columns:1fr}}
.dashboard-col h2.sec-title{margin:4px 0 10px}
.dash-list{background:#fff;border:1px solid #e5e5df;border-radius:8px;padding:2px 18px;margin-top:2px}
.dash-list .topic_row{border-bottom:1px solid #f0f0ea}
.dash-list .topic_row:last-child{border-bottom:none}
.rec-badge{font-size:12px;font-weight:700;color:#15803d;background:#e6f4ea;padding:1px 6px;border-radius:4px;white-space:nowrap}
.tp-badge{font-size:12px;font-weight:700;color:#744210;background:#fdf3e0;padding:1px 6px;border-radius:4px;white-space:nowrap}
/* 리서치 레이더 투자의견 모멘텀 배지([상향]/[신규]/[하향]/[고확신], #107 Step2) */
.momentum-badge{font-size:12px;font-weight:700;color:#9a3412;background:#ffedd5;padding:1px 6px;border-radius:4px;white-space:nowrap}
/* briefs.html 타임라인 (레거시 렌더러 호환) */
.brief-timeline{list-style:none;padding:0}
.brief-timeline li{padding:11px 0;border-bottom:1px solid #e5e5df}
.brief-timeline li:last-child{border-bottom:none}
a.item-title{font-size:16px;font-weight:700;color:#000;text-decoration:none}
a.item-title:hover{text-decoration:underline}
.item-preview{font-size:14px;color:#374151;line-height:1.6;margin-top:4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sentiment-chart{margin:8px 0 20px}
/* 리포트 상세 */
.report-card{background:#fff;border:1px solid #e5e5df;border-radius:8px;padding:22px 26px}
.report-card .broker{font-size:13px;color:#4a90d9;font-weight:600;margin-bottom:4px}
.report-card .report-title{font-size:20px;font-weight:800;color:#111;margin-bottom:10px;line-height:1.35}
.report-card .meta{font-size:14px;color:#666;margin-bottom:12px}
.report-card .summary{font-size:15px;color:#374151;line-height:1.75;margin-bottom:16px}
.report-card .section-label{font-size:13.5px;font-weight:700;color:#111;margin:12px 0 4px}
.report-card .risk-label{color:#c53030}
.report-card ul.kp{font-size:14px;color:#374151;padding-left:20px;margin-bottom:12px}
.report-card ul.kp li{margin-bottom:4px}
.report-card .risk-list{color:#744210}
.report-card .pdf-link a{color:#2b6cb0;font-size:14px;text-decoration:none}
.report-card .pdf-link a:hover{text-decoration:underline}
