/* 나누기·순서 맞추기 질문 (sort-order.js) - match-lines.css와 같은 결 */
.bt-so { --m: var(--age, var(--focus, #2f7d5b)); margin: 4px 0 16px; min-width: 0; }
.question-container .bt-so { padding: 12px 16px 0; margin: 0; }
@container (max-width: 440px) { .question-container .bt-so { padding: 12px 12px 0; } }
.bt-so-hint { margin: 0 0 12px; font-size: 13px; line-height: 1.7; color: #6b7280; word-break: keep-all; }
.bt-so-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bt-so-row { margin: 0; min-width: 0; }

/* 나누기: 보기 한 줄 + 오른쪽 가/나 버튼 */
.bt-so-sort .bt-so-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1.5px solid #d1d5db; border-radius: 10px; background: #fff; }
.bt-so-sort .bt-so-row.is-done { border-color: var(--m); background: color-mix(in srgb, var(--m) 6%, #fff); }
.bt-so-text { margin: 0; min-width: 0; font-size: 15px; line-height: 1.55; color: #22262b; word-break: keep-all; overflow-wrap: anywhere; }
.bt-so-text b { color: var(--m); font-weight: 700; margin-right: 2px; }
.bt-so-choices { display: flex; gap: 6px; }
.bt-so-choices button { min-width: 44px; min-height: 44px; padding: 0 8px; font: inherit; font-size: 15px; font-weight: 700; color: var(--m); background: #fff; border: 1.5px solid #d1d5db; border-radius: 10px; cursor: pointer; touch-action: manipulation; }
.bt-so-choices button[aria-pressed=true] { color: #fff; background: var(--m); border-color: var(--m); }
.bt-so-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.bt-so-box { min-width: 0; padding: 10px 12px; border: 1.5px dashed color-mix(in srgb, var(--m) 45%, #d1d5db); border-radius: 12px; background: color-mix(in srgb, var(--m) 4%, #fff); }
.bt-so-box-head { margin: 0 0 8px; display: flex; gap: 6px; align-items: baseline; font-size: 13px; line-height: 1.5; color: #4b5563; word-break: keep-all; overflow-wrap: anywhere; }
.bt-so-box-head b { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; color: #fff; background: var(--m); font-size: 13px; }
.bt-so-chips { margin: 0; min-height: 30px; display: flex; flex-wrap: wrap; gap: 6px; }
.bt-so-chip { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 999px; font-weight: 700; color: var(--m); background: #fff; border: 1.5px solid var(--m); }

/* 순서: 누른 차례대로 번호 */
.bt-so-order-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px; text-align: left; font: inherit; background: #fff; border: 1.5px solid #d1d5db; border-radius: 10px; cursor: pointer; touch-action: manipulation; }
.bt-so-order-btn.is-done { border-color: var(--m); background: color-mix(in srgb, var(--m) 6%, #fff); }
.bt-so-num { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #9ca3af; font-weight: 700; font-size: 14px; color: #fff; }
.bt-so-order-btn.is-done .bt-so-num, .bt-so-seq .bt-so-num { background: var(--m); border-color: var(--m); }
.bt-so-seq { list-style: none; margin: 14px 0 0; padding: 10px 12px; display: grid; gap: 6px; border: 1.5px dashed color-mix(in srgb, var(--m) 45%, #d1d5db); border-radius: 12px; background: color-mix(in srgb, var(--m) 4%, #fff); }
.bt-so-seq[hidden] { display: none; }
.bt-so-seq li { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.5; color: #374151; word-break: keep-all; min-width: 0; }
.bt-so-seq .bt-so-num { width: 22px; height: 22px; font-size: 12px; }

/* 고르기: ①(하나) · □(여러 개) */
.bt-so-pick-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px; text-align: left; font: inherit; background: #fff; border: 1.5px solid #d1d5db; border-radius: 10px; cursor: pointer; touch-action: manipulation; }
.bt-so-pick-btn.is-done { border-color: var(--m); background: color-mix(in srgb, var(--m) 8%, #fff); }
.bt-so-mark { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #9ca3af; font-weight: 700; font-size: 14px; color: #6b7280; }
.bt-so.is-multi .bt-so-mark { border-radius: 7px; }
.bt-so-pick-btn.is-done .bt-so-mark { color: #fff; background: var(--m); border-color: var(--m); }
.bt-so.is-ox .bt-so-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bt-so.is-ox .bt-so-pick-btn { justify-content: center; min-height: 72px; }
.bt-so-ox { font-size: 32px; line-height: 1; filter: grayscale(1); opacity: .55; }
.bt-so-pick-btn.is-done .bt-so-ox { filter: none; opacity: 1; }

.bt-so-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.bt-so-status { font-size: 13px; color: #6b7280; }
.bt-so-reset { min-height: 44px; padding: 8px 14px; font: inherit; font-size: 14px; color: var(--m); background: transparent; border: 1px solid #d1d5db; border-radius: 10px; cursor: pointer; }
.bt-so button:focus-visible { outline: 3px solid var(--m); outline-offset: 2px; }
.bt-so-on textarea { height: auto !important; min-height: 64px !important; font-size: 15px; }
@container (max-width: 360px) {
  .bt-so-text { font-size: 14px; }
  .bt-so-choices button { min-width: 40px; }
  .bt-so-boxes { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) { .bt-so button, .bt-so-row { transition: border-color .15s, background-color .15s, color .15s; } }
