/* Bklit islands inherit service tokens. Tailwind utilities are scoped by build.mjs. */
.bklit-root {
  --bklit-calendar-low: color-mix(in srgb, var(--blue) 58%, var(--surface));
  --bklit-calendar-medium: color-mix(in srgb, var(--blue) 80%, var(--surface));
  --foreground: var(--text); --background: var(--surface); --muted-foreground: var(--muted);
  --chart-background: var(--surface); --chart-foreground: var(--text); --chart-foreground-muted: var(--muted);
  --chart-label: var(--muted); --chart-line-primary: var(--chart-1); --chart-line-secondary: var(--chart-2);
  --chart-grid: var(--line); --chart-crosshair: var(--muted); --chart-tooltip-background: var(--surface);
  --chart-tooltip-shadow: 0 4px 12px rgb(0 0 0 / 8%), var(--shadow);
  --chart-indicator-color: var(--blue); --chart-indicator-secondary-color: var(--line);
  --chart-brush-border: var(--blue); --chart-segment-background: var(--blue-soft); --chart-segment-line: var(--blue);
  --legend: var(--surface); --legend-foreground: var(--text-soft); --legend-muted: var(--surface-alt);
  --legend-muted-foreground: var(--muted); --legend-track: var(--line);
  min-width: 0; width: 100%; color: var(--text); font-size: 12px; line-height: 1.5;
}
.bklit-root *, .bklit-root *::before, .bklit-root *::after { box-sizing: border-box; }
.bklit-root svg { max-width: 100%; }
.bklit-root button, .bklit-root input { font: inherit; }
.bklit-root button { cursor: pointer; }
.bklit-root button:disabled { cursor: default; opacity: .45; }
.bklit-root :is(button, input, summary):focus-visible, [data-bklit-values] summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.bklit-host { min-width: 0; width: 100%; }
.bklit-host:not([data-ready]) .bklit-root:empty { display: none; }
.bklit-host[data-ready]:not([data-keep-values]) > [data-bklit-fallback] { display: none; }
[data-bklit-values] summary { display: none; color: var(--muted); cursor: pointer; padding: 8px 0; font-size: 12px; }
[data-ready] [data-bklit-values] summary { display: list-item; margin-left: 16px; }
[data-ready] [data-bklit-values] .dashboard-track, [data-ready] [data-bklit-values] .dashboard-column-bar { display: none; }
[data-ready] [data-bklit-values] .dashboard-bar { grid-template-columns: minmax(0,1fr) auto; }
[data-ready] [data-bklit-values] .dashboard-columns { height: auto; }
.bklit-host[data-chart-error]::before { content: "차트 대신 확인한 수치를 표시합니다."; color: var(--muted); font-size: 12px; }
.bklit-host[data-bklit-kind="bar"] { container: bklit-bar / inline-size; }
/* 원본 차트는 폭에서 좌우 여백을 빼므로 리사이즈 중에도 양의 그리기 폭을 보장한다. */
.bklit-bar-frame { width: 100%; min-width: 220px; }
@container bklit-bar (max-width:219px) {
  .bklit-root { display:none; }
}
.bklit-bar-frame > div { height: 100%; }
.bklit-root .bklit-legend { display: flex; flex-flow: row wrap; gap: 4px 8px; margin-top: 10px; }
.bklit-root .bklit-legend.is-vertical { flex-direction: column; }
.bklit-root .bklit-legend-item { padding: 0; border-radius: 6px; }
.bklit-legend-item button { display:flex; align-items:center; gap:6px; padding:5px 4px; border:0; border-radius:6px; background:transparent; color:var(--text-soft); }
.bklit-legend-item button:hover, .bklit-legend-item button:focus-visible { background: var(--surface-alt); }
.bklit-legend-item :is(span,button) { font-size: 12px; }
/* 원본 패널은 그대로 사용하고 서비스 토큰으로 외곽선 대신 음영을 적용한다. */
.bklit-root .bklit-hover-panel > div {
  border: 0;
  border-radius: 12px;
  box-shadow: var(--chart-tooltip-shadow);
}
.bklit-root .bklit-hover-panel > div::before { box-shadow: none; }
.bklit-root .bklit-hover-panel .border-b { border-color: var(--line); }
/* 달력의 실제 그리기 폭보다 툴팁이 넓어 왼쪽으로 뒤집히는 것을 막는다.
   원본의 세로 위치/애니메이션은 유지하고 패널을 달력 안쪽에 맞춘다. */
.bklit-root .bklit-calendar-tooltip { left: 0 !important; width: 100%; max-width: 260px; }
.bklit-root .bklit-calendar-tooltip > div { min-width: 0; overflow-wrap: anywhere; }
.bklit-tooltip { min-width: 140px; max-width: min(260px,70vw); padding: 12px 14px; color: var(--text); }
.bklit-tooltip > strong { display: block; font-size: 12px; margin-bottom: 8px; overflow-wrap: anywhere; }
.bklit-tooltip > div { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 5px 0; }
.bklit-tooltip i { width: 7px; height: 7px; border-radius: 50%; }
.bklit-tooltip b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.bklit-tooltip small { color: var(--muted); }
.bklit-insights-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,1fr); gap: 14px; margin: 16px 0; align-items: stretch; }
.bklit-insights-grid > .dashboard-chart { display:flex; flex-direction:column; }
.bklit-insights-grid > .dashboard-chart > .dashboard-chart-body { flex:1; }
.bklit-insights-grid > .dashboard-chart:has(.bklit-dashboard-cohort) > .dashboard-chart-body { display:flex; }
.bklit-insights-grid [data-bklit-kind="cohort"], .bklit-insights-grid [data-bklit-kind="cohort"] > .bklit-root { display:flex; flex-direction:column; flex:1; }
.bklit-root .bklit-dashboard-cohort { flex:1; flex-direction:column; flex-wrap:nowrap; gap:20px; padding-top:10px; }
.bklit-dashboard-cohort > .bklit-legend { align-self:stretch; gap:6px; margin:0; }
.bklit-dashboard-cohort .bklit-legend-item button { width:100%; padding:10px 6px; }
.bklit-dashboard-cohort .bklit-legend-item button > span:last-child { margin-left:auto; }
.bklit-dashboard-cohort .bklit-legend-item { width:100%; }
.bklit-dashboard-cohort > .bklit-note { flex-basis:auto; margin-top:auto; padding-top:14px; border-top:1px solid var(--line); }
.bklit-sparkline { margin: 12px 0; }
.bklit-sparkline-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; min-height: 20px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.bklit-sparkline-label strong { color: var(--text-soft); white-space: nowrap; }
.bklit-sparkline-dates { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.bklit-sparkline.is-compact { margin: 4px 0; }
.bklit-sparkline.is-compact .bklit-sparkline-label { margin: 6px 0 2px; }
.dashboard-intake .bklit-sparkline-label :is(strong, span), .dashboard-intake .bklit-sparkline-dates span { font-size: 12px; line-height: 1.6; letter-spacing: 0; }
.dashboard-intake .bklit-sparkline-label strong { font-weight: 600; }
.dashboard-intake .bklit-data { margin-top: 2px; }
.bklit-sparkline-table { max-height: 260px; overflow: auto; }
.bklit-sparkline-table :is(td, th):last-child { text-align: right; font-variant-numeric: tabular-nums; }
.effort-answer-sparkline .bklit-sparkline { margin: 0; }
.bklit-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.bklit-range label { display: grid; gap: 4px; color: var(--muted); min-width: 0; }
.bklit-range input { width: 132px; max-width:100%; min-width:0; padding:6px 7px; height:36px; font-size:13px; border:1px solid var(--line); border-radius:8px; color:var(--text); background:var(--surface); }
.bklit-range button { height: 36px; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-soft); background: var(--surface); }
.bklit-range button:hover:not(:disabled) { background: var(--surface-alt); }
.bklit-selection { font-size:13px; color:var(--text-soft); margin:14px 0 4px; }
.bklit-selection strong { color:var(--text); font-variant-numeric:tabular-nums; }
.bklit-selection span { font-size:12px; color:var(--muted); }
.bklit-brush { border-radius:8px; background:var(--surface-alt); margin:8px 0; }
.bklit-note { font-size:12px; line-height:1.6; color:var(--muted); margin:8px 0; overflow-wrap:anywhere; }
.bklit-empty { font-size:12px; color:var(--muted); padding:12px 0; margin:0; }
.bklit-data { margin-top:8px; color:var(--text-soft); font-size:12px; }
.bklit-data summary { cursor:pointer; padding:6px 0; }
.bklit-data table { width:100%; border-collapse:collapse; font-size:12px; }
.bklit-data :is(td,th) { text-align:left; padding:6px 8px; border-bottom:1px solid var(--line); }
.bklit-data th { font-weight:600; }
.bklit-cohort { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; }
.bklit-cohort > .bklit-note { flex-basis:100%; }
.bklit-calendar-grid { display:flex; gap:8px; align-items:flex-start; margin:12px 0; }
.bklit-weekdays { display:grid; grid-template-rows:repeat(7,22px); gap:5px; width:16px; flex-shrink:0; color:var(--muted); font-size:12px; text-align:center; }
.bklit-weekdays span { line-height:22px; }
.bklit-calendar-grid > div:last-child { flex:1; min-width:0; }
.bklit-due-day { display:grid; gap:5px; padding:8px 0; border-top:1px solid var(--line); }
.bklit-due-day button { border:0; background:var(--surface-alt); color:var(--blue); padding:7px; border-radius:8px; text-align:left; overflow-wrap:anywhere; }
.workspace-side { overflow-y:auto; min-height:0; }
@media(max-width:1100px){ .bklit-insights-grid { grid-template-columns:1fr; } }
@media(max-width:600px){ .bklit-range label { flex:1; } .bklit-range input { width:100%; } .bklit-insights-grid { gap:12px; } }
@media(prefers-reduced-motion:reduce){ .bklit-root *, .bklit-root *::before, .bklit-root *::after { animation-duration:0s !important; transition-duration:0s !important; } }
/* 기존 작은 차트의 높이 제한은 새 추이·범례를 자르지 않도록 해제한다. */
.dashboard-chart .dashboard-chart-body:has(.bklit-host) { max-height:none; overflow:visible; }
.dashboard-grid:has(.bklit-host) { align-items:stretch; }
/* 전체 팀원은 유지하면서 행 간격만 줄여 분포 구역을 짧게 한다. */
.dashboard-members-chart .bklit-bar-frame { height: 300px !important; }
/* 미종료 분포: 고객사 순위 막대 / 경과일 도넛 / 팀원 상태 히트맵. */
.bklit-root {
  --distribution-age-recent: color-mix(in srgb, var(--chart-1) 48%, var(--surface));
  --distribution-age-long: color-mix(in srgb, var(--chart-3) 48%, var(--surface));
  --distribution-on-color: #172233;
}
.bklit-ranking-frame { width:100%; min-width:0; }
.bklit-ranking-frame > div { height:100%; }
.bklit-root .bklit-customer-select {
  display:flex; align-items:flex-start; justify-content:space-between; gap:8px; width:100%; padding:2px 0 0;
  border:0; border-radius:6px; background:transparent; color:var(--text); text-align:left; line-height:20px;
}
.bklit-customer-select[aria-pressed="true"] { background:color-mix(in srgb, var(--blue) 12%, transparent); }
.bklit-customer-select strong { flex-shrink:0; font-size:13px; font-variant-numeric:tabular-nums; }
.bklit-customer-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.bklit-distribution-legend { display:flex; flex-wrap:wrap; gap:6px 12px; margin-top:10px; color:var(--text-soft); font-size:12px; }
.bklit-distribution-legend span { display:flex; align-items:center; gap:6px; }
.bklit-distribution-legend i, .bklit-age-options i { width:8px; height:8px; border-radius:3px; flex-shrink:0; }
.bklit-age-circle { display:flex; justify-content:center; margin:4px 0 14px; }
.bklit-age-center { display:grid; gap:6px; justify-items:center; color:var(--text); text-align:center; }
.bklit-age-center strong { font-size:26px; line-height:1.1; letter-spacing:-1px; font-weight:700; font-variant-numeric:tabular-nums; }
.bklit-age-center span { font-size:12px; color:var(--muted); }
.bklit-age-options { display:grid; gap:4px; }
.bklit-age-options button { display:flex; align-items:center; gap:8px; width:100%; min-height:38px; padding:8px 6px; border:0; border-radius:8px; background:transparent; color:var(--text-soft); text-align:left; }
.bklit-age-options button:hover, .bklit-age-options button[aria-pressed="true"] { background:var(--blue-soft); }
.bklit-age-options strong { margin-left:auto; font-weight:600; color:var(--text); white-space:nowrap; font-variant-numeric:tabular-nums; }
.bklit-age-options small { width:34px; text-align:right; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
.bklit-age-slice { cursor:pointer; }
.bklit-member-frame { width:100%; }
.bklit-heat-label { font-size:12px; fill:var(--muted); }
.bklit-heat-name, .bklit-heat-total { font-size:12px; fill:var(--text-soft); }
.bklit-heat-total { font-weight:600; font-variant-numeric:tabular-nums; }
.bklit-root .bklit-member-cell { display:block; width:100%; height:100%; padding:0; border:0; border-radius:6px; color:var(--text); font-size:12px; font-variant-numeric:tabular-nums; }
.bklit-member-cell:hover { box-shadow:inset 0 0 0 1px var(--muted); }
.dashboard-age-chart .dashboard-chart-body:has(.bklit-host) { align-content:start; }
.bklit-host[data-bklit-kind="member-heatmap"] { container:bklit-members / inline-size; }
@container bklit-members (max-width:230px) { .bklit-member-heatmap { display:none; } [data-bklit-values] { display:block; } }
@media(pointer:coarse) { .bklit-age-options button { min-height:44px; } }
.workspace-overview:has(.bklit-host) { grid-template-rows:min-content minmax(0,1fr); }
.workspace-overview:has(.bklit-host):has(> .workspace-connection) { grid-template-rows:min-content min-content minmax(0,1fr); }
.workspace-overview:has(.bklit-host) .workspace-side-card { flex-shrink:0; }
@media(max-width:1180px){
  .workspace-content.is-overview:has(.bklit-host) { display:block; overflow-y:auto; }
  .workspace-overview:has(.bklit-host) { display:flex; flex-direction:column; height:auto; gap:16px; }
  .workspace-overview:has(.bklit-host) > .workspace-section { min-height:220px; max-height:480px; }
  .workspace-overview:has(.bklit-host) .workspace-side { display:flex; overflow:visible; }
}

/* 대화/관리자에서도 동일 원본을 쓰되 기존 본문·카드 폭을 따른다. */
.bklit-report-chart { min-width:0; width:100%; margin:12px 0; }
.bklit-metric-pie { display:flex; flex-wrap:wrap; align-items:center; gap:16px; }
.bklit-metric-pie > .bklit-legend { flex:1; min-width:160px; }
.bklit-root .bklit-legend-item button { overflow-wrap:anywhere; text-align:left; max-width:100%; }
.bklit-root .bklit-legend-item button.is-muted { opacity:.45; text-decoration:line-through; }
.bklit-metric-tabs { display:flex; flex-wrap:wrap; gap:6px; }
.bklit-metric-tabs button { padding:8px 12px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--text-soft); }
.bklit-metric-tabs button[aria-selected="true"] { color:var(--blue); background:var(--blue-soft); border-color:var(--blue); }
.bklit-metric-tabs button:hover { background:var(--surface-alt); }
.bklit-table-scroll { width:100%; min-width:0; overflow-x:auto; }
.bklit-native-table { width:100%; border-collapse:collapse; font-size:12px; }
.bklit-native-table :is(th,td) { padding:8px; text-align:left; border-bottom:1px solid var(--line); }
.bklit-monthly .bklit-data :is(td,th) { white-space:nowrap; }
.bklit-report-chart [data-bklit-fallback] { min-width:0; overflow-x:auto; }
.admin-card:has(.bklit-host) { min-width:0; }
.admin-card [data-bklit-fallback] .admin-bar-row { grid-template-columns:minmax(0,1fr) auto; }
.bklit-value-label { font-size:12px; fill:var(--text-soft); font-variant-numeric:tabular-nums; }
@media (max-width:600px) {
  .bklit-metric-pie { justify-content:center; }
  .bklit-metric-pie > .bklit-legend { flex-basis:100%; }
}
/* 관리자 아이콘용 SVG 선 스타일이 차트의 글자·막대에 상속되지 않도록 한다. */
.admin-panel .bklit-root svg { stroke:none; stroke-width:0; }
.bklit-report-chart .bklit-bar-frame .truncate.text-right,
.admin-card .bklit-bar-frame .truncate.text-right { max-width:110px !important; }
