.finance-deal-balance {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.finance-deal-balance > *,
.finance-deal-balance-summary,
.finance-deal-balance-summary .deal-header-balance {
  min-width: 0;
}

.finance-deal-balance-summary .deal-header-balance {
  width: 100%;
  min-height: 98px;
}

.finance-deal-balance-summary .deal-header-balance-item {
  gap: 5px;
  padding: 15px 18px;
}

.finance-deal-balance-summary .deal-header-balance-item > small {
  font-size: 12px;
}

.finance-deal-balance-summary .deal-header-balance-item > strong {
  font-size: 18px;
  line-height: 1.2;
}

.finance-deal-balance-summary-warning {
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.finance-deal-balance-summary .deal-header-balance-item.is-result .finance-deal-balance-summary-warning {
  color: #b45309;
}

.finance-deal-balance-summary-caption,
.finance-deal-balance-section-title,
.finance-deal-balance-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.finance-deal-balance-summary-caption {
  flex-wrap: wrap;
  margin-top: 9px;
  color: #64748b;
  font-size: 11px;
}

.finance-deal-balance-alert,
.finance-deal-balance-problems,
.finance-deal-balance-accounts,
.finance-deal-balance-table-section {
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  min-width: 0;
}

.finance-deal-balance-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.finance-deal-balance-alert.is-error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.finance-deal-balance-alert p {
  margin: 5px 0 0;
}

.finance-deal-balance-section-title > div,
.finance-deal-balance-table-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.finance-deal-balance-section-title span,
.finance-deal-balance-table-toolbar span {
  color: #64748b;
  font-size: 11px;
}

.finance-deal-balance-problems-title {
  color: #9a3412;
}

.finance-deal-balance-section-title > .finance-deal-balance-problems-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.finance-deal-balance-problems-count {
  padding: 4px 8px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412 !important;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.finance-deal-balance-problem-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.finance-deal-balance-problem-list article {
  display: grid;
  gap: 7px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.finance-deal-balance-problem-list article:hover,
.finance-deal-balance-problem-list article:focus-within {
  border-color: #fbbf24;
  background: #fffbeb;
}

.finance-deal-balance-problem-list article > button {
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.finance-deal-balance-problem-list article > a {
  color: #2563eb;
  font-size: 12px;
}

.finance-deal-balance-problem-list ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
}

.finance-deal-balance-problem-list li::marker {
  color: #d97706;
}

.finance-deal-balance-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.finance-deal-balance-account {
  box-sizing: border-box;
  min-width: 0;
  padding: 11px;
  border: 1px solid #dbe3ee;
  border-radius: 11px;
  background: #fff;
  color: #1e293b;
}

.finance-deal-balance-account dl > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.finance-deal-balance-account-title {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.finance-deal-balance-account-title > b {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
}

.finance-deal-balance-account-title > strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.finance-deal-balance-account.is-rub .finance-deal-balance-account-title > b {
  background: var(--finance-account-rub-bg);
  color: var(--finance-account-rub-text);
}

.finance-deal-balance-account.is-usd .finance-deal-balance-account-title > b {
  background: var(--finance-account-usd-bg);
  color: var(--finance-account-usd-text);
}

.finance-deal-balance-account.is-usdt .finance-deal-balance-account-title > b {
  background: var(--finance-account-usdt-bg);
  color: var(--finance-account-usdt-text);
}

.finance-deal-balance-account.is-rmb .finance-deal-balance-account-title > b {
  background: var(--finance-account-rmb-bg);
  color: var(--finance-account-rmb-text);
}

.finance-deal-balance-account.is-eur .finance-deal-balance-account-title > b {
  background: var(--finance-account-eur-bg);
  color: var(--finance-account-eur-text);
}

.finance-deal-balance-account dl {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  font-size: 12px;
}

.finance-deal-balance-account dt {
  color: #64748b;
}

.finance-deal-balance-account dd {
  margin: 0;
  font-weight: 650;
}

.finance-deal-balance-account .is-balance-hidden {
  color: #64748b;
  font-style: italic;
  font-weight: 600;
}

.finance-deal-balance-account dl .is-filtered-value {
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px dashed #cbd5e1;
  color: #1d4ed8;
}

.finance-deal-balance-account .is-shortage {
  margin: 9px 0 0;
  color: #b91c1c;
  font-weight: 700;
}

.finance-deal-balance-account .is-data-warning {
  margin: 9px 0 0;
  color: #b45309;
  font-size: 12px;
  font-weight: 650;
}

.finance-deal-balance-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #fff;
}

.finance-deal-balance-filter-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.finance-deal-balance-filter-field > span {
  color: #64748b;
  font-size: 12px;
}

.finance-deal-balance-filter-field > .auth-input,
.finance-deal-balance-filter-field > .custom-select,
.finance-deal-balance-filter-field .custom-select-button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 40px;
}

.finance-deal-balance-filter-actions {
  display: flex;
  grid-column: span 2;
  justify-content: flex-end;
  gap: 8px;
}

.finance-deal-balance-filter-actions button {
  flex: 0 1 200px;
  min-width: 0;
  min-height: 40px;
}

.finance-deal-balance-zoom {
  display: flex;
  align-items: center;
  gap: 5px;
}

.finance-deal-balance-zoom > button {
  width: 34px;
  height: 34px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.finance-deal-balance-table-toolbar {
  margin-bottom: 10px;
}

.finance-deal-balance-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: min(72vh, 780px);
  overflow: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #fff;
}

.finance-deal-balance-scale {
  width: max-content;
  min-width: 100%;
  transform-origin: top left;
}

.finance-deal-balance-scale table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  line-height: 1.3;
}

.finance-deal-balance-scale th,
.finance-deal-balance-scale td {
  box-sizing: border-box;
  padding: 7px 8px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  vertical-align: top;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.finance-deal-balance-scale thead th {
  position: sticky;
  z-index: 5;
  top: 0;
  height: 32px;
  padding-block: 7px;
  background: #e9eef5;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  vertical-align: middle;
}

.finance-deal-balance-scale thead .finance-deal-balance-column-head th {
  top: 32px;
  background: #f8fafc;
}

.finance-deal-balance-scale thead .is-group-incoming {
  background: #e8f5ee;
  color: #166534;
}

.finance-deal-balance-scale thead .is-group-summary {
  border-inline: 2px solid #cbd5e1;
  background: #e2e8f0;
}

.finance-deal-balance-scale thead .is-group-obligations {
  background: #fff7ed;
  color: #9a3412;
}

.finance-deal-balance-scale thead .is-group-payments {
  background: #eef6ff;
  color: #1d4ed8;
}

.finance-deal-balance-scale .is-sticky-deal {
  position: sticky;
  z-index: 4;
  left: 0;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  box-shadow: 2px 0 0 #cbd5e1;
}

.finance-deal-balance-scale thead .is-sticky-deal {
  z-index: 8;
  background: #e2e8f0;
}

.finance-deal-balance-deal-cell {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding-right: 28px;
  text-align: left;
}

.finance-deal-balance-deal-cell > a {
  display: -webkit-box;
  overflow: hidden;
  color: #1d4ed8;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.finance-deal-balance-deal-cell > a:hover,
.finance-deal-balance-deal-cell > a:focus-visible {
  text-decoration: underline;
}

.finance-deal-balance-deal-client,
.finance-deal-balance-deal-meta {
  display: block;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-deal-balance-deal-client {
  color: #334155;
  font-weight: 700;
}

.finance-deal-balance-freshness-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.finance-deal-balance-freshness {
  max-width: 100%;
  overflow: hidden;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-deal-balance-freshness.is-reliable {
  background: #dcfce7;
  color: #166534;
}

.finance-deal-balance-freshness.is-warning {
  background: #ffedd5;
  color: #9a3412;
}

.finance-deal-balance-scale tbody tr.is-problem-focus > * {
  animation: finance-deal-balance-focus 1.8s ease;
}

@keyframes finance-deal-balance-focus {
  0%,
  45% {
    box-shadow: inset 0 0 0 2px #2563eb;
    background: #eff6ff;
  }
}

.finance-deal-balance-scale tbody tr:hover > td,
.finance-deal-balance-scale tbody tr:hover > th {
  box-shadow: inset 0 1px 0 #bfdbfe, inset 0 -1px 0 #bfdbfe;
}

.finance-deal-balance-scale tbody tr:hover > .is-sticky-deal {
  box-shadow: inset 0 1px 0 #bfdbfe, inset 0 -1px 0 #bfdbfe, 2px 0 0 #94a3b8;
}

.finance-deal-balance-scale .is-incoming-column {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
}

.finance-deal-balance-scale .is-usd-column {
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  background: #f8fafc;
}

.finance-deal-balance-scale .is-usd-first {
  border-left: 2px solid #cbd5e1;
}

.finance-deal-balance-scale .is-usd-last {
  border-right: 2px solid #cbd5e1;
}

.finance-deal-balance-scale thead .finance-deal-balance-column-head .is-usd-column {
  background: #eef2f7;
}

.finance-deal-balance-usd-header-label,
.finance-deal-balance-usd-header-label + strong,
.finance-deal-balance-usd-value strong,
.finance-deal-balance-usd-value small {
  display: block;
}

.finance-deal-balance-usd-header-label {
  margin-bottom: 3px;
}

.finance-deal-balance-scale thead .is-usd-column strong,
.finance-deal-balance-usd-value strong {
  color: #1e293b;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.finance-deal-balance-scale thead .is-usd-column small,
.finance-deal-balance-usd-value small {
  margin-top: 1px;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
}

.finance-deal-balance-scale .is-obligations-column {
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

.finance-deal-balance-scale .is-payment-column,
.finance-deal-balance-scale td.finance-deal-balance-payment {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.finance-deal-balance-incoming strong,
.finance-deal-balance-incoming span,
.finance-deal-balance-payment strong,
.finance-deal-balance-payment span {
  display: block;
}

.finance-deal-balance-incoming.is-received,
.finance-deal-balance-payment.is-paid {
  background: #ecfdf5;
  color: #166534;
}

.finance-deal-balance-incoming.is-expected,
.finance-deal-balance-payment.is-unpaid {
  background: #fff1f2;
  color: #991b1b;
}

.finance-deal-balance-incoming strong,
.finance-deal-balance-payment strong {
  white-space: nowrap;
}

.finance-deal-balance-incoming small,
.finance-deal-balance-payment span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.finance-deal-balance-incoming small {
  padding-right: 28px;
}

.finance-deal-balance-payment.has-problem {
  box-shadow: inset 0 0 0 2px #f59e0b;
}

.finance-deal-balance-payment button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.finance-deal-balance-account-obligations {
  display: grid;
  gap: 4px;
}

.finance-deal-balance-account-obligations span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding-bottom: 4px;
  border-bottom: 1px dashed #e2e8f0;
}

.finance-deal-balance-account-obligations span:last-of-type {
  padding-bottom: 0;
  border-bottom: 0;
}

.finance-deal-balance-account-obligations b {
  white-space: nowrap;
}

.finance-deal-balance-account-obligations small {
  display: -webkit-box;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.finance-deal-balance-scale .is-negative {
  color: #b91c1c;
  font-weight: 700;
}

.finance-deal-balance-scale .is-negative .finance-deal-balance-usd-value strong,
.finance-deal-balance-scale thead .is-usd-last strong {
  color: inherit;
}

.finance-deal-balance-more {
  display: block;
  margin: 12px auto 0;
}

.finance-deal-balance-sheet-backdrop {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgb(15 23 42 / 45%);
}

.finance-deal-balance-sheet {
  width: min(620px, 100%);
  max-height: min(720px, 85vh);
  overflow: auto;
  padding: 14px;
  border-radius: 16px 16px 10px 10px;
  background: #fff;
  box-shadow: 0 20px 45px rgb(15 23 42 / 25%);
}

.finance-deal-balance-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.finance-deal-balance-sheet-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.finance-deal-balance-sheet-header > div > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.finance-deal-balance-sheet-header > div > strong {
  color: #1e293b;
  font-size: 19px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.finance-deal-balance-sheet-header button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #1e293b;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.finance-deal-balance-sheet-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #f8fafc;
}

.finance-deal-balance-sheet-hero > div {
  display: grid;
  justify-items: start;
  gap: 5px;
  min-width: 0;
}

.finance-deal-balance-sheet-hero > div > strong {
  color: #0f172a;
  font-size: 24px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.finance-deal-balance-sheet-hero > div > small {
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

.finance-deal-balance-sheet-hero > div > span:last-child {
  color: #475569;
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.finance-deal-balance-sheet-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.finance-deal-balance-sheet-status.is-closed {
  background: #dcfce7;
  color: #166534;
}

.finance-deal-balance-sheet-status.is-confirmed {
  background: #fee2e2;
  color: #991b1b;
}

.finance-deal-balance-sheet-status.is-waiting {
  background: #ffedd5;
  color: #9a3412;
}

.finance-deal-balance-sheet-status.is-review {
  background: #ede9fe;
  color: #6d28d9;
}

.finance-deal-balance-sheet dl {
  display: grid;
  gap: 4px;
  margin: 0;
}

.finance-deal-balance-sheet dl > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
}

.finance-deal-balance-sheet dl > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.finance-deal-balance-sheet dt {
  color: #64748b;
}

.finance-deal-balance-sheet dd {
  margin: 0;
  color: #1e293b;
  font-weight: 650;
  min-width: 0;
  overflow-wrap: anywhere;
}

.finance-deal-balance-sheet-section {
  display: grid;
  gap: 7px;
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
}

.finance-deal-balance-sheet-section h3 {
  margin: 0;
  color: #334155;
  font-size: 13px;
}

.finance-deal-balance-sheet-linked-list {
  display: grid;
  gap: 6px;
}

.finance-deal-balance-sheet-linked-incoming {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
}

.finance-deal-balance-sheet-linked-incoming > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.finance-deal-balance-sheet-linked-incoming > div span {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.finance-deal-balance-sheet-linked-incoming > div strong {
  font-size: 13px;
}

.finance-deal-balance-sheet-linked-incoming.is-received {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.finance-deal-balance-sheet-linked-incoming.is-received > div span {
  background: #dcfce7;
  color: #166534;
}

.finance-deal-balance-sheet-linked-incoming.is-expected {
  border-color: #fed7aa;
  background: #fffaf3;
}

.finance-deal-balance-sheet-linked-incoming.is-expected > div span {
  background: #ffedd5;
  color: #9a3412;
}

.finance-deal-balance-sheet-linked-incoming.is-missing {
  color: #7c2d12;
}

.finance-deal-balance-sheet-linked-incoming.is-missing > div span {
  background: #fee2e2;
}

.finance-deal-balance-sheet-linked-incoming dl > div {
  grid-template-columns: 105px minmax(0, 1fr);
}

.finance-deal-balance-sheet-comparison {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.finance-deal-balance-sheet-comparison article {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #f8fafc;
}

.finance-deal-balance-sheet-comparison article > span,
.finance-deal-balance-sheet-comparison article > small {
  color: #64748b;
  font-size: 11px;
}

.finance-deal-balance-sheet-comparison article > strong {
  color: #0f172a;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.finance-deal-balance-sheet-comparison article > b {
  width: fit-content;
  font-size: 11px;
}

.finance-deal-balance-sheet-comparison .is-difference.is-equal {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.finance-deal-balance-sheet-comparison .is-difference.is-equal > b {
  color: #166534;
}

.finance-deal-balance-sheet-comparison .is-difference.is-over {
  border-color: #fecaca;
  background: #fff1f2;
}

.finance-deal-balance-sheet-comparison .is-difference.is-over > strong,
.finance-deal-balance-sheet-comparison .is-difference.is-over > b {
  color: #991b1b;
}

.finance-deal-balance-sheet-comparison .is-difference.is-under > b {
  color: #991b1b;
}

.finance-deal-balance-sheet-comparison .finance-deal-balance-sheet-no-fact {
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

.finance-deal-balance-sheet-payment-meta {
  margin-top: 3px;
  font-size: 12px;
}

.finance-deal-balance-sheet-notice {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.finance-deal-balance-sheet-notice.is-review {
  background: #f5f3ff;
  color: #6d28d9;
}

.finance-deal-balance-sheet-notice.is-request {
  background: #eff6ff;
  color: #1d4ed8;
}

.finance-deal-balance-sheet-empty {
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
}

.finance-deal-balance-sheet-technical {
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
}

.finance-deal-balance-sheet-technical summary {
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.finance-deal-balance-sheet-technical[open] {
  display: grid;
  gap: 10px;
}

.finance-deal-balance-sheet-link {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
  text-decoration: none;
}

@media (max-width: 700px) {
  .finance-deal-balance-problems .finance-deal-balance-section-title,
  .finance-deal-balance-section-title > .finance-deal-balance-problems-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-deal-balance-sheet {
    padding: 12px;
  }

  .finance-deal-balance-sheet-hero {
    grid-template-columns: 1fr;
  }

  .finance-deal-balance-sheet-comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-deal-balance-sheet-comparison .is-difference {
    grid-column: 1 / -1;
  }

  .finance-deal-balance-summary .deal-header-balance {
    grid-template-columns: 1fr;
  }

  .finance-deal-balance-summary .deal-header-balance-item {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .finance-deal-balance-summary .deal-header-balance-item:last-child {
    border-bottom: 0;
  }

  .finance-deal-balance-summary-caption,
  .finance-deal-balance-alert,
  .finance-deal-balance-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-deal-balance-filters {
    grid-template-columns: 1fr;
  }

  .finance-deal-balance-filter-actions {
    display: grid;
    grid-column: 1;
  }

  .finance-deal-balance-filter-actions button {
    width: 100%;
  }

  .finance-deal-balance-scale .is-sticky-deal {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
  }

  .finance-deal-balance-scroll {
    max-height: calc(100dvh - 160px);
  }
}

/* Current balance workspace */
.finance-deal-balance-instructions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.finance-deal-balance-instructions .balance-sync-rules-panel {
  width: 100%;
  box-sizing: border-box;
}

.finance-deal-balance-instruction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.finance-deal-balance-instruction-grid > section {
  padding: 11px 13px;
  border: 1px solid #cfe0f5;
  border-radius: 10px;
  background: rgb(255 255 255 / 62%);
}

.finance-deal-balance-instruction-grid h4,
.finance-deal-balance-instruction-grid ul {
  margin: 0;
}

.finance-deal-balance-instruction-grid h4 {
  color: #173f70;
  font-size: 13px;
}

.finance-deal-balance-instruction-grid ul {
  padding: 7px 0 0 18px;
  font-size: 12px;
}

.finance-deal-balance-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.finance-deal-balance-overview-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.finance-deal-balance-summary,
.finance-deal-balance-payment-summary,
.finance-deal-balance-expected-summary {
  box-sizing: border-box;
  min-width: 0;
  padding: 13px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #fff;
}

.finance-deal-balance-summary .deal-header-balance {
  grid-template-columns: 1fr;
  min-height: 0;
}

.finance-deal-balance-summary .deal-header-balance-item {
  min-height: 67px;
  padding: 10px 13px;
  border-right: 0;
  border-bottom: 1px solid #e2e8f0;
}

.finance-deal-balance-summary .deal-header-balance-item:last-child {
  border-bottom: 0;
}

.finance-deal-balance-summary-caption {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.finance-deal-balance-payment-summary,
.finance-deal-balance-expected-summary {
  display: grid;
  gap: 9px;
}

.finance-deal-balance-payment-summary-section {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.finance-deal-balance-payment-summary-section.is-confirmed {
  border-color: #fecaca;
  background: #fff1f2;
}

.finance-deal-balance-payment-summary-section.is-waiting {
  border-color: #fed7aa;
  background: #fff7ed;
}

.finance-deal-balance-payment-summary-section.is-review {
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.finance-deal-balance-payment-summary-section h4,
.finance-deal-balance-payment-summary-section p {
  margin: 0;
}

.finance-deal-balance-payment-summary-section h4 {
  font-size: 12px;
}

.finance-deal-balance-payment-summary-section p {
  color: #64748b;
  font-size: 11px;
}

.finance-deal-balance-payment-summary-section > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  font-size: 11px;
}

.finance-deal-balance-payment-summary-section > div span {
  overflow-wrap: anywhere;
}

.finance-deal-balance-payment-summary-section > div strong {
  white-space: nowrap;
}

.finance-deal-balance-payment-summary-section > div small {
  grid-column: 1 / -1;
  color: #7c3aed;
}

.finance-deal-balance-filtered-payment-summary summary {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.finance-deal-balance-filtered-payment-summary[open] {
  display: grid;
  gap: 7px;
}

.finance-deal-balance-expected-summary-section {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.finance-deal-balance-expected-summary-section.is-expected {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.finance-deal-balance-expected-summary-section.is-review {
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.finance-deal-balance-expected-summary-section h4,
.finance-deal-balance-expected-summary-section p {
  margin: 0;
}

.finance-deal-balance-expected-summary-section h4 {
  font-size: 12px;
}

.finance-deal-balance-expected-summary-section p {
  color: #64748b;
  font-size: 11px;
}

.finance-deal-balance-expected-summary-section > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  font-size: 11px;
}

.finance-deal-balance-expected-summary-section > div span {
  overflow-wrap: anywhere;
}

.finance-deal-balance-expected-summary-section > div strong {
  white-space: nowrap;
}

.finance-deal-balance-expected-summary-section > div small {
  grid-column: 1 / -1;
  color: #64748b;
}

.finance-deal-balance-filtered-expected-summary summary {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.finance-deal-balance-filtered-expected-summary[open] {
  display: grid;
  gap: 7px;
}

.finance-deal-balance-account-warning {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid #fed7aa;
  border-radius: 9px;
  background: #fff7ed;
  color: #9a3412;
  font: inherit;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.finance-deal-balance-account-warning span {
  font-size: 11px;
}

.finance-deal-balance-filters {
  display: grid;
  grid-template-columns: 1fr;
}

.finance-deal-balance-filter-primary {
  display: grid;
  grid-template-columns: minmax(300px, 1.6fr) repeat(3, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.finance-deal-balance-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.finance-deal-balance-search-row .auth-input,
.finance-deal-balance-search-row .secondary-button {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
}

.finance-deal-balance-search-row .secondary-button {
  min-width: 76px;
}

.finance-deal-balance-filter-extra {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.finance-deal-balance-filter-extra[hidden] {
  display: none;
}

.finance-deal-balance-filter-actions {
  grid-column: 1;
  justify-content: flex-start;
}

.finance-deal-balance-filter-actions button {
  flex: 0 0 auto;
  min-width: 150px;
}

.finance-deal-balance-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.finance-deal-balance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.finance-deal-balance-legend span {
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.finance-deal-balance-legend .is-closed {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #166534;
}

.finance-deal-balance-legend .is-confirmed {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.finance-deal-balance-legend .is-waiting {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.finance-deal-balance-legend .is-review {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.finance-deal-balance-scale th,
.finance-deal-balance-scale td {
  position: relative;
}

.finance-deal-balance-scale tbody tr:hover > td,
.finance-deal-balance-scale tbody tr:hover > th,
.finance-deal-balance-scale tbody tr:hover > .is-sticky-deal {
  box-shadow: none;
}

.finance-deal-balance-payment.is-closed {
  background: #ecfdf5;
  color: #166534;
}

.finance-deal-balance-payment.is-confirmed {
  background: #fff1f2;
  color: #991b1b;
}

.finance-deal-balance-payment.is-waiting {
  background: #fff7ed;
  color: #9a3412;
}

.finance-deal-balance-payment.is-review {
  background: #f5f3ff;
  color: #6d28d9;
}

.finance-deal-balance-payment.has-material-overrun .finance-deal-balance-payment-open > strong,
.finance-deal-balance-payment-overrun {
  color: #b91c1c;
}

.finance-deal-balance-payment-overrun {
  font-weight: 800;
}

.finance-deal-balance-payment-open {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 0 28px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.finance-deal-balance-payment-open small {
  font-size: 9px;
  font-weight: 750;
}

.finance-deal-balance-copy,
.finance-deal-balance-payment .finance-deal-balance-copy {
  position: absolute;
  z-index: 3;
  bottom: 4px;
  right: 4px;
  width: 23px;
  height: 23px;
  min-height: 23px;
  padding: 0;
  opacity: 0;
  transform: none;
}

.finance-deal-balance-copy svg {
  width: 13px;
  height: 13px;
}

.finance-deal-balance-scale tbody th:hover .finance-deal-balance-copy,
.finance-deal-balance-scale tbody td:hover .finance-deal-balance-copy,
.finance-deal-balance-scale tbody th:focus-within .finance-deal-balance-copy,
.finance-deal-balance-scale tbody td:focus-within .finance-deal-balance-copy,
.finance-deal-balance-copy:focus-visible {
  opacity: 1;
}

.finance-deal-balance-scale tbody .is-usd-column > .finance-deal-balance-usd-value {
  display: grid;
  justify-items: start;
  padding-right: 28px;
}

.finance-deal-balance-scale.is-compact-deal-cells .finance-deal-balance-deal-client,
.finance-deal-balance-scale.is-compact-deal-cells .finance-deal-balance-deal-meta,
.finance-deal-balance-scale.is-compact-deal-cells .finance-deal-balance-freshness-row {
  display: none;
}

.finance-deal-balance-scale.is-compact-deal-cells .finance-deal-balance-deal-cell > a {
  -webkit-line-clamp: 3;
}

.finance-deal-balance-table-section.is-fullscreen {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  padding: 12px;
  background: #f8fafc;
}

.finance-deal-balance-table-section.is-fullscreen .finance-deal-balance-scroll {
  height: 100%;
  max-height: none;
}

body.finance-deal-balance-fullscreen-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .finance-deal-balance-overview {
    grid-template-columns: 1fr;
  }

  .finance-deal-balance-overview-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-deal-balance-filter-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .finance-deal-balance-instruction-grid,
  .finance-deal-balance-overview-side,
  .finance-deal-balance-filter-primary,
  .finance-deal-balance-filter-extra {
    grid-template-columns: 1fr;
  }

  .finance-deal-balance-account-warning,
  .finance-deal-balance-table-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-deal-balance-table-actions {
    justify-content: flex-start;
  }

  .finance-deal-balance-zoom {
    justify-content: flex-start;
  }

  .finance-deal-balance-filter-actions {
    grid-template-columns: 1fr;
  }
}
