/* 幫我配隊 — uses theme.css tokens */
.bd-step { margin: 0 0 40px; }
.bd-step > h3 { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.bd-step > .small { margin: 0 0 14px; }
.bd-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.bd-search-wrap { position: relative; flex: 1 1 280px; min-width: 0; }
.bd-search { width: 100%; height: 46px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 14px; font: inherit; font-size: 15px; background: var(--white); color: var(--ink); }
.bd-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(200, 55, 42, .14); }
.bd-suggest { position: absolute; z-index: 20; left: 0; right: 0; top: 52px; display: grid; background: var(--white); border-radius: 14px; box-shadow: var(--shadow-md); overflow: hidden; }
.bd-suggest:empty { display: none; }
.bd-option { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: none; text-align: left; color: var(--ink); font-size: 15px; }
.bd-option:hover { background: var(--tint); }
.bd-option small { color: var(--muted); font-size: 12px; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 6px; background: var(--white); border: 1px solid #ececf0; border-radius: 980px; box-shadow: var(--shadow-sm); font-size: 14px; }
.bd-chip small { color: var(--muted); font-size: 11.5px; }
.bd-x { background: none; color: var(--faint); font-size: 16px; line-height: 1; padding: 0 4px; }
.bd-x:hover { color: var(--accent); }
.bd-troop { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; background: #8e8e93; }
.bd-troop.t-弓兵 { background: #2f7d5b; }
.bd-troop.t-步兵 { background: #9a6b2f; }
.bd-troop.t-騎兵 { background: var(--accent); }

.bd-chip.is-core { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.bd-route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: stage; }
.bd-stage { position: relative; display: grid; gap: 6px; align-content: start; background: var(--white); border: 1px solid #ececf0; border-radius: 18px; box-shadow: var(--shadow-sm); padding: 14px; }
.bd-stage-head strong { display: block; font-family: var(--display); font-size: 16px; }
.bd-stage-head small { color: var(--muted); font-size: 12px; }
.bd-faces { display: flex; gap: 4px; }
.bd-faces img { width: calc((100% - 8px) / 3); aspect-ratio: 3 / 4; object-fit: cover; object-position: center 15%; border-radius: 8px; background: var(--tint); }
.bd-stage-team { margin: 0; font-weight: 650; font-size: 14px; line-height: 1.45; }
.bd-stage-meta { margin: 0; color: var(--muted); font-size: 12.5px; }
.bd-stage .text-button { justify-self: start; padding: 0; font-size: 13px; }

.bd-card { background: var(--white); border: 1px solid #ececf0; border-radius: 22px; box-shadow: var(--shadow-sm); padding: 24px 26px; margin-bottom: 16px; }
.bd-card.is-best { box-shadow: 0 0 0 2px var(--ink), var(--shadow-md); }
.bd-card-head { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: baseline; margin-bottom: 14px; }
.bd-card-head h4 { font-family: var(--display); font-size: 21px; font-weight: 750; margin: 0; }
.bd-card-head small { grid-column: 2 / -1; color: var(--muted); font-size: 12.5px; }
.bd-alt { padding-top: 18px; padding-bottom: 18px; }
.bd-alt > summary { list-style: none; cursor: pointer; }
.bd-alt > summary::-webkit-details-marker { display: none; }
.bd-alt > summary .bd-card-head { margin-bottom: 0; }
.bd-alt[open] > summary .bd-card-head { margin-bottom: 14px; }
.bd-alt .bd-score { font-size: 22px; }
.bd-rank { font-size: 12px; font-weight: 700; color: #fff; background: var(--ink); border-radius: 980px; padding: 3px 10px; }
.bd-card:not(.is-best) .bd-rank { background: var(--tint); color: var(--ink-soft); }
.bd-score { font-family: var(--display); font-size: 28px; font-weight: 750; color: var(--accent); }
.bd-bars { display: grid; gap: 6px; max-width: 520px; margin-bottom: 18px; }
.bd-bar { display: grid; grid-template-columns: 40px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-soft); }
.bd-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.bd-track { height: 8px; background: var(--tint); border-radius: 980px; overflow: hidden; }
.bd-track span { display: block; height: 100%; background: var(--accent); border-radius: 980px; }
.bd-members { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bd-member { min-width: 0; display: grid; gap: 4px; align-content: start; }
.bd-portrait { aspect-ratio: 470 / 400; border-radius: 14px; overflow: hidden; background: var(--tint); margin-bottom: 6px; }
.bd-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; }
.bd-pos { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .06em; }
.bd-member > strong { font-family: var(--display); font-size: 18px; }
.bd-member > small { color: var(--muted); font-size: 12.5px; }
.bd-points { margin: 6px 0 2px; font-size: 13px; font-weight: 600; background: var(--tint); border-radius: 10px; padding: 7px 10px; }
.bd-skills { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.bd-skills li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 14px; padding: 6px 0; border-top: 1px solid #f0f0f3; }
.bd-skills li .own { font-weight: 600; }
.bd-skills small { color: var(--muted); font-size: 12px; }
.bd-skills em { font-style: normal; font-size: 11.5px; color: var(--accent); background: var(--accent-soft); border-radius: 980px; padding: 1px 8px; }
.bd-odds { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.bd-notes { margin: 16px 0 0; padding: 14px 18px 14px 34px; background: var(--tint); border-radius: 14px; font-size: 13.5px; line-height: 1.8; color: var(--ink-soft); }
.bd-upgrades { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.bd-up { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; background: var(--white); border: 1px solid #ececf0; border-radius: 16px; box-shadow: var(--shadow-sm); padding: 10px; }
.bd-up img { width: 64px; height: 80px; object-fit: cover; object-position: center 15%; border-radius: 10px; }
.bd-up strong { font-family: var(--display); font-size: 16px; display: block; }
.bd-up small { color: var(--muted); font-size: 12px; display: block; }
.bd-up p { font-size: 12.5px; color: var(--ink-soft); margin: 2px 0 0; }
.bd-up b { color: var(--good); font-size: 15px; }
.bd-how { margin: 8px 0 0; background: var(--tint); border-radius: 16px; padding: 0 20px; font-size: 13.5px; line-height: 1.8; color: var(--ink-soft); }
.bd-how > summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--ink); }
.bd-how > p { padding-bottom: 16px; }

@media (max-width: 980px) {
  .bd-route { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .bd-stage { flex: 0 0 200px; scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .bd-card { padding: 18px; border-radius: 18px; }
  .bd-members { grid-template-columns: 1fr; gap: 18px; }
  .bd-member { grid-template-columns: 96px 1fr; column-gap: 14px; }
  .bd-member > .bd-portrait { grid-row: 1 / span 4; aspect-ratio: 470 / 592; margin: 0; }
  .bd-member > :not(.bd-portrait) { grid-column: 2; }
  .bd-member > .bd-skills, .bd-member > .bd-odds { grid-column: 1 / -1; }
  .bd-card-head h4 { font-size: 18px; }
  .bd-score { font-size: 24px; }
}
.bd-to-calc { display: inline-block; margin-top: 12px; padding: 0; font-size: 14px; }
.bd-to-calc + .bd-to-calc { margin-left: 18px; }
.bd-share-status { display: block; margin-top: 6px; }
