/* Keep the financial result next to its name and put the detail controls in reading order. */
.brand-workbench .workspace .finance-panel-preview {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  min-width: 0;
  color: var(--text-muted);
}

.brand-workbench .workspace .finance-panel-preview strong {
  color: var(--heading);
  font-size: var(--text-body, 14px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.brand-workbench .workspace .finance-panel-preview small,
.brand-workbench .workspace .finance-panel-context {
  color: var(--text-muted);
  font-size: var(--small, 13px);
}

.brand-workbench .workspace .finance-panel-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  gap: 8px 16px;
  padding: 10px 12px;
  margin-block: 8px 12px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.brand-workbench .workspace .finance-panel-metrics > div {
  min-width: 0;
  border: 0;
  padding: 2px 0;
  background: transparent;
}

.brand-workbench .workspace .finance-panel-metrics dt {
  position: static;
  color: var(--text-muted);
  font-size: var(--small, 13px);
}

.brand-workbench .workspace .finance-panel-metrics dd {
  margin: 4px 0 0;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.brand-workbench .workspace .finance-panel-metrics dd small {
  font-weight: 500;
}

.brand-workbench .workspace .finance-record,
.brand-workbench .workspace .finance-panel-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 5px 14px;
  min-width: 0;
}

.brand-workbench .workspace .finance-panel-links {
  margin-block: 6px 12px;
}

.brand-workbench .workspace .finance-panel-links > details {
  margin: 0;
}

.brand-workbench .workspace .finance-record > :is(h2,h3,p,.project-actions) {
  margin: 0;
}

.brand-workbench .workspace .finance-history {
  padding-inline-start: 22px;
}

.brand-workbench .workspace .finance-history > li + li {
  margin-block-start: 8px;
}

html body.brand-workbench .workspace details.finance-panel > summary:focus-visible {
  outline: 2px solid var(--action, #0b5fa5);
  outline-offset: -2px;
}

html body.ui-refresh.brand-workbench .workspace details.finance-panel > summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 14px;
  min-height: 44px;
  cursor: pointer;
}

html body.ui-refresh.brand-workbench .workspace details.finance-panel > summary::marker,
html body.ui-refresh.brand-workbench .workspace details.finance-panel > summary::-webkit-details-marker {
  display: none;
}

html body.ui-refresh.brand-workbench .workspace details.finance-panel > summary::before {
  content: none;
}

html body.ui-refresh.brand-workbench .workspace details.finance-panel > summary::after {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin: 0 4px;
  border: solid var(--action, #0b5fa5);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}

html body.ui-refresh.brand-workbench .workspace details.finance-panel[open] > summary::after {
  transform: translateY(2px) rotate(225deg);
}

html body.ui-refresh.brand-workbench .workspace details.finance-panel > summary > :is(span,strong) {
  margin: 0;
}

.brand-workbench .workspace .finance-panel-name {
  font-weight: 650;
  color: var(--heading);
  overflow-wrap: anywhere;
}

html body.ui-refresh.brand-workbench .workspace details.finance-panel > summary .report-expand {
  display: none;
}

@media (min-width: 761px) {
  html body.ui-refresh.brand-workbench .workspace .finance-panel-metrics {
    max-inline-size: 72rem;
  }

  html body.ui-refresh.brand-workbench .workspace.refresh-flow .business-record > .commercial-record-heading,
  html body.ui-refresh.brand-workbench .workspace.refresh-flow :is(.reconciliation-summary, .reconciliation-contracts .business-record) > .heading-row {
    justify-content: flex-start;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 20px;
  }

  html body.ui-refresh.brand-workbench .workspace.refresh-flow .commercial-record-value {
    text-align: start;
  }

  html body.ui-refresh.brand-workbench .workspace .purchase-record-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
  }

  html body.ui-refresh.brand-workbench .workspace .purchase-record-top .purchase-card-head {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 20px;
  }

  html body.ui-refresh.brand-workbench .workspace .purchase-record-top .purchase-amount {
    text-align: start;
  }

  html body.ui-refresh.brand-workbench .workspace.purchase-page .purchase-record-top > nav {
    justify-content: flex-start;
  }

  .brand-workbench .workspace .finance-panel table .num {
    text-align: end;
    font-variant-numeric: tabular-nums;
  }
}

@media (max-width: 760px) {
  .brand-workbench .workspace .finance-record > .project-actions { width: 100%; }
  .brand-workbench .workspace .finance-panel-metrics {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 124px), 1fr));
  }
}

html body.ui-refresh.brand-workbench .workspace details.finance-panel > summary:hover {
  background: var(--surface-subtle);
}

html body.ui-refresh.brand-workbench .workspace .finance-panel-metrics dd {
  line-height: 1.45;
}

html body.ui-refresh.brand-workbench .workspace .finance-panel-metrics dd small {
  display: inline;
}

html body.ui-refresh.brand-workbench .workspace .report-module.finance-panel > summary > strong {
  flex: 0 1 auto;
}


.brand-workbench .workspace .finance-panel-links > details[open] {
  flex: 1 1 100%;
}

html body.ui-refresh.brand-workbench .workspace .report-module-body .finance-panel-metrics {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr));
}
