/* 차트 분석 공통 화면: 기존 Finji 테마를 유지하며 밀도·대비·조작 크기를 통일한다. */
:is(.fc, .ca-wrap, .cr-wrap, .ch-wrap, .cs-wrap) {
  --text-muted: var(--text-secondary);
  --fc-link: var(--text-primary);
  --fc-link: color-mix(in srgb, var(--primary-color) 45%, var(--text-primary));
  --fc-focus: #7aa8ff;
  max-width: 1120px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
:is(.fc, .ca-wrap, .cr-wrap, .ch-wrap, .cs-wrap) :focus-visible {
  outline: 3px solid var(--fc-focus);
  outline-offset: 3px;
}
:is(.fc, .ca-wrap, .cr-wrap, .ch-wrap) [hidden] { display: none !important; }
:is(.fc, .ca-wrap, .cr-wrap, .ch-wrap) :is(input, select, textarea, button) { font-family: inherit; }
.fc-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  margin: 0 0 1.75rem;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--card-bg);
}
.fc-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .55rem .4rem;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: .84rem;
  font-weight: 550;
  line-height: 1.35;
  text-decoration: none;
}
.fc-nav a:hover { background: var(--card-bg-2); color: var(--text-primary); }
.fc-nav a[aria-current="page"] {
  background: var(--card-bg-2);
  color: var(--text-primary);
  border-color: var(--border-color);
  box-shadow: inset 0 -2px 0 var(--primary-color);
}
.fc h1 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); letter-spacing: -.04em; line-height: 1.25; }
.fc > h2 { font-size: 1.15rem; margin: 1.6rem 0 .8rem; }
.fc-hero { padding: .4rem 0 1.5rem; }
.fc-hero .fc-tag { color: var(--fc-link); background: transparent; padding: 0; font-size: .74rem; font-weight: 700; letter-spacing: .12em; }
.fc-lead { margin: .6rem 0 1.25rem; max-width: 720px; }
.fc-card { padding: 1.5rem; border-radius: 16px; margin-bottom: 1.25rem; }
.fc-card h2 { font-size: 1.08rem; letter-spacing: -.02em; }
.fc-card h3 { margin: 1rem 0 .5rem; }
.fc-card > h3:first-child { margin-top: 0; }
.fc-grid { gap: 1.25rem; margin-bottom: 1.5rem; }
.fc-grid > .fc-card { margin-bottom: 0; }
.fc label { line-height: 1.5; font-weight: 550; }
.fc input, .fc select, .fc textarea { min-height: 46px; border-radius: 10px; margin-bottom: .5rem; font-size: .94rem; }
.fc input[type=checkbox], .fc input[type=radio] { min-height: 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--primary-color); }
.fc button, .fc-btn { min-height: 44px; padding: .65rem 1rem; border-radius: 10px; line-height: 1.45; font-weight: 600; }
.fc button.primary, .fc-btn.primary { background: var(--primary-color); color: #fff; border-color: transparent; }
.fc a:not(.fc-btn):not(.fc-nav a) { color: var(--fc-link); text-underline-offset: 3px; }
.fc-row { align-items: end; gap: .8rem; }
.fc-row > * { min-width: 0; }
.fc-row > div { flex-basis: 135px; }
.fc-row > button { flex: 0 1 auto; margin-bottom: .5rem; }
.fc-row > label { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.fc-tabs { gap: 0; border-bottom: 1px solid var(--border-color); padding-bottom: 0; margin: 0 0 1.5rem; }
.fc-tabs button { flex: 1; min-width: 120px; border: 0; border-radius: 0; background: transparent; color: var(--text-secondary); padding: .8rem .7rem; }
.fc-tabs button[aria-selected=true] { background: transparent; color: var(--text-primary); box-shadow: inset 0 -3px 0 var(--primary-color); }
.fc-panel { scroll-margin-top: 100px; }
.fc :is(details) > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 44px; list-style: none; }
.fc details > summary::-webkit-details-marker { display: none; }
.fc details > summary::after { content: '+'; font-size: 1.2rem; color: var(--text-secondary); font-weight: 400; }
.fc details[open] > summary::after { content: '−'; }
.fc details[open] > summary { margin-bottom: .8rem; }
.fc-hint, .fc small { color: var(--text-secondary); }
.fc-status { font-size: .84rem; line-height: 1.6; }
.fc-status:empty { min-height: .4rem; margin: .4rem 0; }
.fc-status[role=alert] { padding: .75rem; border-left: 3px solid var(--danger-color); background: var(--card-bg-2); color: var(--text-primary); }
.fc-chart { height: 340px; }
.fc-chart[aria-busy=true] { opacity: .45; }
.fc-chart-wrap { position: relative; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; margin: .6rem 0 1rem; }
.fc-chart-empty { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: .5rem; text-align: center; padding: 1.5rem; pointer-events: none; }
.fc-chart-empty svg { width: 46px; height: 46px; color: var(--text-secondary); margin-bottom: .5rem; }
.fc-chart-empty strong { font-size: .95rem; }
.fc-chart-empty p { color: var(--text-secondary); font-size: .85rem; max-width: 310px; }
.fc-support-links { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; padding: .3rem 0 1.1rem; font-size: .85rem; }
.fc-support-links a { min-height: 36px; display: inline-flex; align-items: center; }
.fc-chart-controls { display: grid; grid-template-columns: minmax(0, 1fr) 135px auto; gap: .8rem; align-items: end; }
.fc-chart-controls button { margin-bottom: .5rem; }
.fc-chart-footer { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
.fc-chart-footer label { display: flex; align-items: center; min-height: 44px; gap: .5rem; margin: 0 auto 0 0; }
.fc-chart-footer #cw-quote { flex-basis: 100%; font-size: .83rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.fc-metric { border: 1px solid var(--border-color); border-radius: 12px; padding: 1rem; }
.fc-metric strong { font-size: 1.3rem; letter-spacing: -.025em; }
.fc-item { padding: 1rem; border-radius: 12px; }
.fc-item p { color: var(--text-secondary); }
.fc th, .fc td { padding: .85rem .7rem; }
@media (max-width: 700px) {
  .fc-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1.25rem; }
  .fc-nav a { font-size: .8rem; }
  .fc-card { padding: 1.05rem; }
  .fc-grid { gap: 1rem; }
  .fc-row > * { min-width: 0; }
  .fc-row > div { flex: 1 1 130px; }
  .fc input, .fc select, .fc textarea { font-size: 16px; }
  .fc-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-tabs button { min-width: 0; font-size: .81rem; }
  .fc-chart-controls { grid-template-columns: minmax(0, 1fr) 100px; gap: .5rem .65rem; }
  .fc-chart-controls button { grid-column: 1/-1; }
  .fc-chart { height: 280px; }
  .fc-hero { padding: 0 0 .5rem; }
  .fc-lead { margin-bottom: .5rem; }
  .fc-chart-footer > button { flex: 1 1 130px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.fc, .ca-wrap, .cr-wrap, .ch-wrap) * { scroll-behavior: auto !important; }
}
