.cut-rule-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.amount-cut {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cpl-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 11px 12px;
}

.cpl-item span {
  color: var(--danger);
  font-weight: 900;
}

.cpl-analytics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cpl-analytics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.cpl-analytics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.cpl-analytics strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1;
}

.automation-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.agency-topup-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.agency-topup-actions button {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.agency-topup-actions small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.agency-topup-actions button.is-complete:disabled {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface-strong));
  color: var(--muted);
  opacity: 1;
}

.agency-topup-actions button.is-complete:disabled small {
  color: var(--accent);
}

.automation-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.automation-summary div,
.automation-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.automation-summary span,
.automation-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.automation-summary strong,
.automation-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  line-height: 1;
}

.automation-stat {
  min-height: 68px;
  display: block;
  text-align: left;
}

.automation-stat small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.automation-queue:hover,
.automation-queue:focus-visible {
  border-color: #a16207;
  background: #fffbeb;
}

.automation-success:hover,
.automation-success:focus-visible {
  border-color: #15803d;
  background: #f0fdf4;
}

.automation-errors:hover,
.automation-errors:focus-visible {
  border-color: var(--danger);
  background: #fff8f6;
}

.automation-errors small {
  color: var(--danger);
}

.current-operation {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
}

.current-operation span {
  color: var(--muted);
  font-size: 13px;
}

.current-operation.error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.topup-review-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-block: 1px solid var(--line);
}

.topup-review-summary div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.topup-review-summary div + div {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.topup-review-summary div:first-child {
  padding-right: 18px;
}

.topup-review-summary span,
.topup-review-columns {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.topup-review-summary strong {
  color: var(--accent);
  font-size: 20px;
}

.topup-review-columns,
.topup-review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.topup-review-columns {
  padding: 14px 12px 8px;
}

.topup-review-columns span:last-child,
.topup-review-row span {
  text-align: right;
}

.topup-review-list {
  max-height: clamp(120px, calc(100svh - 430px), calc(10 * 48px + 2px));
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-block: 1px solid var(--line);
  scrollbar-gutter: stable;
}

.topup-review-row {
  min-height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.topup-review-row:last-child {
  border-bottom: 0;
}

.topup-review-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topup-review-row span {
  color: var(--accent);
  font-weight: 900;
  white-space: nowrap;
}

.topup-balance-preview {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(180px, 0.8fr);
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.topup-balance-preview.compact {
  grid-template-columns: 1fr minmax(180px, 0.8fr);
}

.topup-balance-preview[hidden] {
  display: none;
}

.topup-balance-preview div {
  display: grid;
  gap: 4px;
}

.topup-balance-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.topup-balance-preview strong {
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
}

.topup-balance-preview p {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.topup-balance-preview p.ok {
  color: var(--accent);
}

.topup-balance-preview p.warn {
  color: #9a6a13;
}

.topup-balance-preview p.error {
  color: var(--danger);
}

.topup-review-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.topup-review-option[hidden] {
  display: none;
}

.topup-review-option input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.errors-dialog {
  width: min(940px, calc(100vw - 32px));
}

.error-list-columns,
.topup-error-row {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1.2fr) minmax(130px, 0.8fr) 110px;
  align-items: center;
  gap: 0;
}

.error-list-columns {
  border-block: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.error-list-columns span,
.topup-error-row > * {
  min-width: 0;
  padding: 10px 12px;
}

.error-list-columns > :not(:first-child),
.topup-error-row > :not(:first-child) {
  border-left: 1px solid var(--line);
}

.topup-errors-list {
  min-height: 80px;
  max-height: min(520px, calc(100svh - 290px));
  overflow: auto;
  border-bottom: 1px solid var(--line);
}

.topup-error-row {
  min-width: 680px;
  border-bottom: 1px solid var(--line);
}

.topup-error-row:last-child {
  border-bottom: 0;
}

.topup-error-row time {
  color: var(--muted);
  font-size: 13px;
}

.topup-error-row strong {
  overflow-wrap: anywhere;
}

.topup-error-row span:last-child {
  font-weight: 900;
  white-space: nowrap;
}

.status-list-errors .topup-error-row span:last-child {
  color: var(--danger);
}

.status-list-success .topup-error-row span:last-child {
  color: #15803d;
}

.status-list-queue .topup-error-row span:last-child {
  color: #a16207;
}

.topup-errors-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
}

.topup-errors-footer > div {
  display: flex;
  gap: 8px;
}

.topup-errors-footer p {
  font-size: 13px;
}

.mode-dry {
  background: #f6e7c8;
  color: #7b4b00;
}

.mode-live {
  background: var(--accent-soft);
  color: var(--accent);
}

.mode-offline {
  background: #ece7df;
  color: var(--muted);
}
