/* 기업정보·캘린더 — style.css / compound.css 토큰 재사용 */
:root {
  --ev-earn: #2f6fed;
  --ev-div: #12917f;
  --ev-agm: #7c4dff;
  --ev-disc: #b87700;
  --ev-report: #7b8494;
}
@media (prefers-color-scheme: dark) {
  :root { --ev-earn: #5b8cff; --ev-div: #26a592; --ev-agm: #8f6cff; --ev-disc: #e0a526; --ev-report: #7d8697; }
}

.cc { display: flex; flex-direction: column; gap: 12px; }
.cc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cc-head h2 { margin: 0; font-size: 14px; }
.cc-head > :last-child:not(h2) { margin-left: auto; }
.cc-na { color: var(--muted); font-size: 12px; font-weight: 500; }
.cc-asof { margin-top: 10px; font-size: 11px; color: var(--muted); }
.cc-asof b { color: var(--danger); font-weight: 600; }

/* 종목 선택 */
.cc-picker { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.cc-pick {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px;
  padding: 7px 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.cc-pick:hover { background: var(--surface-2); }
.cc-pick.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cc-held { font-style: normal; font-size: 10px; margin-left: 5px; padding: 0 5px; border-radius: 4px; background: var(--up-bg); color: var(--up); vertical-align: 1px; }
.cc-pick.on .cc-held { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* 요약 */
.cc-summary { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 12px 16px; }
.cc-sum-title { font-weight: 800; }
.cc-sum-title small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.cc-sum-items { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.cc-sum-items div { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--ink-2); }
.cc-sum-items b { color: var(--ink); font-size: 15px; }
.cc-sum-next { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.cc-sum-next em, .cc-dd { font-style: normal; font-weight: 800; color: var(--accent); }
.cc-sum-next em.today, .cc-dd.today { color: #fff; background: var(--up); border-radius: 4px; padding: 0 5px; }

/* 레이아웃 */
.cc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.cc-grid.all { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.cc-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* 기업 기본정보 */
.cc-prof-head { display: flex; gap: 10px; align-items: center; }
.cc-prof-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.cc-logo { border-radius: 10px; background: #fff; border: 1px solid var(--line); object-fit: contain; }
.cc-price { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 8px; flex-wrap: wrap; }
.cc-price b { font-size: 24px; letter-spacing: -0.02em; }
.cc-price span { font-weight: 700; font-size: 13px; }
.cc-dl { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.cc-dl dt { color: var(--muted); }
.cc-dl dd { margin: 0; font-weight: 600; min-width: 0; }
.cc-biz { font-weight: 400 !important; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cc-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; font-weight: 600; }

/* 지표 */
.cc-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cc-m { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.cc-m-lab { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.cc-m-val { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; line-height: 1.3; }
.cc-m-sub { font-size: 10px; color: var(--muted); }
.cc-q {
  width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-size: 10px; line-height: 13px; padding: 0; cursor: pointer; flex: none;
}
.cc-q:hover { color: var(--ink); border-color: var(--muted); }
.cc-help { font-size: 11px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }
.cc-range { margin-top: 6px; }
.cc-range-bar { position: relative; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--down-bg), var(--up-bg)); margin: 8px 0 4px; }
.cc-range-bar i { position: absolute; top: -4px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.cc-range-lab { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }

/* 최근 실적 */
.cc-latest { border-top: 3px solid var(--accent); }
.cc-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.cc-tag.done { background: var(--done-bg); color: var(--plan); }
.cc-lq-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.cc-lq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.cc-lq-grid div { display: flex; flex-direction: column; min-width: 0; }
.cc-lq-grid span { font-size: 11px; color: var(--muted); }
.cc-lq-grid b { font-size: 16px; }
.cc-lq-grid em { font-style: normal; font-size: 12px; font-weight: 700; }
.cc-cons { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; }
.cc-cons-title { color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }
.cc-cons-row { display: flex; gap: 4px 14px; flex-wrap: wrap; color: var(--ink-2); }
.cc-exp, .cc-conf { font-style: normal; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; white-space: nowrap; }
.cc-exp { color: var(--muted); border: 1px dashed var(--muted); }
.cc-conf { color: var(--plan); border: 1px solid var(--plan); }

/* 분기 차트 */
.cc-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cc-chart-title { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cc-chart svg { width: 100%; height: auto; display: block; }
.cc-base { stroke: var(--line); stroke-width: 1; }
.cc-bar { fill: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.cc-bar.last { fill: var(--accent); }
.cc-bar.neg { fill: color-mix(in srgb, var(--down) 55%, var(--surface)); }
.cc-bar-lab { font-size: 10px; font-weight: 700; fill: var(--ink); }
.cc-axis { font-size: 10px; fill: var(--muted); }
g[data-tip]:hover .cc-bar { filter: brightness(1.1); }
.cc-qtable-wrap { overflow-x: auto; margin-top: 10px; }
.cc-qtable { width: 100%; border-collapse: collapse; font-size: 12px; }
.cc-qtable th, .cc-qtable td { padding: 6px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.cc-qtable th { color: var(--muted); font-weight: 500; }
.cc-qtable th:first-child, .cc-qtable td:first-child { text-align: left; }
.cc-qtable tbody tr:first-child td { font-weight: 700; }

/* 다가오는 일정 */
.cc-up { list-style: none; margin: 0; padding: 0; }
.cc-up li { display: flex; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.cc-up li:hover { background: var(--surface-2); }
.cc-up li.first { background: var(--cur-bg); }
.cc-dd { width: 54px; flex: none; font-size: 14px; text-align: center; align-self: flex-start; }
.cc-up-date { font-size: 11px; color: var(--muted); }
.cc-up-title { font-weight: 700; font-size: 13px; }
.cc-up-note { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cc-stock { display: inline-block; font-size: 10px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-right: 4px; vertical-align: 1px; }

/* 공시 */
.cc-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cc-seg button { border: 0; background: var(--surface); padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); }
.cc-seg button.on { background: var(--surface-2); color: var(--ink); }
.cc-disc { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.cc-disc li { border-bottom: 1px solid var(--line); }
.cc-disc a { display: flex; flex-direction: column; gap: 2px; padding: 7px 6px 7px 10px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
.cc-disc a:hover { background: var(--surface-2); }
.cc-disc li.imp a { border-left-color: var(--ev-disc); }
.cc-disc-meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.cc-disc-title { font-size: 13px; font-weight: 500; }
.cc-disc li.imp .cc-disc-title { font-weight: 700; }
.cc-dtag { font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); }
.cc-dtag.t-earnings { color: var(--ev-earn); }
.cc-dtag.t-dividend { color: var(--ev-div); }
.cc-dtag.t-buyback, .cc-dtag.t-buybackBurn, .cc-dtag.t-capital, .cc-dtag.t-merger, .cc-dtag.t-split, .cc-dtag.t-owner, .cc-dtag.t-contract, .cc-dtag.t-invest { color: var(--ev-disc); }
.cc-dtag.t-halt, .cc-dtag.t-lawsuit { color: var(--danger); }

/* 캘린더 */
.cc-cal-nav { display: flex; align-items: center; gap: 6px; }
.cc-cal-nav b { min-width: 96px; text-align: center; }
.cc-legend { display: flex; gap: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.cc-cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.cc-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cc-wd { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 6px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cc-wd.sun, .cc-cell.sun .cc-dnum { color: var(--up); }
.cc-wd.sat, .cc-cell.sat .cc-dnum { color: var(--down); }
.cc-cell {
  min-height: 92px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface);
  padding: 4px; text-align: left; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; font: inherit; color: inherit;
}
.cc-cell.cc-blank { background: var(--surface-2); cursor: default; }
.cc-cell:not(.cc-blank):hover { background: var(--surface-2); }
.cc-cell.today .cc-dnum { background: var(--accent); color: #fff; border-radius: 999px; }
.cc-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cc-dnum { font-size: 12px; font-weight: 700; width: 22px; height: 22px; display: grid; place-items: center; }
.cc-evs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-ev {
  display: flex; gap: 3px; align-items: center; font-size: 11px; line-height: 1.3; border-radius: 4px; padding: 1px 4px; min-width: 0;
  background: color-mix(in srgb, var(--ev-report) 12%, transparent); border-left: 2px solid var(--ev-report);
}
.cc-ev-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-ev.t-earnings { background: color-mix(in srgb, var(--ev-earn) 12%, transparent); border-left-color: var(--ev-earn); }
.cc-ev.t-dividend { background: color-mix(in srgb, var(--ev-div) 12%, transparent); border-left-color: var(--ev-div); }
.cc-ev.t-agm, .cc-ev.t-ir { background: color-mix(in srgb, var(--ev-agm) 12%, transparent); border-left-color: var(--ev-agm); }
.cc-ev.t-disclosure { background: color-mix(in srgb, var(--ev-disc) 12%, transparent); border-left-color: var(--ev-disc); }
.cc-ev.exp { border-left-style: dashed; opacity: 0.85; }
.cc-more { font-size: 10px; color: var(--muted); padding-left: 4px; }
.cc-day { border: 1px solid var(--line); border-radius: 10px; padding: 12px; align-self: start; max-height: 560px; overflow: auto; }
.cc-day-title { font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.cc-di { padding: 8px 0 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cc-di-title { font-weight: 700; font-size: 13px; }
.cc-kv { display: flex; gap: 8px; align-items: baseline; font-size: 12px; flex-wrap: wrap; }
.cc-kv span { color: var(--muted); min-width: 64px; }
.cc-kv em { font-style: normal; font-weight: 700; }

@media (max-width: 1200px) {
  .cc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cc-grid #ccCol3 { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .cc-grid.all #ccCol3 { grid-template-columns: 1fr; }
  .cc-cal-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .cc-grid, .cc-grid #ccCol3 { grid-template-columns: 1fr; }
  .cc-sum-next { margin-left: 0; }
  .cc-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-lq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cc-charts { grid-template-columns: 1fr; }
  .cc-cell { min-height: 54px; padding: 2px; }
  .cc-ev { padding: 0 2px; font-size: 12px; border-left-width: 0; background: none !important; }
  .cc-ev-t { display: none; } /* 폰에서는 아이콘만, 상세는 날짜 누르면 아래 패널 */
  .cc-evs { flex-direction: row; flex-wrap: wrap; }
  .cc-legend { width: 100%; }
}
