/* 探索・整列の部品（w-c3-sort.js） */
.w-c3-sort { background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 14px; padding: 12px; }
.cs-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.cs-lab { font-size: 0.88rem; font-weight: 700; color: var(--sub, #4b5563); }
.cs-chip { font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer; min-height: 44px; min-width: 44px; padding: 4px 12px; border: 2px solid var(--line, #e2e8f0); background: #fff; border-radius: 999px; color: var(--sub, #4b5563); font-family: var(--mono, monospace); }
.cs-chip[aria-pressed="true"] { border-color: var(--blue, #2563eb); color: var(--blue-d, #1d4ed8); background: var(--blue-l, #eaf1ff); }
.cs-lanes { display: grid; gap: 12px; }
.cs-lane { background: #f8fafc; border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 8px 10px 6px; min-width: 0; }
.cs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.cs-algo { font-size: 0.98rem; color: var(--navy, #1e3a8a); }
.cs-count { font: 700 0.92rem/1.4 var(--mono, monospace); color: var(--orange-t, #b45309); background: var(--orange-l, #fff4dc); border-radius: 8px; padding: 2px 8px; }
.cs-row { position: relative; height: 52px; }
.cs-row.bars { height: 150px; }
.cs-cell { position: absolute; top: 0; bottom: 0; padding: 0 2px; box-sizing: border-box; transition: left .45s ease; display: flex; align-items: flex-end; }
.cs-row:not(.bars) .cs-cell { align-items: stretch; }
.cs-bar { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100%; background: #fff; border: 2px solid #94a3b8; border-radius: 8px; box-sizing: border-box; padding-bottom: 4px; transition: background-color .2s, border-color .2s; }
.cs-row:not(.bars) .cs-bar { align-items: center; padding: 0; }
.cs-row.bars .cs-bar { background: #eaf1ff; border-color: #93b4f5; }
.cs-v { font: 700 clamp(0.85rem, 3.6vw, 1.1rem)/1 var(--mono, monospace); color: var(--ink, #1f2937); }
.cs-cell.cmp .cs-bar { background: #fff4dc; border-color: #f59e0b; border-width: 3px; }
.cs-cell.min .cs-bar { background: #fff; border-color: #b45309; border-style: dashed; border-width: 3px; }
.cs-cell.swap .cs-bar { background: #fde68a; border-color: #b45309; border-width: 3px; }
.cs-cell.found .cs-bar { background: #e7f7ef; border-color: #0f8a72; border-width: 3px; }
.cs-cell.fixed .cs-bar { background: #2563eb; border-color: #1d4ed8; }
.cs-cell.fixed .cs-v { color: #fff; }
.cs-cell.seen .cs-bar, .cs-cell.out .cs-bar { background: #f1f5f9; border-color: #cbd5e1; border-style: dotted; }
.cs-cell.seen .cs-v, .cs-cell.out .cs-v { color: #94a3b8; }
.cs-idx { display: flex; margin-top: 2px; }
.cs-i { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.cs-i small { font: 0.75rem/1.3 var(--mono, monospace); color: var(--sub, #4b5563); }
.cs-midbox, .cs-rangebox { position: relative; height: 18px; }
.cs-rangebox { height: 30px; margin-top: 2px; }
.cs-mid { position: absolute; bottom: 0; transform: translateX(-50%); font: 700 0.72rem/1.2 var(--mono, monospace); color: var(--orange-t, #b45309); white-space: nowrap; }
.cs-bracket { position: absolute; top: 0; height: 8px; border: 2px solid var(--blue, #2563eb); border-top: 0; border-radius: 0 0 4px 4px; box-sizing: border-box; }
.cs-rl, .cs-rr { position: absolute; top: 10px; font: 700 0.72rem/1.3 var(--mono, monospace); color: var(--blue-d, #1d4ed8); white-space: nowrap; }
.cs-row.many .cs-cell { padding: 0 1px; }
.cs-row.many .cs-bar { border-radius: 5px; }
.cs-row.many .cs-v { font-size: clamp(0.72rem, 3.2vw, 1.05rem); }
.cs-msg { font-size: 0.92rem; margin: 6px 0 2px; min-height: 2.8em; color: var(--ink, #1f2937); }
.cs-msg.end { font-weight: 700; color: #0f766e; }
.cs-legend { font-size: 0.8rem; color: var(--sub, #4b5563); margin: 8px 0 0; line-height: 1.9; }
.cs-legend .k { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin: 0 3px 0 8px; border: 2px solid #94a3b8; box-sizing: border-box; }
.cs-legend .k:first-child { margin-left: 0; }
.cs-legend .k.cmp { background: #fff4dc; border-color: #f59e0b; }
.cs-legend .k.found { background: #e7f7ef; border-color: #0f8a72; }
.cs-legend .k.seen { background: #f1f5f9; border-color: #cbd5e1; border-style: dotted; }
.cs-legend .k.min { background: #fff; border-color: #b45309; border-style: dashed; }
.cs-legend .k.swap { background: #fde68a; border-color: #b45309; }
.cs-legend .k.fixed { background: #2563eb; border-color: #1d4ed8; }
.cs-ctrl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cs-b { font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; min-height: 44px; padding: 4px 14px; border: 2px solid var(--line, #e2e8f0); background: #fff; border-radius: 10px; color: var(--ink, #1f2937); }
.cs-b.main { border-color: var(--blue, #2563eb); background: var(--blue, #2563eb); color: #fff; }
.cs-b:disabled { opacity: .45; cursor: default; }
/* grow */
.cs-grow { display: grid; gap: 10px; }
.cs-grow-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 8.5em; gap: 8px; align-items: center; }
.cs-grow-lab b { display: block; font-size: 0.92rem; color: var(--navy, #1e3a8a); }
.cs-grow-lab small { font-size: 0.75rem; color: var(--sub, #4b5563); }
.cs-track { background: #f1f5f9; border-radius: 6px; height: 26px; overflow: hidden; }
.cs-gbar { display: block; height: 100%; border-radius: 6px; background: #2563eb; transition: width .5s ease; }
.cs-gbar.binary { background: #f59e0b; }
.cs-gbar.select, .cs-gbar.bubble { background: #7c3aed; }
.cs-grow-num { font: 700 0.95rem/1.3 var(--mono, monospace); text-align: right; word-break: break-all; }
.cs-grow-num small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--sub, #4b5563); }
@media (max-width: 560px) {
  .cs-grow-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cs-track { grid-column: 1 / -1; grid-row: 2; }
  .cs-b { flex: 1 1 auto; padding: 4px 8px; }
  .w-c3-sort { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-cell, .cs-bar, .cs-gbar { transition: none !important; }
}
