.project-finance-mount {
  margin: 16px 0;
}

.payment-project-context {
  min-height: 64px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  color: #4f718e;
  background: rgba(55, 133, 213, .065);
  border: 1px solid rgba(55, 133, 213, .12);
  border-radius: 15px;
}

.payment-project-context[hidden] {
  display: none;
}

.payment-project-context > span,
.payment-project-context > small {
  display: block;
  font-size: 9px;
}

.payment-project-context > strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: #2e79ca;
  font-size: 15px;
}

.project-period-readonly {
  min-height: 76px;
  padding: 11px 13px;
  display: grid;
  align-content: center;
  background: rgba(55, 133, 213, .045);
  border: 1px solid rgba(55, 133, 213, .08);
  border-radius: 14px;
}

.project-period-readonly > span,
.project-period-readonly > strong,
.project-period-readonly > small {
  display: block;
}

.project-period-readonly > span {
  color: var(--muted);
  font-size: 9px;
}

.project-period-readonly > strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 10.5px;
}

.project-period-readonly > small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.projects-finance-mount {
  margin-bottom: 16px;
}

.finance-loading,
.finance-load-error,
.finance-empty {
  min-height: 112px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.finance-loading {
  font-size: 11px;
}

.finance-load-error strong,
.finance-empty strong {
  color: var(--text);
  font-size: 12px;
}

.finance-load-error span,
.finance-empty span {
  max-width: 420px;
  font-size: 10px;
}

.finance-load-error button {
  color: #367fcf;
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 650;
}

.project-finance-card,
.projects-finance-overview {
  padding: 20px 22px;
}

.project-finance-head,
.projects-finance-overview > header,
.finance-integration-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.project-finance-head > div > span,
.projects-finance-overview > header > div > span,
.finance-integration-card > header > div > span {
  display: block;
  color: #7f91a4;
  font-size: 9px;
  font-weight: 680;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.project-finance-head > div > div {
  display: flex;
  align-items: baseline;
  gap: 13px;
}

.project-finance-head h2,
.projects-finance-overview h2,
.finance-integration-card h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.project-finance-head > div > div > strong {
  color: #2e79ca;
  font-size: 15px;
  font-weight: 720;
}

.project-finance-head p,
.finance-integration-card header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.finance-add-button {
  min-height: 35px;
  padding: 0 13px;
  color: #fff;
  background: linear-gradient(135deg, #287ee7, #54b6eb);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(40, 126, 231, .14);
  font-size: 10px;
  font-weight: 650;
}

.project-finance-list {
  margin-top: 13px;
  display: grid;
}

.finance-payment-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(100px, .55fr) minmax(130px, .72fr) auto;
  align-items: center;
  gap: 13px;
  padding: 9px 0;
  border-top: 1px solid rgba(72, 96, 121, .09);
}

.finance-payment-row:first-child {
  border-top: 0;
}

.finance-payment-main,
.finance-payment-amount,
.finance-payment-receipt {
  min-width: 0;
}

.finance-payment-main > strong,
.finance-payment-main > small,
.finance-payment-amount > strong,
.finance-payment-amount > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-payment-main > strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 650;
}

.finance-payment-main > small,
.finance-payment-amount > small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
}

.finance-payment-amount {
  text-align: right;
}

.finance-payment-amount > strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.finance-status {
  width: max-content;
  max-width: 100%;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  color: #4c728f;
  background: rgba(76, 114, 143, .08);
  border-radius: 7px;
  font-size: 7.5px;
  font-weight: 720;
  letter-spacing: .02em;
}

.finance-status.is-paid {
  color: #287b5e;
  background: rgba(40, 123, 94, .09);
}

.finance-status.is-pending,
.finance-status.is-creating {
  color: #3378c4;
  background: rgba(51, 120, 196, .09);
}

.finance-status.is-refunded,
.finance-status.is-failed,
.finance-status.is-expired,
.finance-status.is-cancelled {
  color: #b25b50;
  background: rgba(178, 91, 80, .09);
}

.finance-payment-receipt {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 8.5px;
}

.finance-payment-receipt.is-required {
  color: #aa6653;
}

.finance-payment-receipt button,
.finance-payment-actions button,
.finance-payment-actions a {
  padding: 3px 0;
  color: #3b7fc8;
  background: transparent;
  border: 0;
  font-size: 8px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.finance-payment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px 9px;
}

.finance-show-all {
  width: 100%;
  min-height: 32px;
  margin-top: 6px;
  color: #3f82cf;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(72, 96, 121, .08);
  font-size: 9px;
  font-weight: 650;
  text-align: left;
}

.finance-show-all span {
  margin-left: 4px;
  padding: 2px 6px;
  background: rgba(63, 130, 207, .08);
  border-radius: 6px;
}

.projects-finance-numbers {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.projects-finance-numbers > div {
  min-height: 84px;
  padding: 13px 15px;
  background: rgba(61, 130, 207, .045);
  border: 1px solid rgba(61, 130, 207, .08);
  border-radius: 15px;
}

.projects-finance-numbers span,
.projects-finance-numbers small {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
}

.projects-finance-numbers strong {
  display: block;
  margin: 4px 0 1px;
  color: var(--text);
  font-size: 18px;
  font-weight: 720;
}

.finance-unassigned {
  margin-top: 13px;
  padding: 13px 15px 4px;
  background: rgba(212, 137, 62, .055);
  border: 1px solid rgba(212, 137, 62, .11);
  border-radius: 16px;
}

.finance-unassigned > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.finance-unassigned > div:first-child strong {
  color: var(--text);
  font-size: 10px;
}

.finance-unassigned > div:first-child span {
  color: #a36d43;
  font-size: 8.5px;
}

.finance-dialog-backdrop,
.finance-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2200;
  padding: 22px;
  display: grid;
  place-items: center;
  background: rgba(22, 39, 58, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, background-color .18s ease, visibility 0s linear .18s;
}

.finance-dialog-backdrop:is(.is-open, .is-closing),
.finance-drawer-backdrop:is(.is-opening, .is-open, .is-closing) {
  visibility: visible;
}

.finance-dialog-backdrop.is-open,
.finance-drawer-backdrop.is-open {
  opacity: 1;
  background: rgba(22, 39, 58, .28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
}

.finance-dialog-backdrop[hidden],
.finance-drawer-backdrop[hidden],
.finance-field[hidden] {
  display: none;
}

.finance-dialog {
  width: min(680px, 100%);
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  background: var(--modal-panel);
  border: 1px solid var(--modal-line);
  border-radius: 22px;
  box-shadow: var(--modal-shadow);
  opacity: 0;
  transform: translateY(7px) scale(.992);
  transition: opacity .2s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}

.finance-dialog-backdrop.is-open .finance-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.finance-small-dialog {
  width: min(630px, 100%);
}

.finance-dialog-head {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) 42px;
  align-items: start;
  gap: 14px;
  padding: 22px 23px 16px;
}

.finance-dialog-head > div:nth-child(2) {
  min-width: 0;
}

.finance-dialog-head > div:nth-child(2) > span {
  display: block;
  color: #7790a6;
  font-size: 9px;
  font-weight: 680;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.finance-dialog-head h2 {
  margin: 3px 0 3px;
  color: var(--text);
  font-size: 23px;
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.finance-dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.finance-dialog-head > button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--modal-panel-soft);
  border: 1px solid var(--modal-line);
  border-radius: 14px;
  font-size: 23px;
}

.finance-dialog-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #277fea, #54b6eb);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(39, 127, 234, .18);
  font-size: 15px;
  font-weight: 700;
}

.finance-dialog-mark.is-success {
  background: linear-gradient(135deg, #2c916d, #5fc39a);
}

.finance-dialog-mark.is-danger {
  background: linear-gradient(135deg, #bd6258, #e28c78);
}

.finance-dialog-body {
  min-height: 0;
  padding: 0 23px 20px;
  overflow: auto;
}

.finance-source-switch {
  margin-bottom: 17px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.finance-source-switch label {
  position: relative;
  cursor: pointer;
}

.finance-source-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.finance-source-switch label > span {
  min-height: 66px;
  padding: 12px 14px;
  display: grid;
  align-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, .22);
  border: 1px solid var(--modal-line);
  border-radius: 16px;
}

.finance-source-switch input:checked + span {
  color: #326da9;
  background: rgba(55, 133, 213, .08);
  border-color: rgba(55, 133, 213, .25);
  box-shadow: inset 0 0 0 1px rgba(55, 133, 213, .05);
}

.finance-source-switch strong,
.finance-source-switch small {
  display: block;
}

.finance-source-switch strong {
  color: var(--text);
  font-size: 11px;
}

.finance-source-switch small {
  margin-top: 2px;
  font-size: 8.5px;
}

.finance-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.finance-field {
  min-width: 0;
  display: block;
}

.finance-field.is-wide,
.finance-form-section.is-wide,
.finance-form-error.is-wide {
  grid-column: 1 / -1;
}

.finance-field > span,
.finance-form-section > span {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
}

.finance-field input,
.finance-field select,
.finance-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--modal-field);
  border: 1px solid var(--modal-line);
  border-radius: 14px;
  outline: 0;
  font-size: 12px;
}

.finance-field textarea {
  min-height: 82px;
  resize: vertical;
}

.finance-field input:focus,
.finance-field select:focus,
.finance-field textarea:focus {
  border-color: rgba(55, 133, 213, .52);
  box-shadow: 0 0 0 3px rgba(55, 133, 213, .1);
}

.finance-form-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--modal-line);
}

.finance-comment-field {
  margin-top: 14px;
}

.finance-form-note {
  margin-top: 14px;
  padding: 10px 12px;
  color: #627d96;
  background: rgba(55, 133, 213, .055);
  border: 1px solid rgba(55, 133, 213, .09);
  border-radius: 12px;
  font-size: 9px;
  line-height: 1.5;
}

.finance-form-error {
  margin-top: 12px;
  padding: 10px 12px;
  color: #b24d45;
  background: rgba(178, 77, 69, .08);
  border: 1px solid rgba(178, 77, 69, .14);
  border-radius: 12px;
  font-size: 10px;
}

.finance-form-error[hidden] {
  display: none;
}

.finance-dialog-footer {
  padding: 16px 27px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--modal-line);
}

.finance-button {
  min-height: 39px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 680;
}

.finance-button.primary {
  color: #fff;
  background: linear-gradient(135deg, #277fea, #54b6eb);
  border: 0;
}

.finance-button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, .22);
  border: 1px solid var(--modal-line);
}

.finance-button.danger {
  color: #fff;
  background: linear-gradient(135deg, #b8534c, #db7b68);
  border: 0;
}

.finance-result-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.finance-result-status small {
  color: var(--muted);
  font-size: 9px;
}

.finance-link-box {
  margin-top: 15px;
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  background: rgba(55, 133, 213, .055);
  border: 1px solid rgba(55, 133, 213, .1);
  border-radius: 14px;
}

.finance-link-box input {
  min-width: 0;
  padding: 8px 10px;
  color: var(--text);
  background: var(--modal-field);
  border: 1px solid var(--modal-line);
  border-radius: 10px;
  font-size: 9px;
}

.finance-link-box button,
.finance-link-box a {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  color: #347bc3;
  background: rgba(255, 255, 255, .25);
  border: 1px solid var(--modal-line);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 650;
  text-decoration: none;
}

.finance-ready-project {
  margin-top: 15px;
  padding: 14px;
  color: #436958;
  background: rgba(49, 145, 103, .07);
  border: 1px solid rgba(49, 145, 103, .13);
  border-radius: 15px;
}

.finance-ready-project strong {
  color: var(--text);
  font-size: 11px;
}

.finance-ready-project p {
  margin: 3px 0 11px;
  font-size: 9px;
}

.finance-drawer-backdrop {
  place-items: stretch end;
  padding: 0;
}

.finance-drawer {
  width: min(680px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(64, 152, 235, .1), transparent 30%),
    var(--modal-panel);
  border-left: 1px solid var(--modal-line);
  box-shadow: -22px 0 55px rgba(28, 49, 70, .17);
  animation: financeDrawerIn .22s ease-out both;
}

.finance-drawer > header {
  padding: 24px 25px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.finance-drawer > header span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.finance-drawer > header h2 {
  margin: 3px 0 0;
  font-size: 21px;
}

.finance-drawer > header > div:last-child {
  display: flex;
  gap: 7px;
}

.finance-drawer > header button {
  min-height: 34px;
  padding: 0 11px;
  color: #397ec5;
  background: rgba(255, 255, 255, .24);
  border: 1px solid var(--modal-line);
  border-radius: 11px;
  font-size: 10px;
}

.finance-history-summary {
  margin: 0 25px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.finance-history-summary > div {
  padding: 11px 13px;
  background: rgba(55, 133, 213, .055);
  border: 1px solid rgba(55, 133, 213, .09);
  border-radius: 13px;
}

.finance-history-summary span,
.finance-history-summary strong {
  display: block;
}

.finance-history-summary span {
  color: var(--muted);
  font-size: 8px;
}

.finance-history-summary strong {
  margin-top: 3px;
  font-size: 14px;
}

.finance-drawer-list {
  min-height: 0;
  padding: 0 25px 25px;
  overflow: auto;
}

.finance-drawer-list .finance-payment-row {
  grid-template-columns: minmax(145px, 1.2fr) 100px minmax(115px, .7fr) auto;
}

.finance-integration-mount {
  margin-top: 16px;
}

.finance-integration-card > header {
  justify-content: flex-start;
}

.finance-bank-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #7658e8, #a783ee);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(118, 88, 232, .16);
  font-size: 15px;
  font-weight: 720;
}

.finance-integration-card > header > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.finance-integration-badge {
  min-height: 24px;
  padding: 3px 9px;
  color: #758494;
  background: rgba(117, 132, 148, .08);
  border-radius: 8px;
  font-size: 8px;
  font-weight: 680;
  white-space: nowrap;
}

.finance-integration-badge.is-connected {
  color: #2f7f61;
  background: rgba(47, 127, 97, .09);
}

.finance-integration-badge.is-warning {
  color: #a26821;
  background: rgba(202, 132, 46, .1);
}

.finance-integration-details {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.finance-integration-details > div {
  padding: 11px 13px;
  background: rgba(55, 133, 213, .04);
  border: 1px solid rgba(55, 133, 213, .075);
  border-radius: 13px;
}

.finance-integration-details span,
.finance-integration-details strong {
  display: block;
}

.finance-integration-details span {
  color: var(--muted);
  font-size: 8px;
}

.finance-integration-details strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 10px;
  font-weight: 630;
}

.finance-integration-warning {
  margin-top: 10px;
  padding: 10px 12px;
  color: #a7684c;
  background: rgba(187, 111, 69, .07);
  border: 1px solid rgba(187, 111, 69, .12);
  border-radius: 12px;
  font-size: 9px;
}

.finance-integration-actions {
  margin-top: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.finance-link-danger,
.finance-back-link {
  padding: 6px 2px;
  color: #af584f;
  background: transparent;
  border: 0;
  font-size: 9px;
  font-weight: 650;
}

.finance-back-link {
  margin: 12px 0 8px;
  color: #3b7fc8;
}

.finance-integration-form {
  max-width: 690px;
  margin-top: 17px;
  display: grid;
  gap: 12px;
}

.finance-integration-form > p {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.finance-integration-form .finance-button {
  width: max-content;
}

:root[data-theme="dark"] .finance-dialog,
:root[data-theme="dark"] .finance-drawer {
  background:
    radial-gradient(circle at 10% 0%, rgba(64, 152, 235, .13), transparent 32%),
    linear-gradient(180deg, var(--modal-panel), var(--modal-panel-soft));
}

:root[data-theme="dark"] .finance-payment-main > strong,
:root[data-theme="dark"] .finance-payment-amount > strong,
:root[data-theme="dark"] .project-finance-head h2,
:root[data-theme="dark"] .projects-finance-overview h2 {
  color: var(--text);
}

@keyframes financeDrawerIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 900px) {
  .finance-payment-row,
  .finance-drawer-list .finance-payment-row {
    grid-template-columns: minmax(0, 1.3fr) 110px minmax(120px, .8fr);
  }

  .finance-payment-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 1px;
  }
}

@media (max-width: 700px) {
  .projects-finance-numbers,
  .finance-integration-details {
    grid-template-columns: 1fr;
  }

  .finance-dialog-backdrop {
    padding: 0;
    place-items: end stretch;
  }

  .finance-dialog {
    width: 100%;
    max-height: 94dvh;
    border-radius: 24px 24px 0 0;
  }

  .finance-source-switch,
  .finance-form-grid {
    grid-template-columns: 1fr;
  }

  .finance-field.is-wide,
  .finance-form-section.is-wide,
  .finance-form-error.is-wide {
    grid-column: auto;
  }

  .finance-dialog-head {
    padding: 20px 20px 14px;
  }

  .finance-dialog-body {
    padding: 0 20px 18px;
  }

  .finance-dialog-footer {
    padding: 14px 20px 20px;
  }

  .finance-link-box {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .finance-link-box a {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .project-finance-card,
  .projects-finance-overview {
    padding: 17px;
  }

  .project-finance-head,
  .projects-finance-overview > header {
    align-items: center;
  }

  .finance-payment-row,
  .finance-drawer-list .finance-payment-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 12px 0;
  }

  .finance-payment-receipt,
  .finance-payment-actions {
    grid-column: 1 / -1;
  }

  .finance-payment-amount {
    align-self: center;
  }

  .finance-unassigned > div:first-child {
    display: grid;
  }

  .finance-drawer > header,
  .finance-drawer-list {
    padding-left: 18px;
    padding-right: 18px;
  }

  .finance-history-summary {
    margin-left: 18px;
    margin-right: 18px;
  }

  .finance-integration-card > header {
    flex-wrap: wrap;
  }

  .finance-integration-badge {
    margin-left: 58px;
  }
}

/* Compact payment history shared by the dashboard and a project card. */
.finance-drawer-backdrop {
  padding: 22px;
  place-items: center;
  background: rgba(22, 39, 58, 0);
}

.finance-popover {
  position: relative;
  z-index: 1;
  width: min(840px, calc(100vw - 44px));
  max-height: min(690px, calc(100dvh - 24px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--text);
  background: var(--modal-panel);
  border: 1px solid var(--modal-line);
  border-radius: 24px;
  box-shadow: var(--modal-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  transform: translateY(6px) scale(.995);
  transition: opacity .2s ease, transform .24s cubic-bezier(.2, .75, .25, 1);
}

.finance-project-payments {
  width: min(760px, calc(100vw - 44px));
  grid-template-rows: auto auto minmax(0, 1fr);
}

.finance-drawer-backdrop.is-open .finance-popover {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.finance-drawer-backdrop.is-closing .finance-popover {
  opacity: 0;
  transform: translateY(5px) scale(.995);
  transition-duration: .18s;
}

.finance-popover > header {
  padding: 18px 18px 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--modal-line);
}

.finance-popover > header > div:first-child > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.finance-popover > header h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 22px;
  letter-spacing: -.035em;
}

.finance-popover > header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.finance-popover > header > div:last-child,
.finance-history-head-actions {
  display: flex;
  gap: 7px;
}

.finance-popover > header button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--modal-line);
  border-radius: 10px;
  color: var(--text);
  background: var(--modal-field);
  font-size: 10px;
  font-weight: 750;
}

.finance-popover > header [data-history-link] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #6677ec, #596ce1);
}

.finance-popover > header [data-history-close] {
  width: 36px;
  padding: 0;
  font-size: 19px;
}

.finance-popover .finance-history-summary {
  padding: 0 18px 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-popover .finance-history-summary > div {
  min-height: 64px;
  padding: 10px 11px;
  background: var(--modal-panel-soft);
  border-color: var(--modal-line);
}

.finance-history-tools {
  padding: 0 18px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 10px;
}

.finance-history-tools label {
  display: grid;
  gap: 5px;
}

.finance-history-tools label > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.finance-history-tools :is(input, select) {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--text);
  background: var(--modal-field);
  border: 1px solid var(--modal-line);
  border-radius: 11px;
  outline: none;
}

.finance-popover .finance-history-summary span {
  font-size: 10px;
}

.finance-popover .finance-history-summary strong {
  font-size: 16px;
}

.finance-popover-list {
  min-height: 0;
  padding: 0 10px 14px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--modal-panel);
}

.finance-history-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 9px;
  border-top: 1px solid var(--modal-line);
  border-radius: 13px;
}

.finance-empty div {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.finance-empty button {
  min-height: 34px;
  padding: 0 11px;
  color: #596ce1;
  background: var(--modal-field);
  border: 1px solid var(--modal-line);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}

.finance-history-row:first-child {
  border-top-color: transparent;
}

.finance-history-row.is-focus {
  background: rgba(99, 116, 234, .07);
  box-shadow: inset 0 0 0 1px rgba(99, 116, 234, .12);
}

.finance-history-row.is-updated,
.agency-payment-live-row-v14.is-updated {
  background: rgba(16, 185, 129, .1);
  transition: background-color .42s ease;
}

.finance-history-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #6574d9;
  background: rgba(99, 116, 234, .1);
  font-size: 10px;
  font-weight: 800;
}

.finance-history-copy {
  min-width: 0;
}

.finance-history-copy > strong,
.finance-history-copy > span,
.finance-history-copy > small,
.finance-history-copy > em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-history-copy > strong {
  color: var(--appearance-workspace-text-primary, #182532);
  font-size: 13px;
}

.finance-history-copy > span,
.finance-history-copy > small {
  margin-top: 4px;
  color: var(--appearance-workspace-text-secondary, #7d8d9f);
  font-size: 10px;
}

.finance-history-copy > em {
  width: max-content;
  max-width: 100%;
  margin-top: 7px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #287f5b;
  background: rgba(57, 169, 111, .1);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.finance-history-side {
  min-width: 126px;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.finance-history-side > b {
  color: var(--appearance-workspace-text-primary, #182532);
  font-size: 13px;
}

.finance-history-side > span {
  min-height: 21px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
}

.finance-history-side > span.is-paid {
  color: #247a57;
  background: rgba(45, 181, 116, .14);
}

.finance-history-side > span.is-pending {
  color: #986718;
  background: rgba(245, 180, 60, .15);
}

.finance-history-side > span.is-overdue {
  color: #b34f51;
  background: rgba(224, 82, 87, .14);
}

.finance-history-side > button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(99, 116, 234, .18);
  border-radius: 8px;
  color: #5a69c8;
  background: rgba(99, 116, 234, .08);
  font-size: 9px;
  font-weight: 750;
}

.finance-history-actions {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.finance-history-actions button,
.finance-history-actions a {
  padding: 0;
  border: 0;
  color: #6272d2;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
}

.finance-payment-binder {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 12px;
  background: rgba(255, 255, 255, .5);
}

.finance-payment-binder[hidden] {
  display: none;
}

.finance-payment-binder select {
  min-width: 0;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid rgba(120, 139, 157, .18);
  border-radius: 9px;
  color: #253548;
  background: rgba(255, 255, 255, .82);
  font-size: 11px;
}

.finance-payment-binder button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 750;
}

.finance-payment-binder .save {
  color: #fff;
  background: #6273e8;
}

.finance-payment-binder .cancel {
  color: #65768a;
  background: rgba(255, 255, 255, .8);
}

.finance-field > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.finance-popover .finance-history-copy > strong,
.finance-popover .finance-history-side > b {
  color: var(--text);
}

.finance-popover .finance-history-copy > span,
.finance-popover .finance-history-copy > small {
  color: var(--muted);
}

.finance-popover .finance-payment-binder {
  background: var(--modal-panel-soft);
  border-color: var(--modal-line);
}

.finance-popover .finance-payment-binder :is(select, .cancel) {
  color: var(--text);
  background: var(--modal-field);
  border-color: var(--modal-line);
}

@media (max-width: 760px) {
  .finance-popover {
    width: 100%;
    max-height: 78dvh;
    border-radius: 22px;
  }

  .finance-history-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .finance-popover .finance-history-summary {
    grid-template-columns: 1fr 1fr;
  }

  .finance-popover .finance-history-summary > div:first-child {
    grid-column: 1 / -1;
  }

  .finance-history-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .finance-history-side {
    grid-column: 2;
    min-width: 0;
    justify-items: start;
    grid-template-columns: auto auto;
    align-items: center;
  }

  .finance-history-side > button {
    grid-column: 1 / -1;
  }

  .finance-history-actions,
  .finance-payment-binder {
    grid-column: 1 / -1;
  }

  .finance-payment-binder {
    grid-template-columns: 1fr 1fr;
  }

  .finance-payment-binder select {
    grid-column: 1 / -1;
  }
}
