.pdd-upload-order-card.is-reconcile {
  border-top-color: #cf1322;
  border-color: #ffa39e;
}

.pdd-upload-order-card.is-reconcile:hover {
  border-color: #cf1322;
  box-shadow: 0 8px 20px rgba(207, 19, 34, 0.1);
}

.pdd-upload-card-select:has(input:disabled) {
  color: #9ca3af;
  cursor: not-allowed;
}

.pdd-upload-card-task.is-reconcile {
  border: 1px solid #ffa39e;
  background: #fff1f0;
}

.pdd-upload-card-task-counts {
  min-width: 0;
  color: #4b5563;
}

.pdd-upload-card-task-counts > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-task .pdd-upload-reconcile-reason {
  color: #a8071a;
}

.pdd-upload-reconcile-backdrop {
  z-index: 46;
}

.pdd-upload-reconcile-modal {
  width: min(660px, 100%);
  max-height: min(88vh, 760px);
  overflow: hidden;
  border-radius: 8px;
}

.pdd-upload-reconcile-modal > form {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.pdd-upload-reconcile-modal .modal-body {
  max-height: calc(88vh - 126px);
  overflow-y: auto;
}

.pdd-upload-reconcile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8f9fb;
}

.pdd-upload-reconcile-summary > div {
  min-width: 0;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.pdd-upload-reconcile-summary > div + div {
  border-left: 1px solid #e5e7eb;
}

.pdd-upload-reconcile-summary span,
.pdd-upload-reconcile-field > span {
  color: #6b7280;
  font-size: 12px;
}

.pdd-upload-reconcile-summary strong {
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-reconcile-alert,
.pdd-upload-reconcile-unavailable {
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  border: 1px solid #ffa39e;
  border-radius: 6px;
  background: #fff1f0;
  color: #820014;
}

.pdd-upload-reconcile-alert span,
.pdd-upload-reconcile-unavailable span {
  color: #5c0011;
  font-size: 12px;
  line-height: 1.6;
}

.pdd-upload-reconcile-alert small {
  color: #a8071a;
  font-size: 11px;
}

.pdd-upload-reconcile-unavailable {
  border-color: #ffe58f;
  background: #fffbe6;
  color: #874d00;
}

.pdd-upload-reconcile-unavailable span {
  color: #613400;
}

.pdd-upload-reconcile-field {
  display: grid;
  gap: 6px;
}

.pdd-upload-reconcile-field input,
.pdd-upload-reconcile-field select,
.pdd-upload-reconcile-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.pdd-upload-reconcile-field input,
.pdd-upload-reconcile-field select {
  height: 40px;
  padding: 0 10px;
}

.pdd-upload-reconcile-field textarea {
  min-height: 86px;
  padding: 9px 10px;
  resize: vertical;
}

.pdd-upload-reconcile-field input:focus,
.pdd-upload-reconcile-field select:focus,
.pdd-upload-reconcile-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(224, 46, 36, 0.12);
}

.pdd-upload-reconcile-decisions {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 0;
}

.pdd-upload-reconcile-decisions legend {
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 12px;
}

.pdd-upload-reconcile-decisions label {
  min-width: 0;
  min-height: 64px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.pdd-upload-reconcile-decisions label:has(input:checked) {
  border-color: var(--primary);
  background: #fff2f0;
  box-shadow: 0 0 0 2px rgba(224, 46, 36, 0.08);
}

.pdd-upload-reconcile-decisions input {
  margin-top: 3px;
}

.pdd-upload-reconcile-decisions label > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.pdd-upload-reconcile-decisions strong {
  color: #111827;
  font-size: 13px;
}

.pdd-upload-reconcile-decisions small {
  color: #6b7280;
  font-size: 11px;
}

[data-pdd-upload-reconcile-success-fields] {
  display: grid;
  gap: 12px;
}

[data-pdd-upload-reconcile-success-fields][hidden] {
  display: none;
}

.pdd-upload-reconcile-consequence {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 620px) {
  .pdd-upload-reconcile-summary,
  .pdd-upload-reconcile-decisions {
    grid-template-columns: 1fr;
  }

  .pdd-upload-reconcile-summary > div + div {
    border-top: 1px solid #e5e7eb;
    border-left: 0;
  }
}
