/* 局面解析（仕様書 4.3）。PC: 盤の列 600px＋右の列。スマホ: 縦に並べ、候補手と棋譜はタブで切り替える。 */
.analysis-top { margin-bottom: 16px; }
.analysis-top-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 20px; }
.analysis-top-row h1 { font-size: 20px; margin-right: 8px; }
.analysis-top > .sub, .analysis-top > .notice { margin: 0 20px 12px; }
.rule-field { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.rule-field .select { width: auto; min-width: 180px; }
.exchange-buttons { display: flex; gap: 8px; }

.analysis-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 600px) minmax(0, 1fr); align-items: start; }
.analysis-page #board { --cell-ratio: 1.175; }

.tools { grid-auto-columns: 1fr; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.editor-grid .stepper { width: max-content; }

.eval-graph { position: relative; height: 140px; cursor: pointer; touch-action: none; }
.eval-graph-svg { width: 100%; height: 100%; display: block; }
.eval-graph-bg { fill: var(--surface); }
.eval-graph-area { fill: var(--aqua-chart-light); }
.eval-graph-mid { stroke: var(--line-input); stroke-width: 1; stroke-dasharray: 4 4; }
.eval-graph-main { stroke: var(--aqua); stroke-width: 2.5; fill: none; }
.eval-graph-main-dot, .eval-graph-branch-dot { fill: var(--aqua); }
.eval-graph-branch { stroke: var(--slate); stroke-width: 2; stroke-dasharray: 6 4; fill: none; }
.eval-graph-cursor { stroke: var(--slate); stroke-width: 2; }
.graph-card .card-body { display: grid; gap: 8px; }

.ai-card .card-head .light { color: #DCE3EA; }
.eval-block { padding: 16px 20px 0; display: grid; gap: 8px; }
.eval-numbers { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.eval-numbers strong { font-size: 22px; color: var(--ink); text-align: right; }
.eval-track { height: 14px; background: var(--piece-b-top); position: relative; }
#eval-bar-white { height: 100%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-input); transition: width 0.2s ease; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--bg); padding: 8px 12px; }
.stats dt { font-size: 11.5px; color: var(--text-sub); }
.stats dd { margin: 0; font-weight: 700; color: var(--ink); }

.cands-block { border-top: 1px solid var(--line-light); }
.arrow-toggle { display: inline-flex; align-items: center; gap: 8px; }
.candidates { padding: 0 20px; }
.cand-list { list-style: none; }
.cand {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line-light);
}
.cand:last-child { border-bottom: 0; }
.cand-rank { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cand-rank.r1 { background: var(--aqua); }
.cand-rank.r2 { background: var(--slate); }
.cand-rank.r3 { background: #8C99A6; }
.cand-line { font-family: 'Open Sans', sans-serif; font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.pv-move { display: inline-block; padding: 0 4px; cursor: pointer; color: var(--text); }
.pv-move.is-first { font-weight: 700; color: var(--ink); font-size: 15px; }
.pv-move:hover, .pv-move.is-previewing { background: var(--aqua-pale); box-shadow: inset 0 -2px 0 var(--aqua); }
.pv-arrow { color: var(--text-placeholder); margin: 0 1px; }
.cand-meter { height: 4px; background: var(--aqua-track); margin-top: 4px; }
.cand-meter span { display: block; height: 100%; background: var(--aqua); }
.cand.is-win .cand-meter span { background: var(--aqua-text); }
.cand-side { display: grid; justify-items: end; gap: 0; }
.cand-side strong { color: var(--ink); font-size: 15px; }
.cand-side .btn-text { min-height: 32px; font-size: 12.5px; padding: 0; }
.cands-note { padding: 8px 20px 16px; }
.candidates .empty { padding: 16px 0; text-align: left; }

.variation-bar { display: grid; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line-light); box-shadow: inset 2px 0 0 var(--aqua); }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.var-chip {
  min-height: 36px; padding: 0 12px; border: 0; background: var(--bg); color: var(--ink);
  font-family: 'Open Sans', sans-serif; font-weight: 600; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line-input);
}
.var-chip[aria-pressed="true"] { background: var(--aqua); color: #fff; box-shadow: none; }

.sp-tabs { display: none; }

@media (max-width: 1023px) {
  .analysis-layout { grid-template-columns: minmax(0, 1fr); max-width: 640px; margin: 0 auto; }
}
@media (max-width: 767px) {
  .analysis-page { padding: 12px var(--gutter) 32px; }
  .analysis-top-row { padding: 0; }
  .analysis-top { background: none; box-shadow: none; }
  .analysis-top-row .tabs { width: 100%; }
  .analysis-top-row .tab { flex: 1 1 0; padding: 0 8px; font-size: 13px; }
  .rule-field { margin-left: 0; width: 100%; }
  .rule-field .select { flex: 1; }
  .exchange-buttons { width: 100%; }
  .exchange-buttons .btn { flex: 1 1 0; }
  .analysis-top > .sub, .analysis-top > .notice { margin: 8px 0 0; }
  .analysis-page #board { --cell-ratio: 1; }
  .analysis-layout { gap: 12px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-tabs { display: flex; border-top: 1px solid var(--line-light); }
  .sp-tabs .tab { flex: 1 1 0; }
  .analysis-page[data-sp-tab="cands"] [data-sp-panel="kifu"],
  .analysis-page[data-sp-tab="kifu"] [data-sp-panel="cands"] { display: none; }
}
