/* 펀드 백테스트(과거 장 재생 시험) 화면(fund-backtest.js, 화면 P36). 공통 색 변수(--line, --muted, --green, --amber, --red)와
   공용 클래스(.panel, .pill, .notice, .button)를 쓴다. CSP 때문에 모양은 이 파일 클래스로만 준다. */
.fund-bt { display: grid; gap: 16px; min-width: 0; }
.fund-bt-section { display: grid; gap: 12px; min-width: 0; }
.fund-bt-section h3, .fund-bt-block h4 { margin: 0; }
.fund-bt-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.fund-bt-message:empty { display: none; }
.fund-bt-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 새 실행 양식: 넓으면 세 칸, 좁아지면 저절로 한 칸. */
.fund-bt-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px; }
.fund-bt-field { display: grid; gap: 6px; min-width: 0; }
.fund-bt-field small { font-size: 12px; line-height: 1.4; }

/* 실행 목록 카드 */
.fund-bt-run-list { display: grid; gap: 10px; }
.fund-bt-run { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  min-width: 0; }
.fund-bt-run.is-selected { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.fund-bt-run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.fund-bt-run-title { min-width: 0; overflow-wrap: anywhere; }
.fund-bt-run-times { margin: 0; font-size: 12px; }
.fund-bt-run-failure { margin: 0; color: var(--red); font-size: 13px; overflow-wrap: anywhere; }
.fund-bt-run-numbers { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.fund-bt-num { display: grid; gap: 2px; min-width: 64px; }
.fund-bt-num small { font-size: 11px; }
.fund-bt-num strong { font-variant-numeric: tabular-nums; }
.fund-bt-empty { margin: 0; }

/* 진행률 막대(progress 요소). 브라우저 기본 모양을 지우고 공통 색으로 칠한다. */
.fund-bt-progress { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fund-bt-progress-bar { flex: 1 1 auto; min-width: 0; height: 8px; border: 0; border-radius: 999px; overflow: hidden;
  background: var(--line); appearance: none; -webkit-appearance: none; }
.fund-bt-progress-bar::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.fund-bt-progress-bar::-webkit-progress-value { background: var(--green); border-radius: 999px; }
.fund-bt-progress-bar::-moz-progress-bar { background: var(--green); border-radius: 999px; }
.fund-bt-progress-text { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 숫자 색: 오르면 초록, 내리면 빨강, 오류·경고 수는 무게 색. */
.fund-bt-num.is-up strong, .fund-bt-fact.is-up dd { color: var(--green); }
.fund-bt-num.is-down strong, .fund-bt-fact.is-down dd { color: var(--red); }
.fund-bt-num.is-error strong, .fund-bt-fact.is-error dd { color: var(--red); }
.fund-bt-num.is-warning strong, .fund-bt-fact.is-warning dd { color: var(--amber); }

/* 보고서 */
.fund-bt-report-body { display: grid; gap: 18px; min-width: 0; }
.fund-bt-report-title { margin: 0; overflow-wrap: anywhere; }
.fund-bt-report-title:focus { outline: none; }
.fund-bt-summary { display: grid; gap: 10px; min-width: 0; }
.fund-bt-conditions { margin: 0; font-size: 13px; }
.fund-bt-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px;
  margin: 0; }
.fund-bt-fact { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  min-width: 0; }
.fund-bt-fact dt { color: var(--muted); font-size: 12px; }
.fund-bt-fact dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fund-bt-reason-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px; }
.fund-bt-reasons { display: grid; gap: 4px; min-width: 0; font-size: 13px; }
.fund-bt-reason-list { margin: 0; padding-left: 18px; color: var(--muted); overflow-wrap: anywhere; }
.fund-bt-block { display: grid; gap: 8px; min-width: 0; }
.fund-bt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none;
  font-size: 12px; }
.fund-bt-legend li { display: flex; align-items: center; gap: 6px; }

/* 표: 넓은 화면은 일반 표, 내용이 넘치면 표 상자 안에서만 가로로 움직인다(화면 전체는 넘치지 않는다). */
.fund-bt-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; max-width: 100%; }
.fund-bt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fund-bt-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; }
.fund-bt-table th, .fund-bt-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left;
  vertical-align: top; }
.fund-bt-table th { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.fund-bt-table tbody tr:last-child td { border-bottom: 0; }
.fund-bt-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fund-bt-table .fund-bt-col-pill { white-space: nowrap; }
.fund-bt-table .fund-bt-col-wide { min-width: 220px; }
.fund-bt-table .pill { vertical-align: middle; }
.fund-bt-anomaly-text { display: grid; gap: 2px; overflow-wrap: anywhere; }
.fund-bt-anomaly-text small { font-size: 11px; }

/* 자산 곡선(SVG). 선 굵기는 늘어나지 않게 vector-effect 속성을 쓰고 색은 여기서 준다. */
.fund-bt-chart { display: block; width: 100%; height: 180px; border: 1px solid var(--line); border-radius: 12px; }
.fund-bt-chart-line { fill: none; stroke: var(--green); stroke-width: 2; stroke-linejoin: round; }
.fund-bt-chart-line.is-down { stroke: var(--red); }
.fund-bt-chart-base { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.fund-bt-chart-legend { margin: 0; font-size: 12px; }

/* 한국어 요약 원문(마크다운 글자 그대로) */
.fund-bt-markdown-box summary { cursor: pointer; font-weight: 700; }
.fund-bt-markdown { margin: 8px 0 0; padding: 12px; max-height: 480px; overflow: auto; border: 1px solid var(--line);
  border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.6; }
.fund-bt-markdown-box summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* 휴대폰: 표는 칸 이름을 붙인 한 줄 카드로 바꾼다(공통 mobile-tables.js 변환은 no-mobile-cards로 끈다). */
@media (max-width: 560px) {
  .fund-bt-table-wrap { overflow-x: visible; border: 0; }
  .fund-bt-table thead { display: none; }
  .fund-bt-table, .fund-bt-table tbody, .fund-bt-table tr, .fund-bt-table td { display: block; width: 100%; }
  .fund-bt-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .fund-bt-table tbody tr:last-child { border-bottom: 0; }
  .fund-bt-table td { padding: 2px 0; border: 0; text-align: left; white-space: normal; min-width: 0;
    overflow-wrap: anywhere; }
  .fund-bt-table .num { text-align: left; white-space: normal; }
  .fund-bt-table .fund-bt-col-wide { min-width: 0; }
  .fund-bt-table td::before { content: attr(data-label) " · "; color: var(--muted); font-size: 12px; }
  .fund-bt-chart { height: 140px; }
  .fund-bt-run-numbers { gap: 8px 14px; }
}
