.apr-reconciliation-source-panel {
  margin-bottom: 1rem;
}

.apr-reconciliation-source-body {
  display: grid;
  gap: 1rem;
}

.apr-reconciliation-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 0.85rem;
  align-items: end;
}

.apr-reconciliation-controls label {
  display: grid;
  gap: 0.4rem;
}

.apr-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.86rem;
}

.apr-cross-month-note,
.apr-ready-note,
.apr-warning-note {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.8rem;
}

.apr-cross-month-note,
.apr-ready-note {
  border: 1px solid rgba(91, 214, 162, 0.35);
  background: rgba(91, 214, 162, 0.09);
}

.apr-warning-note {
  border: 1px solid rgba(255, 184, 77, 0.4);
  background: rgba(255, 184, 77, 0.1);
}

.apr-reconciliation-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.apr-reconciliation-summary-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.025);
}

.apr-reconciliation-summary-card span,
.apr-reconciliation-summary-card small {
  color: var(--muted, #aab3c0);
}

.apr-reconciliation-summary-card strong {
  font-size: 1.45rem;
}

.apr-current-sync,
.apr-current-sync-empty {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid rgba(91, 214, 162, 0.3);
  border-radius: 0.8rem;
  background: rgba(91, 214, 162, 0.055);
}

.apr-current-sync p,
.apr-current-sync-empty p {
  margin: 0.15rem 0 0;
}

.apr-current-sync-values,
.apr-current-sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.apr-current-sync-values span {
  display: grid;
  gap: 0.2rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.18);
}

.apr-current-sync-values small {
  color: var(--muted, #aab3c0);
  font-size: 0.72rem;
}

.apr-synced-input {
  border-color: rgba(91, 214, 162, 0.5) !important;
  background: rgba(91, 214, 162, 0.08) !important;
}

.apr-manually-adjusted-input {
  border-color: rgba(255, 184, 77, 0.65) !important;
  background: rgba(255, 184, 77, 0.1) !important;
}

.apr-pending-adjustment-input {
  outline: 2px solid rgba(255, 184, 77, 0.75);
  outline-offset: 1px;
}

.apr-adjustment-reason-required {
  border-color: rgba(255, 104, 104, 0.85) !important;
  box-shadow: 0 0 0 2px rgba(255, 104, 104, 0.15);
}

.apr-synced-chip {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.16rem 0.38rem;
  border-radius: 999px;
  border: 1px solid rgba(91, 214, 162, 0.35);
  color: #8fe1bd;
  font-size: 0.68rem;
  white-space: nowrap;
}

.apr-synced-chip.manual {
  border-color: rgba(255, 184, 77, 0.5);
  color: #ffd28c;
  background: rgba(255, 184, 77, 0.08);
}

.apr-audit-history-detail {
  margin-top: 0.3rem !important;
  color: var(--muted, #aab3c0);
  font-size: 0.82rem;
}

.apr-reconciliation-cases-dialog {
  width: min(1100px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.9rem;
  background: #111820;
  color: inherit;
}

.apr-reconciliation-cases-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.apr-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

body #toast.toast {
  top: auto;
  right: 24px;
  bottom: 24px;
  left: auto;
  display: block;
  width: min(360px, calc(100vw - 48px));
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 12px 14px;
  border-left-width: 4px;
  border-radius: 11px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  font-size: 0.86rem;
  font-weight: 720;
  line-height: 1.35;
}

body #toast.toast[hidden] {
  display: none !important;
}

@media (max-width: 800px) {
  .apr-reconciliation-controls,
  .apr-reconciliation-summary-grid {
    grid-template-columns: 1fr;
  }

  body #toast.toast {
    right: 16px;
    bottom: 16px;
    width: calc(100vw - 32px);
  }
}
