/* Styles for the Payouts area: payout-settings.js, payout-accounts.js, payout-account.js, payouts.js and the
   payout drawer, applications and invitations. Prefix: po-. Colours only from tokens.css. */

/* grey badge for final states that are neither good nor bad (Cancelled) */
.pill.muted { background: var(--neutral-soft); color: var(--text-3); }

/* ---------- Payouts settings: global stop ---------- */
.po-stop { box-shadow: inset 4px 0 0 var(--success), var(--shadow-sm); }
.po-stop.stopped { box-shadow: inset 4px 0 0 var(--danger), var(--shadow-sm); }
.po-stop-main { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; padding: 20px 22px 18px 24px; }
.po-stop-state { display: flex; align-items: center; gap: 16px; flex: 1 1 460px; min-width: 0; }
.po-stop-icon {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--success-soft); color: var(--success);
}
.po-stop.stopped .po-stop-icon { background: var(--danger-soft); color: var(--danger); }
.po-stop-icon svg { width: 24px; height: 24px; }
.po-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.po-stop-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 1px 0 3px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.po-stop-title .pm-live { width: 10px; height: 10px; }
.po-stop.stopped .po-stop-title .pm-live { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); animation: none; }
.po-stop-state p { color: var(--text-2); font-size: 13.5px; max-width: 80ch; }
.po-stop-state .po-reason { margin-top: 4px; color: var(--text); }
.po-stop-action { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.po-stop-action .btn { height: 42px; padding: 0 18px; font-size: 14px; }
.po-stop-action .small { color: var(--text-3); }
.po-effects-title { padding: 0 22px 10px 24px; }
.po-effects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 22px 22px 24px; }
.po-effect {
  display: flex; gap: 12px; align-items: flex-start; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  font-size: 13px; color: var(--text-2);
}
.po-effect > svg { width: 18px; height: 18px; flex: none; color: var(--text-3); margin-top: 2px; }
.po-effect b { display: block; margin-bottom: 2px; color: var(--text); font-weight: 600; font-size: 13.5px; }

/* ---------- Payouts settings: the CoreSettle key ---------- */
.po-key-result { margin-top: 14px; }

/* ---------- Payouts settings: the live maximum ---------- */
.po-live { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.po-calc { border-right: 1px solid var(--border); }
.po-calc > div { align-items: flex-start; }
.po-calc dt small, .po-calc dd small { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); }
.po-calc dd small { font-weight: 400; }
.po-calc .po-sum { background: var(--surface-2); }
.po-calc .po-sum dt { color: var(--text); font-weight: 500; }
.po-calc .po-less dd { color: var(--text-2); }
.po-calc .po-total { background: var(--brand-soft); }
.po-calc .po-total dt { color: var(--text); font-weight: 600; }
.po-calc .po-total dd { color: var(--brand); font-size: 17px; }
.po-result { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
.po-result-figure .label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.po-result-figure .value { font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.po-result-figure .pm-poll { justify-content: flex-start; font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.po-result ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--text-2); }
.po-result li { display: flex; gap: 10px; align-items: flex-start; }
.po-result li > svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--text-3); }
.po-quote { color: var(--text); font-weight: 500; }
.po-live-problem { padding: 16px 22px 0; }
.po-live-problem:empty { display: none; }
.po-live-empty { padding: 8px 0 4px; }

/* ---------- forms: a fixed fee plus a percentage ---------- */
.po-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.po-pair > .po-plus { color: var(--text-3); font-weight: 600; }
.pf-platform .po-pair .input-affix .input { padding-right: 48px; }
.po-pair .field { gap: 0; }
.po-section-note { margin-top: -4px; }
.po-none-check { margin-top: 2px; font-size: 13px; }

/* note on the left of a card footer */
.po-foot-note { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.po-foot-note svg { width: 14px; height: 14px; flex: none; }

/* ---------- account detail ---------- */
.po-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.po-intro > p { margin: 0; color: var(--text-2); max-width: 80ch; }
.po-switches { display: flex; flex-direction: column; gap: 16px; }
.po-switches .field + .field { padding-top: 16px; border-top: 1px solid var(--border); }
.po-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.po-switch-row .switch > span:last-child { font-weight: 600; }
.po-second-factor { display: inline-flex; align-items: center; gap: 8px; }
.po-second-factor svg { width: 16px; height: 16px; flex: none; }
.po-danger-zone .card-body p { margin: 0; color: var(--text-2); max-width: 90ch; }

/* Fees & limits tab: three price boxes, then the limits */
.po-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.po-price {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 14px 16px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.po-price-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.po-price-head h3 { font-size: 14px; font-weight: 600; margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.po-price-head h3 svg { width: 16px; height: 16px; color: var(--brand); }
.po-price .md-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.po-price .po-default { margin-top: auto; font-size: 12px; color: var(--text-3); }
.po-preview {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-radius: var(--radius);
  background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  font-size: 13.5px; font-weight: 500;
}
.po-preview > svg { width: 18px; height: 18px; flex: none; color: var(--brand); }
.po-preview .po-preview-tag { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-3); }
.po-preview.problem { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.po-preview.problem > svg { color: var(--warning); }
.po-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.po-limits.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.po-now { display: grid; gap: 8px; align-content: start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.po-now-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--text-2); }
.po-now-head strong { color: var(--text); font-size: 18px; }

/* ---------- Payouts queue ---------- */
.po-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 -4px; }
.po-section-head h2 { font-size: 17px; }
.po-section-head p { color: var(--text-2); margin-top: 2px; font-size: 13.5px; }
.po-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; margin-left: 8px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; vertical-align: 2px;
  background: var(--warning-soft); color: var(--warning);
}
.po-count.info { background: var(--info-soft); color: var(--info); }
.card-head h2 .po-count { margin-left: 6px; }
.po-queue .card-head { align-items: flex-start; }
.po-why { white-space: normal; min-width: 230px; max-width: 330px; }
.po-why b { font-weight: 500; color: var(--text); }
.po-why .tag { margin-top: 4px; }
.table td.po-acts { text-align: right; white-space: nowrap; }
.table td.po-acts .btn + .btn { margin-left: 6px; }
.po-tries { white-space: normal; min-width: 130px; }
.po-staff { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--warning-soft); font-size: 13px; }
.po-staff svg { width: 16px; height: 16px; color: var(--warning); flex: none; }
.po-iban { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .01em; }
.table .cell-sub.po-iban { color: var(--text-3); }
.po-none { color: var(--text-3); font-size: 12.5px; }
.po-clear { padding: 18px; }
.po-filter-chip { display: inline-flex; align-items: center; gap: 6px; }
.po-filter-chip .btn { height: 24px; width: 24px; }
.po-banners:empty { display: none; }
.po-earned { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.po-earned > div + div { border-left: 1px solid var(--border); }
.po-earned h3 { padding: 14px 18px 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.po-earned .pm-mon > div:first-child { border-top: 0; }

/* ---------- the payout drawer ---------- */
.po-drawer .drawer-section h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.po-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.po-history li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 2px 12px; }
.po-history .po-history-move { color: var(--text); font-weight: 500; }
.po-history .po-history-note { grid-column: 2; color: var(--text-2); }
.po-conv { display: flex; flex-direction: column; gap: 2px; }

/* ---------- the admin's second factor (payout-confirm.js) ---------- */
.po-confirm-summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 600;
}
.po-confirm-summary svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.po-confirm-wait { display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.po-confirm-wait .spinner { flex: none; }
.po-code-input { font-family: var(--font-mono); font-size: 18px; letter-spacing: .2em; text-align: center; }
.po-link-btn { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: 13px; cursor: pointer; justify-self: start; }
.po-link-btn:hover { text-decoration: underline; }

/* ---------- fixes found on the design screenshots ---------- */
.po-live-body { padding: 0; }
.po-headfix .card-head .grow { flex-basis: 0; }
.pf-platform .form-grid.po-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1080px; }
.pf-form-section .po-price-head h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; text-transform: none; color: var(--text); }
.table td.po-why { white-space: normal; min-width: 200px; }
.table td.po-why .tag { margin-top: 4px; }
.table.po-needs td { vertical-align: top; }
.table.po-needs td.po-acts { vertical-align: middle; }
.table td.po-why b { font-weight: 500; color: var(--text); }
.po-headfix { overflow: hidden; }

@media (max-width: 1100px) {
  .po-live { grid-template-columns: minmax(0, 1fr); }
  .po-calc { border-right: 0; border-bottom: 1px solid var(--border); }
  .po-prices, .po-limits, .po-effects { grid-template-columns: minmax(0, 1fr); }
  .po-limits.two { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .po-earned { grid-template-columns: minmax(0, 1fr); }
  .po-earned > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .po-stop-action { align-items: flex-start; }
  .po-history li { grid-template-columns: minmax(0, 1fr); }
  .po-history .po-history-note { grid-column: 1; }
  .pf-platform .form-grid.po-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .po-stop-main, .po-effects-title { padding-left: 18px; padding-right: 16px; }
  .po-effects { padding: 0 16px 18px 18px; }
  .po-result { padding: 16px; }
  .po-result-figure .value { font-size: 26px; }
  .po-pair { grid-template-columns: minmax(0, 1fr); }
  .po-pair > .po-plus { display: none; }
  .po-price .md-fields { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- account Security tab: one block per user ---------- */
.po-user { display: flex; flex-direction: column; gap: 14px; }
.po-user + .po-user { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.po-user-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.po-user-head > div:first-child { margin-right: auto; min-width: 0; }
.po-user-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.po-examples { margin-top: -4px; }

/* a payout whose outcome at CoreSettle is unknown (contract 1.3) */
.row-flag.danger { color: var(--danger); }
