.factory-settlement { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border, #dce5ef); min-width: 0; }
.factory-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.factory-heading h3 { margin: 0 0 6px; font-size: 16px; }
.factory-heading p { margin: 0; }
.factory-heading > .btn { flex-shrink: 0; }
.factory-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.factory-cards > div { border: 1px solid #dce5ef; background: #f7f9fc; border-radius: 10px; padding: 14px 10px; }
.factory-cards span { display: block; font-size: 12px; color: #536477; }
.factory-cards strong { display: block; margin-top: 8px; font-size: clamp(16px, 1.4vw, 22px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.factory-cards .factory-prepaid { background: #eef8f6; border-color: #bddfd7; }
.factory-prepaid strong { color: #187564; }
.factory-cards .factory-owed { background: #fff8ed; border-color: #eddbb8; }
.factory-owed strong { color: #936016; }
.factory-form { padding: 16px; margin: 14px 0; border: 1px solid #dce5ef; background: #f8fafd; border-radius: 10px; }
.factory-form label { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 12px; color: #42546a; }
.factory-form input, .factory-form select { width: 100%; min-width: 0; box-sizing: border-box; }
.factory-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.factory-buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.factory-fx { border-top: 1px dashed #dce5ef; padding-top: 12px; }
.factory-fx [data-factory-fx-note] { margin-top: 12px; }
.factory-preview { margin: 12px 0; padding: 12px; background: #edf3fb; color: #255b93; border-radius: 8px; font-weight: 600; }
.factory-history { margin: 0 0 12px; padding: 12px; background: #edf3fb; border-radius: 8px; font-size: 12px; color: #42546a; line-height: 1.7; }
.factory-history:empty { display: none; }
.factory-history p { margin: 0 0 6px; }
.factory-history strong { margin-left: 6px; color: #255b93; font-size: 15px; font-variant-numeric: tabular-nums; }
.factory-history small { display: block; color: #68798c; }
.factory-history summary { cursor: pointer; }
.factory-history table { margin-top: 6px; font-variant-numeric: tabular-nums; }
.factory-history td { padding: 2px 16px 2px 0; }
.factory-payments { min-width: 620px; }
.factory-payments small { display: block; color: #68798c; white-space: normal; max-width: 230px; overflow-wrap: anywhere; margin-top: 4px; }
.factory-payments a { display: inline-block; max-width: 180px; overflow-wrap: anywhere; white-space: normal; }
.factory-payments .factory-void { color: #68798c; background: #f7f8fa; }
.factory-payments td .btn { display: block; margin-top: 6px; }
.factory-settlement h4 { margin: 20px 0 10px; font-size: 13px; }
.factory-basis { margin-top: 14px; font-size: 12px; color: #68798c; line-height: 1.7; }
.factory-basis summary { cursor: pointer; }
.factory-settlement [hidden] { display: none !important; }
@media (max-width: 1100px) { .factory-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .factory-heading { flex-wrap: wrap; }
  .factory-fields { grid-template-columns: minmax(0, 1fr); }
  .factory-form { padding: 12px; }
}

.factory-cards > div { padding: 20px; background: #fff; border-radius: 14px; }
.factory-cards strong { font-size: clamp(24px, 2.2vw, 32px); margin: 12px 0; }
.factory-cards .hint { margin: 10px 0 0; font-size: 12px; }
.factory-cards .btn { margin-top: 4px; }
.factory-calculation { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 20px 0 8px; font-size: 12px; color: #536477; line-height: 1.8; }
.factory-records { border-top: 1px solid #dce5ef; margin-top: 20px; padding-top: 16px; }
.factory-records summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.factory-records .scroll-x { margin-top: 12px; }
@media (max-width: 520px) { .factory-cards { grid-template-columns: 1fr; } }
