.finance-workbench.douyin-settlement-page {
  align-content: start;
  gap: 8px;
}

.douyin-settlement-page .douyin-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.douyin-settlement-page .douyin-filters .filter-grid {
  grid-template-columns: repeat(2, minmax(140px, 240px));
}

.douyin-settlement-page .douyin-filters {
  margin-top: 12px;
}

.douyin-settlement-page .douyin-row-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.douyin-settlement-page .douyin-table th,
.douyin-settlement-page .douyin-table td {
  white-space: nowrap;
}

.douyin-settlement-page .douyin-mobile-scope,
.douyin-settlement-page .douyin-mobile-list {
  display: none;
}

.douyin-detail-layer .douyin-detail-stages {
  margin-top: 14px;
}

.douyin-detail-layer .douyin-detail-stages .permission-summary {
  padding: 0 12px 10px;
}

.douyin-detail-layer .permission-row > .tag {
  justify-self: start;
}

@media (max-width: 760px) {
  .douyin-settlement-page .douyin-table {
    display: none;
  }

  .douyin-settlement-page .douyin-summary,
  .douyin-settlement-page .douyin-filters .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .douyin-settlement-page .douyin-mobile-scope {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 10px 10px;
  }

  .douyin-settlement-page .douyin-mobile-scope label {
    display: grid;
    gap: 3px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
  }

  .douyin-settlement-page .douyin-mobile-list {
    display: grid;
    gap: 8px;
    padding: 0 10px 10px;
  }

  .douyin-settlement-page .douyin-filters .filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .douyin-settlement-page .douyin-filters .filter-actions > span {
    grid-column: 1 / -1;
  }

  .douyin-settlement-page .douyin-mobile-card .panel-head {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  .douyin-settlement-page .douyin-mobile-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0 10px 10px;
  }

  .douyin-settlement-page .douyin-mobile-card dl div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
  }

  .douyin-settlement-page .douyin-mobile-card dt {
    color: var(--muted);
    font-size: 12px;
  }

  .douyin-settlement-page .douyin-mobile-card dd {
    margin: 0;
  }
}

.douyin-settlement-page .douyin-workflow-head {
  align-items: end;
}

.douyin-workflow-head label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
}

.douyin-workflow-head .control {
  width: min(440px, 100%);
}

.douyin-workflow .douyin-workflow-body {
  padding: 0 14px 14px;
}

.douyin-workflow-body .panel-head {
  padding-inline: 0;
}

.douyin-workflow-body .panel-subtitle {
  margin: 4px 0;
}

.douyin-related-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 10px;
}

.douyin-workflow-body .douyin-workflow-notice {
  margin: 0 0 10px;
}

.douyin-workflow-body .douyin-workflow-fields {
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
}

.douyin-workflow-body .douyin-source-row {
  grid-template-columns: minmax(120px, 1fr) max-content minmax(55px, max-content);
  align-items: center;
}

.douyin-workflow-body .douyin-workflow-table {
  margin-top: 10px;
}

.douyin-workflow-body .douyin-workflow-table :is(th, td) {
  white-space: nowrap;
}

.douyin-store-table-note {
  margin: 10px 0 0;
  color: var(--qx-text-secondary);
  font-size: var(--qx-font-small);
}

.douyin-workflow-body .douyin-store-table {
  min-width: 0;
  max-width: 100%;
  padding: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--qx-divider);
  border-radius: var(--qx-radius-surface);
}

.douyin-store-table:focus-visible {
  outline: 2px solid var(--qx-focus);
  outline-offset: 2px;
}

.douyin-store-table table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
}

.douyin-workflow-body .douyin-store-table thead th {
  position: static;
}

.douyin-store-table .douyin-store-group {
  text-align: center;
  border-inline-end: 1px solid var(--qx-divider);
}

.douyin-store-column small {
  display: block;
  margin-top: 2px;
  color: var(--qx-text-muted);
  font-weight: var(--qx-weight-regular);
}

.douyin-workflow-body .douyin-store-table .douyin-store-name {
  position: sticky;
  inset-inline-start: 0;
  top: auto;
  z-index: 1;
  min-width: 7.5rem;
  max-width: 11rem;
  white-space: normal;
  overflow-wrap: anywhere;
  border-inline-end: 1px solid var(--qx-divider);
}

.douyin-store-table thead .douyin-store-name {
  z-index: 2;
}

.douyin-store-table tbody .douyin-store-name {
  color: var(--qx-text);
  background: var(--qx-surface);
}

.douyin-store-table tbody tr:hover > .douyin-store-name {
  background: var(--qx-surface-muted);
}

.douyin-workflow-body .douyin-store-table .douyin-store-number {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.douyin-store-table .douyin-store-missing {
  color: var(--qx-text-muted);
}

.douyin-workflow-body .douyin-version-review {
  min-width: 0;
  padding: 12px;
  margin-bottom: 12px;
}

.douyin-version-review .panel-head {
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
}

.douyin-revision-note,
.douyin-revision-notes {
  color: var(--qx-text-secondary);
  font-size: var(--qx-font-small);
}

.douyin-revision-note {
  margin: 8px 0;
}

.douyin-revision-notes {
  margin-top: 10px;
}

.douyin-revision-notes summary {
  cursor: pointer;
}

.douyin-workflow-body .douyin-archive-table-title {
  padding-inline: 0;
}

@media (max-width: 760px) {
  .douyin-settlement-page .douyin-workflow-head {
    display: grid;
    align-items: start;
    gap: 10px;
  }

  .douyin-workflow-head label, .douyin-workflow-head .control {
    width: 100%;
  }

  .douyin-settlement-page .douyin-workflow-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .douyin-workflow-body .panel-head .panel-actions {
    flex-wrap: wrap;
  }

  .douyin-workflow-body .douyin-store-table .douyin-store-name {
    min-width: 5.75rem;
    max-width: 7.25rem;
  }
}

.douyin-workflow-body .douyin-order-trace {
  margin-top: 12px;
}

.douyin-workflow-body .douyin-reconciliation {
  min-width: 0;
  margin-top: 12px;
}

.finance-workbench .douyin-flow-evidence {
  min-width: 0;
  margin-bottom: 12px;
}

.douyin-reconciliation .panel-head {
  padding-inline: 12px;
}

.douyin-reconciliation-store {
  display: grid;
  gap: 4px;
  min-width: min(13rem, 100%);
  color: var(--qx-text-secondary);
}

.douyin-reconciliation-summary {
  margin: 0 12px;
}

.douyin-registration-name,
.douyin-registration-tail {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.douyin-registration-tail {
  color: var(--qx-text-secondary);
  font-size: var(--qx-font-small);
  font-weight: var(--qx-weight-regular);
}

.douyin-reconciliation-note {
  margin: 8px 12px;
  color: var(--qx-text-secondary);
  font-size: var(--qx-font-small);
}

.douyin-reconciliation .douyin-reconciliation-payments,
.douyin-flow-evidence .douyin-reconciliation-payments {
  min-width: 0;
  overflow-x: auto;
}

.douyin-reconciliation-payments table {
  min-width: max-content;
}

.douyin-reconciliation-payments td:nth-child(2),
.douyin-reconciliation-payments th:nth-child(2) {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.douyin-reconciliation-payments .douyin-payment-focus > td {
  background: var(--qx-info-bg);
}

.douyin-order-trace .panel-head {
  padding-inline: 12px;
}

.douyin-settlement-page .douyin-live-banner {
  margin: 6px 14px 10px;
}

.douyin-store-name .douyin-count-pending {
  display: block;
  margin-top: 2px;
  color: var(--qx-warning-text);
  font-weight: var(--qx-weight-regular);
}
