/* ============================================================================
   calendar-panel.css — 3열 패널: 경제지표 / 증시캘린더(국내현황·해외현황·AI뉴스)
   - Views/CalendarPanel/*.cshtml 이 AJAX 로 주입되는 콘텐츠.
   - 색은 theme.css 토큰만, 글자는 13px × --fs-scale 기준 (layout-compact.css 규칙).
   - 접두어 cp- (calendar panel)
   ========================================================================== */
.cp {
    padding: 10px 12px 18px;
    color: var(--text-primary);
    font-size: calc(13px * var(--fs-scale, 1));
    line-height: 1.45;
}
.cp button { font-family: inherit; color: inherit; }

/* 머리글 */
.cp-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin: 4px 0 10px;
}
.cp-head-sub { margin: 18px 2px 8px; }
.cp-title { margin: 0; font-size: calc(15px * var(--fs-scale, 1)); font-weight: 700; letter-spacing: -.01em; }
.cp-subtitle { margin: 0; font-size: calc(14px * var(--fs-scale, 1)); font-weight: 700; }
.cp-count, .cp-muted, .cp-hint { color: var(--text-muted); font-size: calc(13px * var(--fs-scale, 1)); font-weight: 500; }
.cp-link {
    background: none; border: 0; padding: 2px 4px; cursor: pointer;
    color: var(--text-muted); font-size: calc(13px * var(--fs-scale, 1));
}
    .cp-link:hover { color: var(--text-primary); }

/* 월/주 이동 */
.cp-monthnav { display: flex; align-items: center; gap: 4px; }
.cp-month { min-width: 96px; text-align: center; font-weight: 700; }
.cp-navbtn {
    width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border-color);
    background: var(--bg-lighter); cursor: pointer; font-size: calc(16px * var(--fs-scale, 1)); line-height: 1;
}
    .cp-navbtn:hover { background: var(--bg-elevated); }
    .cp-navbtn:disabled { opacity: .35; cursor: default; }

/* 분류 칩 */
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cp-chip {
    padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border-color);
    background: transparent; color: var(--text-secondary); cursor: pointer;
    font-size: calc(13px * var(--fs-scale, 1)); font-weight: 600; transition: background .12s, color .12s, border-color .12s;
}
    .cp-chip:hover { background: var(--bg-elevated); color: var(--text-primary); }
    .cp-chip.is-on { background: var(--red-up); border-color: var(--red-up); color: var(--on-accent); }
    .cp-chip-star { color: var(--gold-text); }
    .cp-chip-star.is-on { background: var(--gold-text); border-color: var(--gold-text); color: var(--on-accent); }

/* 년/월 선택 */
.cp-ym { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.cp-select {
    height: 30px; padding: 0 28px 0 10px; border-radius: 8px; border: 1px solid var(--border-color);
    background: var(--bg-lighter) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/></svg>") no-repeat right 10px center;
    color: var(--text-primary); font-size: calc(13px * var(--fs-scale, 1)); appearance: none; -webkit-appearance: none; cursor: pointer;
}

/* 카드(경제지표) */
.cp-cards { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cp-card {
    position: relative; padding: 14px 14px 10px; border-radius: 14px;
    background: var(--bg-light); border: 1px solid var(--border-subtle);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    cursor: pointer; transition: border-color .12s, background .12s;
}
    .cp-card:hover { border-color: var(--border-strong); background: var(--bg-lighter); }
.cp-card-top { display: flex; align-items: flex-start; gap: 8px; }
.cp-card-name { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: calc(14px * var(--fs-scale, 1)); line-height: 1.35; }
.cp-card-cat { display: block; margin-top: 2px; color: var(--text-muted); font-weight: 500; font-size: calc(13px * var(--fs-scale, 1)); }
.cp-star {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent;
    color: var(--text-dim); font-size: calc(17px * var(--fs-scale, 1)); cursor: pointer; line-height: 1;
}
    .cp-star:hover { background: var(--fg-a08); color: var(--gold-text); }
    .cp-star.is-on { color: var(--gold-text); }
.cp-card-val { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.cp-card-num { font-size: calc(22px * var(--fs-scale, 1)); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cp-card-unit { color: var(--text-muted); }
.cp-card-chg { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-pill { padding: 2px 8px; border-radius: 999px; background: var(--fg-a06); }
.cp-pill.up { background: rgba(var(--red-up-rgb), .12); }
.cp-pill.down { background: rgba(var(--blue-down-rgb), .12); }
.cp-card-meta { margin-top: 2px; color: var(--text-muted); font-size: calc(13px * var(--fs-scale, 1)); }
.cp-card-chart { margin-top: 8px; height: 88px; }
.cp-card-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cp-card.is-open .cp-card-chart { height: 180px; }
.cp-card-detail { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-color); }
.cp-card.is-open .cp-card-detail { display: block; }
.cp-card-detail table { width: 100%; border-collapse: collapse; }
.cp-card-detail td { padding: 3px 0; font-variant-numeric: tabular-nums; }
.cp-card-detail td:last-child { text-align: right; font-weight: 600; }
.cp-card-detail tr + tr td { border-top: 1px solid var(--border-subtle); }

/* 스파크라인 공통 색 — 5년 추세가 상승이면 빨강, 하락이면 파랑 (국내 관례) */
.cp-line { fill: none; stroke: var(--c-blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cp-area { fill: var(--c-blue); fill-opacity: .12; }
.cp-spark.is-up .cp-line { stroke: var(--red-up); }
.cp-spark.is-down .cp-line { stroke: var(--blue-down); }
.cp-spark .cp-grad-a { stop-color: var(--c-blue); stop-opacity: .28; }
.cp-spark .cp-grad-b { stop-color: var(--c-blue); stop-opacity: 0; }
.cp-spark.is-up .cp-grad-a { stop-color: var(--red-up); }
.cp-spark.is-up .cp-grad-b { stop-color: var(--red-up); }
.cp-spark.is-down .cp-grad-a { stop-color: var(--blue-down); }
.cp-spark.is-down .cp-grad-b { stop-color: var(--blue-down); }
.cp-sentinel { height: 1px; }
.cp-axis { stroke: var(--border-color); stroke-width: 1; }
.cp-tick { fill: var(--text-muted); font-size: 11px; }
.cp-dot { fill: var(--c-blue); }

/* 행(리스트) */
.cp-section { border-radius: 14px; background: var(--bg-light); border: 1px solid var(--border-subtle); overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.cp-row {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; text-align: left;
    background: transparent; border: 0; border-top: 1px solid var(--border-subtle);
}
    .cp-row:first-child { border-top: 0; }
    button.cp-row { cursor: pointer; }
    button.cp-row:hover { background: var(--fg-a05); }
.cp-row-empty { justify-content: center; color: var(--text-muted); padding: 16px 12px; }
.cp-hidden { display: none !important; }
.cp-toggle {
    display: block; width: 100%; margin: 6px 0 0; padding: 7px; border-radius: 8px;
    border: 1px dashed var(--border-color); background: transparent; color: var(--text-muted); cursor: pointer;
}
    .cp-toggle:hover { color: var(--text-primary); background: var(--fg-a04); }

.up { color: var(--red-up); }
.down { color: var(--blue-down); }
.same { color: var(--text-muted); }

/* 배지 */
.cp-badge {
    flex: 0 0 auto; padding: 2px 7px; border-radius: 6px; font-weight: 700; color: var(--on-accent);
    font-size: calc(13px * var(--fs-scale, 1)); line-height: 1.4;
}
    .cp-badge.is-subscribe { background: #dc143c; }
    .cp-badge.is-listing { background: #0f52ba; }
    .cp-badge.is-new { background: var(--red-up); padding: 1px 6px; }

/* 국내현황 — 요일 스트립 */
.cp-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.cp-day {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0;
    border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-light); cursor: pointer;
    transition: background .12s, border-color .12s;
}
    .cp-day:hover { background: var(--bg-lighter); }
    .cp-day-dow { color: var(--text-muted); }
    .cp-day-num { font-weight: 700; font-size: calc(15px * var(--fs-scale, 1)); }
    .cp-day.is-today { border-color: var(--red-up); }
    .cp-day.is-today .cp-day-dow { color: var(--red-up); }
    .cp-day.is-selected { background: var(--pill-active-bg); border-color: var(--pill-active-bg); }
    .cp-day.is-selected .cp-day-dow, .cp-day.is-selected .cp-day-num { color: var(--on-accent); }

.cp-ipo-name { flex: 1 1 auto; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-ipo-price { flex: 0 0 auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.cp-stat { cursor: pointer; }
.cp-stat-name { flex: 1 1 auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-stat-val { flex: 0 0 auto; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cp-stat-val b { color: var(--text-primary); }
.cp-stat-chg { flex: 0 0 auto; min-width: 64px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 표(실적 발표 예정) */
.cp-table-wrap { border-radius: 12px; background: var(--bg-light); border: 1px solid var(--border-subtle); overflow: hidden; }
.cp-table { width: 100%; border-collapse: collapse; }
.cp-table th { padding: 8px 12px; text-align: left; color: var(--text-muted); font-weight: 600; background: var(--fg-a04); }
.cp-table td { padding: 9px 12px; border-top: 1px solid var(--border-subtle); font-variant-numeric: tabular-nums; }
.cp-table .r { text-align: right; }
.cp-perf { cursor: pointer; }
    .cp-perf:hover td { background: var(--fg-a05); }
.cp-perf-name { font-weight: 600; }

/* 해외현황 */
.cp-cat { margin-top: 4px; }
.cp-gind-name, .cp-usa-name { flex: 1 1 auto; min-width: 0; font-weight: 600; display: flex; flex-direction: column; }
.cp-gind-en { color: var(--text-dim); font-weight: 400; font-size: calc(13px * var(--fs-scale, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-gind-val, .cp-usa-val { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-gind-chg { flex: 0 0 auto; min-width: 64px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-usa-date { flex: 0 0 auto; color: var(--text-muted); }
.cp-cat-body.is-loading { opacity: .5; }

/* 지표 차트 팝오버(해외 지표 클릭) */
.cp-chart-box { padding: 10px 12px 12px; border-top: 1px solid var(--border-subtle); background: var(--bg-dark); }
.cp-chart-box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cp-chart-box-name { font-weight: 700; }
.cp-chart-box-val { font-weight: 800; font-variant-numeric: tabular-nums; }
.cp-chart-box svg { width: 100%; height: 150px; display: block; overflow: visible; }
.cp-chart-box-close { float: right; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }

/* AI 뉴스 */
.cp-date-head { margin: 14px 2px 6px; color: var(--text-muted); font-weight: 600; }
.cp-ai { align-items: flex-start; }
.cp-ai-icon { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(var(--blue-down-rgb), .12); color: var(--c-blue); }
.cp-ai-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cp-ai-top { display: flex; align-items: center; gap: 6px; }
.cp-ai-title { font-weight: 700; }
.cp-ai-time { margin-left: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cp-ai-desc { color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp-ai-chev { flex: 0 0 auto; color: var(--text-dim); font-size: calc(18px * var(--fs-scale, 1)); line-height: 1; align-self: center; }

/* 로딩·빈 상태·오류 */
.cp-more { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; color: var(--text-muted); }
.cp-spinner {
    width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--red-up);
    animation: cpSpin .8s linear infinite;
}
@keyframes cpSpin { to { transform: rotate(360deg); } }
.cp-empty { padding: 36px 16px; text-align: center; }
.cp-empty-title { font-weight: 700; font-size: calc(14px * var(--fs-scale, 1)); }
.cp-empty-desc { margin-top: 4px; color: var(--text-muted); }
.cp-error { padding: 36px 16px; text-align: center; color: var(--text-secondary); }
.cp-error-icon { width: 36px; height: 36px; margin: 0 auto 8px; border-radius: 50%; background: rgba(var(--red-up-rgb), .15); color: var(--red-up); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.cp-btn { margin-top: 10px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg-lighter); cursor: pointer; }
.cp-loading { padding: 40px 0; display: flex; justify-content: center; }

/* 패널 래퍼: 예전 iframe 래퍼(#CalendarContent/#EconomicIndicatorContent)를 그대로 쓰되 높이·스크롤은 3열 카드가 맡는다 */
html body #CalendarContent.cp-host,
html body #EconomicIndicatorContent.cp-host {
    display: block; height: auto !important; max-height: none !important; overflow: visible !important; width: 100% !important;   /* 래퍼 인라인(max-height:100%; overflow:hidden) 보다 우선 — 아니면 열이 아니라 래퍼가 잘라서 아래 내용을 못 본다 */
    transform: none; position: static; z-index: auto; background: transparent;
}

/* IPO 상세 모달 */
.cp-modal-overlay { position: fixed; inset: 0; z-index: 10060; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cp-modal { width: 100%; max-width: 380px; border-radius: 14px; background: var(--bg-dark); border: 1px solid var(--border-color); box-shadow: 0 16px 48px rgba(0, 0, 0, .35); overflow: hidden; }
.cp-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); font-weight: 700; font-size: calc(15px * var(--fs-scale, 1)); }
.cp-modal-close { border: 0; background: transparent; color: var(--text-muted); font-size: calc(20px * var(--fs-scale, 1)); cursor: pointer; line-height: 1; }
.cp-modal-body { padding: 6px 14px 12px; }
.cp-modal-body table { width: 100%; border-collapse: collapse; }
.cp-modal-body th { text-align: left; padding: 7px 0; color: var(--text-muted); font-weight: 500; width: 38%; }
.cp-modal-body td { text-align: right; padding: 7px 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-modal-body tr + tr th, .cp-modal-body tr + tr td { border-top: 1px solid var(--border-subtle); }

/* ───────── AI 뉴스 상세 (브리핑) ───────── */
.cp-back { border: 0; background: var(--bg-lighter); color: var(--text-primary); padding: 5px 10px 5px 8px; border-radius: 8px; cursor: pointer; font-weight: 600; }
    .cp-back:hover { background: var(--bg-elevated); }
.cp-ab-hero { padding: 14px 14px 12px; border-radius: 14px; background: linear-gradient(180deg, rgba(var(--blue-down-rgb), .14), rgba(var(--blue-down-rgb), .04)); border: 1px solid rgba(var(--blue-down-rgb), .25); margin-bottom: 10px; }
.cp-ab-type { display: flex; align-items: center; gap: 8px; }
.cp-badge.is-type { background: var(--c-blue); }
.cp-ab-title { font-weight: 800; font-size: calc(15px * var(--fs-scale, 1)); }
.cp-ab-headline { margin-top: 8px; font-weight: 700; line-height: 1.5; }
.cp-ab-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 4px; }
.cp-ab-tabs::-webkit-scrollbar { display: none; }
.cp-ab-tab { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border-color); background: transparent; color: var(--text-secondary); cursor: pointer; font-weight: 600; }
    .cp-ab-tab.is-on, .cp-ab-tab:hover { background: var(--bg-elevated); color: var(--text-primary); }
.cp-ab-snap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cp-ab-card { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--bg-light); text-align: left; cursor: pointer; min-width: 0; }
    .cp-ab-card:hover { background: var(--bg-lighter); }
.cp-ab-card-l { min-width: 0; }
.cp-ab-nm { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-ab-vl { font-weight: 800; font-size: calc(15px * var(--fs-scale, 1)); font-variant-numeric: tabular-nums; }
.cp-ab-ch { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-ab-card.up .cp-ab-ch { color: var(--red-up); } .cp-ab-card.down .cp-ab-ch { color: var(--blue-down); } .cp-ab-card.same .cp-ab-ch { color: var(--text-muted); }
.cp-ab-spark { flex: 0 0 60px; height: 30px; }
.cp-ab-spark svg { width: 100%; height: 100%; display: block; }
.cp-ab-line { align-items: flex-start; }
.cp-ab-ck { flex: 0 0 auto; color: var(--c-green); font-weight: 800; }
.cp-ab-issue, .cp-ab-sched { padding: 12px 14px; margin-bottom: 8px; }
.cp-ab-issue-h { font-weight: 800; font-size: calc(14px * var(--fs-scale, 1)); margin-bottom: 6px; }
.cp-ab-issue-ln { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; color: var(--text-secondary); }
.cp-ab-n { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--fg-a08); color: var(--text-primary); font-size: calc(13px * var(--fs-scale, 1)); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; margin-top: 1px; }
.cp-ab-chips { margin: 8px 0 0; }
.cp-chip-stk { cursor: pointer; }
.cp-ab-sched-t { font-weight: 700; }
.cp-ab-sched-p { margin-top: 4px; color: var(--text-secondary); padding-left: 12px; border-left: 2px solid var(--c-blue); }
.cp-ab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cp-ab-gcell { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-light); cursor: pointer; min-width: 0; }
    .cp-ab-gcell:hover { background: var(--bg-lighter); }
.cp-ab-gnm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-ab-grt { font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-ab-foot { margin-top: 16px; color: var(--text-dim); font-size: calc(13px * var(--fs-scale, 1)); text-align: center; }

/* 서브메뉴(position:absolute, --submenu-h)가 항상 열려 있으므로 래퍼 첫 줄이 가려지지 않게 그만큼 내린다 (JS 의 margin 초기화보다 우선) */
html body #CalendarContent.cp-host,
html body #EconomicIndicatorContent.cp-host { margin-top: var(--submenu-h, 60px) !important; }

/* ───────── 경제지표 상세 ───────── */
.cp-ed-hero { padding: 14px 14px 12px; border-radius: 14px; background: var(--bg-light); border: 1px solid var(--border-subtle); margin-bottom: 10px; }
.cp-ed-titlerow { display: flex; align-items: flex-start; gap: 8px; }
.cp-ed-name { flex: 1 1 auto; min-width: 0; margin: 0; font-size: calc(16px * var(--fs-scale, 1)); font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
.cp-star-lg { font-size: calc(20px * var(--fs-scale, 1)); }
.cp-ed-val { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cp-ed-num { font-size: calc(26px * var(--fs-scale, 1)); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cp-ed-unit { color: var(--text-muted); }
.cp-ed-val .cp-pill { margin-left: auto; }
.cp-ed-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; color: var(--text-muted); font-size: calc(13px * var(--fs-scale, 1)); }
.cp-ed-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 8px; }
.cp-ed-ranges { display: flex; gap: 4px; flex-wrap: wrap; }
.cp-ed-chart { position: relative; border-radius: 14px; background: var(--bg-light); border: 1px solid var(--border-subtle); padding: 8px 6px 4px; overflow: hidden; }
.cp-ed-chart svg { display: block; width: 100%; height: auto; }
.cp-ed-grid { stroke: var(--border-subtle); stroke-width: 1; }
.cp-ed-zero { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.cp-ed-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cp-ed-cross { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.cp-ed-hit { cursor: crosshair; }
.cp-ed-tip { position: absolute; z-index: 2; pointer-events: none; min-width: 120px; max-width: 80%; padding: 8px 10px; border-radius: 10px; background: var(--tooltip-bg, rgba(28, 30, 34, .94)); color: var(--tooltip-fg, #fff); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); font-size: calc(13px * var(--fs-scale, 1)); }
.cp-ed-tip-t { font-weight: 700; margin-bottom: 4px; opacity: .85; }
.cp-ed-tip-r { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
    .cp-ed-tip-r i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
    .cp-ed-tip-r span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
    .cp-ed-tip-r b { font-variant-numeric: tabular-nums; }
.cp-ed-compare { margin-top: 10px; }
.cp-ed-search { position: relative; display: flex; align-items: center; }
.cp-ed-search-ico { position: absolute; left: 10px; color: var(--text-muted); font-size: calc(15px * var(--fs-scale, 1)); pointer-events: none; }
.cp-ed-input { width: 100%; box-sizing: border-box; padding: 9px 12px 9px 30px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-light); color: var(--text-primary); font-size: calc(13px * var(--fs-scale, 1)); outline: none; }
    .cp-ed-input:focus { border-color: var(--c-blue); }
    .cp-ed-input::placeholder { color: var(--text-muted); }
.cp-ed-dd { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 260px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-dark); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); padding: 4px; }
.cp-ed-dd-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
    .cp-ed-dd-item:hover { background: var(--bg-lighter); }
    .cp-ed-dd-item small { color: var(--text-muted); flex: 0 0 auto; }
.cp-ed-dd-empty { padding: 12px; text-align: center; color: var(--text-muted); }
.cp-ed-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.cp-ed-lg { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: var(--bg-light); border: 1px solid var(--border-subtle); font-size: calc(13px * var(--fs-scale, 1)); }
    .cp-ed-lg i { width: 8px; height: 8px; border-radius: 50%; }
.cp-ed-lg-x { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 0 0 0 2px; font-size: calc(15px * var(--fs-scale, 1)); line-height: 1; }
    .cp-ed-lg-x:hover { color: var(--red-up); }
.cp-ed-lg-note { flex-basis: 100%; }
.cp-ed-table { width: 100%; border-collapse: collapse; }
    .cp-ed-table th { text-align: left; padding: 6px 4px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border-color); }
    .cp-ed-table th:not(:first-child), .cp-ed-table td:not(:first-child) { text-align: right; }
    .cp-ed-table td { padding: 8px 4px; border-bottom: 1px solid var(--border-subtle); font-variant-numeric: tabular-nums; }
.cp-ed-paging { display: flex; justify-content: center; gap: 4px; margin-top: 10px; }
.cp-ed-pg { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border-subtle); background: var(--bg-light); cursor: pointer; }
    .cp-ed-pg.is-on { background: var(--red-up); border-color: var(--red-up); color: var(--on-accent); font-weight: 700; }   /* 기간 칩(.cp-chip.is-on) 과 동일 — 흰색 테마에서도 보이게 */
    .cp-ed-pg:not(:disabled):not(.is-on):hover { background: var(--bg-lighter); border-color: var(--border-strong); }
    .cp-ed-pg:disabled { opacity: .4; cursor: default; }
/* 목록 카드: 상세로 이동하므로 접힘 표는 더 이상 없음. 스파크라인은 카드 안에서 끝까지 보이게 */
.cp-card-chart { overflow: hidden; border-radius: 8px; }
.cp-card-chart svg { overflow: hidden; }

/* 긴 숫자(예: 채권거래대금 46,674,199,786,256)가 와도 카드/열이 옆으로 늘어나지 않게 */
.cp-cards { grid-template-columns: minmax(0, 1fr); }
.cp-card { min-width: 0; overflow: hidden; }
.cp-card-val { flex-wrap: wrap; }
.cp-card-num, .cp-ed-num { min-width: 0; overflow-wrap: anywhere; }
.cp-card-chg { max-width: 100%; }
.cp-ed-table td, .cp-ed-tip-r b { overflow-wrap: anywhere; }

/* 해외현황 상세 */
.cp-foreigndetail .cp-ed-name .cp-gind-en { display: block; margin-top: 2px; font-weight: 500; }
.cp-gind, .cp-usa { cursor: pointer; }

/* ───────── AI 브리핑 팝업 (openBriefPopup) ───────── */
.rightside-popup-cp { width: min(92vw, 720px); height: 88vh; max-width: none; display: flex; flex-direction: column; background: var(--bg-dark); }
    .rightside-popup-cp .rightside-popup-header { flex: 0 0 auto; padding: 14px 18px; }
    .rightside-popup-cp .rightside-popup-content { flex: 1 1 auto; max-height: none; min-height: 0; overflow-y: auto; padding: 0 10px 14px; overscroll-behavior: contain; }
    .rightside-popup-cp .rightside-popup-date { font-variant-numeric: tabular-nums; }
    .rightside-popup-cp .cp { padding-top: 8px; }
.rightside-popup-ai { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 8px; background: linear-gradient(90deg, #1e3a8a, #064e3b); font-size: 15px; }

/* ───────── AI 브리핑 책갈피 탭: 스크롤해도 위에 붙어 있게 ───────── */
.cp-ab-tabs { position: sticky; top: var(--cp-sticky-top, 0px); z-index: 6; background: var(--bg-dark); padding: 6px 0; margin: 0 0 4px; }
#CalendarContent .cp-ab-tabs { --cp-sticky-top: var(--rmenu-h, 56px); }
#cpAiBrief [id^="cpAb"] { scroll-margin-top: calc(var(--cp-sticky-top, 0px) + 52px); }
#CalendarContent #cpAiBrief [id^="cpAb"] { --cp-sticky-top: var(--rmenu-h, 56px); }

/* ───────── IPO 상세 카드 ───────── */
.cp-modal--ipo { max-width: 420px; }
.cp-ipo-d { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.cp-ipo-hero { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-ipo-hero-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cp-ipo-hero-name { font-size: calc(17px * var(--fs-scale, 1)); font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-badge.is-sub { background: rgba(var(--red-up-rgb), .15); color: var(--red-up); }
.cp-badge.is-listing { background: rgba(var(--blue-down-rgb), .15); color: var(--blue-down); }
.cp-pill-btn { flex: 0 0 auto; border: 1px solid var(--border-strong); background: var(--bg-lighter); color: var(--text-primary); padding: 6px 10px; border-radius: 999px; cursor: pointer; font-weight: 600; }
    .cp-pill-btn:hover { background: var(--bg-elevated); }
.cp-ipo-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--bg-light); border: 1px solid var(--border-subtle); }
.cp-ipo-price-v { font-size: calc(24px * var(--fs-scale, 1)); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cp-ipo-band { margin-left: auto; color: var(--text-muted); }
.cp-ipo-k { color: var(--text-muted); font-size: calc(13px * var(--fs-scale, 1)); }
.cp-ipo-tl { list-style: none; margin: 0; padding: 4px 0 0 4px; display: flex; flex-direction: column; }
.cp-ipo-step { position: relative; display: flex; gap: 12px; padding: 0 0 14px 0; }
    .cp-ipo-step::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: -2px; width: 2px; background: var(--border-color); }
    .cp-ipo-step:last-child::before { display: none; }
    .cp-ipo-step:last-child { padding-bottom: 0; }
.cp-ipo-dot { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--bg-dark); position: relative; z-index: 1; }
.cp-ipo-step.is-done .cp-ipo-dot { background: var(--text-muted); border-color: var(--text-muted); }
.cp-ipo-step.is-now .cp-ipo-dot { background: var(--red-up); border-color: var(--red-up); box-shadow: 0 0 0 4px rgba(var(--red-up-rgb), .18); }
.cp-ipo-step.is-soon .cp-ipo-dot { border-color: var(--c-blue); }
.cp-ipo-step-body { flex: 1 1 auto; min-width: 0; }
.cp-ipo-step-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-ipo-dday { font-weight: 700; font-size: calc(13px * var(--fs-scale, 1)); padding: 2px 8px; border-radius: 999px; background: var(--fg-a05); color: var(--text-secondary); }
.cp-ipo-step.is-now .cp-ipo-dday { background: rgba(var(--red-up-rgb), .15); color: var(--red-up); }
.cp-ipo-step.is-soon .cp-ipo-dday { background: rgba(var(--blue-down-rgb), .12); color: var(--c-blue); }
.cp-ipo-step.is-done { opacity: .7; }
.cp-ipo-step-date { color: var(--text-secondary); font-variant-numeric: tabular-nums; margin-top: 2px; }
.cp-ipo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cp-ipo-cell { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; background: var(--bg-light); border: 1px solid var(--border-subtle); min-width: 0; }
.cp-ipo-v { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cp-ipo-cell.is-big .cp-ipo-v { font-size: calc(16px * var(--fs-scale, 1)); }
.cp-ipo-under { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cp-chip-sm { padding: 3px 8px; border-radius: 999px; background: var(--fg-a05); border: 1px solid var(--border-subtle); font-size: calc(13px * var(--fs-scale, 1)); }
