.matching-page { gap: 22px; }
.matching-page > *, #matchingResult > *, .matching-details, .matching-chart { min-width: 0; }
.matching-chart { overflow-wrap: anywhere; }
.matching-page p { overflow-wrap: anywhere; }
.matching-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.matching-field { display: grid; gap: 9px; min-width: 0; }
.matching-field select { width: 100%; min-width: 0; max-width: 100%; min-height: 52px; padding: 12px; border: 1px solid var(--line,#6a566a); border-radius: 16px; background: var(--surface-2,#29202f); color: var(--paper,#f4efe6); font: inherit; }
.matching-field select:focus-visible { outline: 2px solid var(--gold,#e0b157); outline-offset: 4px; }
.matching-need { border-bottom: 1px solid var(--line,#6a566a); padding: 16px 0; }
.matching-need p { margin: 8px 0 14px; }
#matchingResult:not(:empty) { display: grid; gap: 18px; }
#matchingResult h2, .matching-details p { margin: 0; }
.matching-card { width: 100%; min-width: 0; max-width: 560px; margin: auto; }
.matching-card svg { display: block; width: 100%; height: auto; }
.matching-tools { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; width: 100%; max-width: 560px; margin: auto; }
.matching-tools button { min-width: 0; min-height: 48px; gap: 6px; padding: 12px 8px; }
.matching-tools svg { flex: none; }
.matching-tools button:focus-visible { outline: 2px solid var(--gold,#e0b157); outline-offset: 3px; }
.matching-details { display: grid; gap: 22px; }
.matching-details section { display: grid; gap: 12px; border-bottom: 1px solid var(--line,#6a566a); padding: 0 0 22px; }
.matching-details h3 { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin: 0; }
.matching-details h3 span { white-space: nowrap; color: var(--gold,#e0b157); }
.matching-method { overflow-wrap: anywhere; }
.matching-method summary { min-height: 44px; padding: 12px 0; cursor: pointer; }
.matching-method .detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.matching-method table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.matching-method td, .matching-method th { padding: 8px; border-bottom: 1px solid var(--line,#6a566a); text-align: left; }
.matching-method :is(td,th):last-child { white-space: nowrap; }
.matching-print > svg { display: block; width: 100%; height: auto; }
.matching-chart summary { padding: 14px 0; min-height: 48px; cursor: pointer; }
.matching-chart dl > div { padding: 14px 0; border-bottom: 1px solid var(--line,#6a566a); overflow-wrap: anywhere; }
.matching-chart dd { margin: 8px 0 0; }
@media (max-width: 520px) {
  .matching-pair, .matching-method .detail-grid { grid-template-columns: minmax(0,1fr); }
  .matching-tools button span { display: none; }
}
@media print {
  .matching-print { width: 170mm; max-width: 100%; margin: 0 auto; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .matching-print > svg { max-height: 240mm; }
}
