ascend-admin { display: block; max-width: 1060px; margin-inline: auto; }
.aa-admin { max-width: 100%; color: var(--text); }
.aa-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-block: 0 17px; }
.aa-heading h1 { margin: 0; font-size: clamp(26px, 2.8vw, 34px); font-weight: 600; letter-spacing: -.035em; line-height: 1.18; }
.aa-pricing-rule, .aa-access p { margin: 7px 0 0; color: var(--quiet); font-size: 14px; }
.aa-pricing-rule { max-width: 74ch; margin: 0 0 14px; }
.aa-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 7px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.aa-filter label { flex: 1 1 240px; max-width: 335px; }
.aa-filter :is(input, button) { min-height: 44px; }
.aa-filter label, .aa-markup label { display: grid; gap: 4px; color: var(--quiet); font-size: 13px; }
.aa-filter input, .aa-markup input { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; font-size: 16px; border: 1px solid var(--edge); border-radius: 7px; background: var(--panel); color: var(--text); }
.aa-product { padding-block: 15px; border-bottom: 1px solid var(--rule); }
.aa-product header > h2, .aa-access h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.aa-product header > p { margin: 3px 0 0; font-size: 13px; color: var(--quiet); overflow-wrap: anywhere; }
.aa-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 10px 0 13px; }
.aa-prices > div { padding: 0 12px; border-inline-start: 1px solid var(--rule); min-width: 0; }
.aa-prices > div:first-child { padding-inline-start: 0; border: 0; }
.aa-prices dt { color: var(--quiet); font-size: 13px; }
.aa-prices dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.aa-card-rate { display: flex; gap: 4px 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.aa-card-rate > span { font-weight: 400; color: var(--quiet); }
.aa-markup { display: flex; align-items: end; flex-wrap: wrap; gap: 5px 10px; }
.aa-markup label > span { display: flex; align-items: center; max-width: 110px; gap: 6px; }
.aa-markup button, .aa-access :is(a,button), [data-aa-more] { min-height: 44px; }
.aa-markup p, [data-aa-status] { margin: 0; color: var(--quiet); font-size: 13px; flex-basis: 100%; }
.aa-markup [role="alert"], [data-aa-content] > [role="alert"] { color: var(--danger); }
.aa-admin [hidden], .aa-markup p:empty,
:is(ascend-admin-products, ascend-admin-team, ascend-admin-activity) [hidden] { display: none !important; }
.aa-access { border-top: 1px solid var(--rule); padding-block: 18px; }
.aa-access :is(a,button) { display: inline-flex; align-items: center; margin: 8px 14px 0 0; }
.aa-test-heading { display: flex; justify-content: space-between; align-items: start; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.aa-test-heading h2 { margin: 0; }
.aa-test-heading p, [data-aa-test-status] { color: var(--quiet); font-size: 13px; margin: 4px 0 0; }
.aa-test-heading button { min-height: 44px; }
@media (max-width: 520px) {
  .aa-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .aa-prices { grid-template-columns: 1fr; gap: 0; }
  .aa-prices > div, .aa-prices > div:first-child { padding: 5px 0; border: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .aa-prices dd { margin: 0; text-align: end; }
  .aa-card-rate { justify-content: flex-end; }
}

.at-ledger { container-type: inline-size; }
.at-detail-context p, .at-payment p, [data-feed-note] { margin: 4px 0 0; color: var(--quiet); font-size: 13px; }
.at-toolbar [data-refresh] { min-height: 44px; }
.at-toolbar [data-refresh] .ui-icon, .at-search .ui-icon, .at-open .ui-icon { width: 15px; height: 15px; }
.at-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; padding-block: 8px; border-block: 1px solid var(--rule); }
@media (min-width: 981px) {
  .at-toolbar { border-block: 0; padding-block: 0; margin-block: 2px 14px; }
  .at-search { gap: 8px; }
}
.at-search { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.at-search-box { display: flex; align-items: center; gap: 6px; padding-inline-start: 8px; border: 1px solid var(--edge); border-radius: 6px; color: var(--quiet); }
.at-search-box input { min-width: 0; width: min(175px, 100%); background: transparent; color: var(--text); border: 0; }
.at-search :is(input, select, button) { min-height: 44px; font-size: 13px; }
.at-search-box button { padding-inline: 8px; color: var(--accent-text); }
.at-search select { appearance: auto; border: 1px solid var(--edge); padding: 0 9px; background: var(--panel); color: var(--text); border-radius: 6px; }
[data-feed-note]:empty { display: none; }
.at-ledger table tbody tr { cursor: pointer; }
.at-ledger table tbody tr:is(:hover, :focus-within) > :is(th, td) { background-color: var(--tint); }
.at-ledger table :is(th, td) { padding: 10px 9px; vertical-align: middle; line-height: 1.35; }
.at-ledger table th[scope="col"] { background: transparent; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.at-ledger .mp-table-wrap { border-bottom: 1px solid var(--rule); }
.at-open { display: flex; justify-content: flex-start; gap: 5px; min-height: 44px; margin-block: -6px; padding: 0; text-align: start; color: var(--text); font-weight: 600; }
.at-open .ui-icon { flex: none; color: var(--quiet); }
.at-open:hover { color: var(--accent-text); }
.at-earnings-label { color: var(--quiet); font-size: 13px; }
.at-pagination { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--quiet); font-size: 13px; }
.at-pagination button { min-height: 44px; }
.at-pagination:has([data-shown]:empty) { min-height: 0; }

.at-detail { box-sizing: border-box; width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; overscroll-behavior: contain; color: var(--text); background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; }
.at-detail::backdrop { background: rgb(9 14 32 / 57%); }
.at-detail > header { position: sticky; z-index: 1; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 13px 9px 20px; background: var(--panel); border-bottom: 1px solid var(--rule); }
.at-detail h2 { margin: 0; font-size: clamp(20px, 3vw, 25px); letter-spacing: -.025em; font-weight: 600; overflow-wrap: anywhere; }
.at-detail > header button { min-width: 44px; min-height: 44px; padding: 0; }
.at-detail-body { padding: 12px 20px 20px; }
.at-detail-context { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; }
.at-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 14px 0; }
.at-facts div { min-width: 0; }
.at-facts dt { color: var(--quiet); font-size: 12px; }
.at-facts dd { margin: 3px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.at-payment { padding-block: 12px; border-block: 1px solid var(--rule); }
.at-payment h3 { margin: 0; font-size: 16px; }
.at-payment .mp-table-wrap { margin-top: 8px; }
.at-total { display: flex; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px solid var(--rule); color: var(--quiet); font-size: 13px; }
.at-total strong { color: var(--text); font-variant-numeric: tabular-nums; }
.at-reference strong { margin-inline-start: 4px; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.at-verification summary { min-height: 44px; align-content: center; cursor: pointer; color: var(--accent-text); font-size: 14px; }
.at-verification form, .at-verification label { display: grid; gap: 5px; }
.at-verification form { gap: 10px; }
.at-verification form button { justify-self: start; }
.at-verification form p { margin: 0; font-size: 13px; }
.at-verification form p:empty { display: none; }
.at-verification label { color: var(--quiet); font-size: 13px; }
.at-amounts { display: grid; grid-template-columns: repeat(2,minmax(0, 1fr)); gap: 8px 12px; }
.at-amounts label > span { display: flex; min-width: 0; align-items: center; gap: 6px; }
.at-verification input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--edge); border-radius: 6px; padding: 5px 8px; background: var(--canvas); color: var(--text); font-size: 16px; }
.at-verification input[readonly] { color: var(--quiet); }

@container (max-width: 690px) {
  .at-ledger :is(table, tbody, tr, th, td) { display: block; }
  .at-ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .at-ledger table :is(th, td) { padding: 2px 0; border: 0; }
  .at-ledger tbody tr { padding: 6px 0; border-top: 1px solid var(--rule); }
  .at-ledger td[data-label] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2px 8px; }
  .at-ledger td[data-label]::before { content: attr(data-label); color: var(--quiet); font-size: 12px; text-align: start; }
  .at-ledger td small { grid-column: 2; }
  .at-search { max-width: 100%; }
}
@media (max-width: 540px) {
  .at-detail { width: calc(100vw - 16px); max-width: none; max-height: calc(100dvh - 16px); }
  .at-detail-body { padding-inline: 13px; }
  .at-detail > header { padding-inline: 13px 6px; }
  .at-search input { font-size: 16px; }
  .at-payment .mp-table { display: table; }
  .at-payment .mp-table tbody { display: table-row-group; }
  .at-payment .mp-table tr { display: table-row; }
  .at-payment .mp-table :is(th,td[data-label]) { display: table-cell; padding: 7px 0; border-top: 1px solid var(--rule); }
  .at-payment .mp-table td[data-label]::before { display: none; }
}


.at-ledger .mp-table [data-mp-number] { white-space: nowrap; }
.at-ledger .mp-table tbody tr:focus-within { background: var(--tint); }
.at-ledger .mp-table tbody tr:hover { background: var(--tint); }

.at-margin-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
[data-at-margin-preview] .at-facts { margin-block: 8px; }
.at-stripe-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 8px 12px; }
.at-stripe-controls label { display: grid; gap: 4px; font-size: 13px; }
.at-verification select { min-height: 44px; padding-inline: 10px; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--canvas); color: var(--text); font: inherit; }
.at-verification [data-at-cash-correction] { margin-block: 12px; padding-block-start: 12px; border-top: 1px solid var(--rule); }
.at-verification [data-at-cash-correction] h4 { margin: 0; font-size: 14px; }
.at-verification [data-at-correction-proof] { display: grid; gap: 8px; }
.at-verification [data-at-stripe-bank] { margin-block: 12px; }
[data-at-stripe-summary] dd small { display: block; overflow-wrap: anywhere; color: var(--quiet); font-weight: 400; }

/* Admin mode: products with editable margins, every team, platform activity. */
.am-note { margin: 0 0 14px; color: var(--quiet); font-size: 13px; }
.am-product .am-status { margin-inline-start: 8px; padding: 2px 7px; border-radius: 5px; background: var(--tint); color: var(--quiet); font-size: 12px; font-weight: 600; }
.am-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
@media (max-width: 760px) { .am-fields { grid-template-columns: 1fr; } }
.am-fields .aa-markup label > span { max-width: 140px; }
.am-team-group + .am-team-group { margin-top: 32px; }
.am-team-group h2 { margin: 0 0 10px; font-size: 20px; font-weight: 620; }
.am-team-group h2 span { color: var(--quiet); font-weight: 400; }
.am-orgs { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.am-orgs > li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.am-orgs summary { display: flex; justify-content: space-between; gap: 12px; min-height: 32px; align-items: center; cursor: pointer; }
.am-orgs summary span { color: var(--quiet); font-size: 13px; }
.am-team-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 14px; }
.am-team-table :is(th, td) { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); text-align: start; }
.am-team-table thead th { color: var(--quiet); font-size: 12px; font-weight: 600; }
.am-deals td { white-space: normal; }

/* Admin mode → Products: the Ascend fee fields sit in one row (admin-mode.js). */
.am-product .aa-markup fieldset { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 16px; margin: 0; padding: 0; border: 0; min-width: 0; }
.am-product .aa-markup legend { padding: 0; margin-bottom: 6px; font-weight: 650; }
.am-product .aa-markup legend small { margin-inline-start: 6px; font-weight: 400; color: var(--muted); }
