/* Partner program (P919, src/studio/partners/): the partner's pages (frames rb2UQ, OikEt, NltnU, z9rro, a5lwEP) and
   Admin › Partners (WiXgb, BLejW, j1Y0w7, ki2Ga, orA7d). Tables are Analytics' `.an-table`, stacked under 600px (the
   `an` container `.an-admin` sets); cards, chips and fields are this file's. */

.pt-page, .pt-admin { display: flex; flex-direction: column; gap: 20px; max-width: 1180px; color: var(--st-text); font-family: var(--st-font); }
.pt-crumbs { margin: 0; color: var(--st-text-faint); font-size: 12px; }
.pt-crumbs a { color: inherit; text-decoration: none; }
.pt-crumbs a:hover { color: var(--st-text); }
.pt-title { margin: -8px 0 0; font: 600 18px/24px var(--st-font); }
.pt-kicker { margin: 0 0 -8px; color: var(--st-text-faint); font: 600 12px/16px var(--st-font); }

.pt-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px 24px; border-radius: var(--st-radius-card); outline: 1px solid var(--st-line); outline-offset: -0.5px; background: var(--st-surface); }
.pt-card > .pt-line, .pt-card > .pt-field, .pt-card > .pt-scroll { align-self: stretch; }
.pt-card__title { margin: 0; font: 600 15px/22px var(--st-font); }
.pt-card--warn .pt-card__title { color: var(--st-warn); }
.pt-narrow { max-width: 720px; }
.pt-hero__title { margin: 0; font: 600 20px/28px var(--st-font); }
.pt-line { margin: 0; color: var(--st-text); font-size: 13px; line-height: 20px; }
.pt-line--dim { color: var(--st-text-dim); }
.pt-line--ok, .pt-top.pt-ok { color: var(--st-ok); }
.pt-line--warn { color: var(--st-warn); }
.pt-line--error { color: var(--st-error-ink); }
.pt-line:empty { display: none; }
.pt-label { margin: 0; color: var(--st-text-dim); font-size: 13px; }
.pt-link { margin: 0; font: 400 20px/28px var(--st-font); overflow-wrap: anywhere; }
.pt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pt-top { display: block; color: var(--st-text); }
.pt-sub { display: block; color: var(--st-text-faint); font-size: 11.5px; line-height: 16px; }
.pt-actions { display: inline-flex; align-items: center; gap: 12px; }
.pt-failed { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

/* Become a partner and the application */
.pt-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.pt-step { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; border-radius: 12px; outline: 1px solid var(--st-line); outline-offset: -0.5px; background: var(--st-surface); }
.pt-step__title { margin: 0; font: 600 13px/18px var(--st-font); }
.pt-step .pt-line { color: var(--st-text-dim); font-size: 12px; line-height: 18px; }
.pt-apply { max-width: 720px; }
.pt-agree { display: flex; flex-direction: column; gap: 6px; }
.pt-tick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.pt-tick__box { width: 14px; height: 14px; margin: 0; accent-color: var(--st-accent); }
.pt-terms__summary { color: var(--st-text); font-size: 13px; cursor: pointer; list-style: none; }
.pt-terms__summary::-webkit-details-marker { display: none; }
.pt-terms[open] { display: flex; flex-direction: column; gap: 6px; }
.pt-terms[open] .pt-line { color: var(--st-text-dim); }
.pt-progress { display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; font-size: 12px; list-style: none; }
.pt-progress__done { color: var(--st-ok); }
.pt-progress__now { color: var(--st-text); }
.pt-progress__now::before { content: "● "; }
.pt-progress__next { color: var(--st-text-faint); }
.pt-progress__next::before { content: "○ "; }

/* Metrics */
.pt-metrics { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 20px; }
.pt-metrics--4 { --n: 4; }
.pt-metric { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 22px 20px; border-radius: var(--st-radius-card); outline: 1px solid var(--st-line); outline-offset: -0.5px; background: var(--st-surface); }
.pt-metric__name { margin: 0; color: var(--st-text-dim); font-size: 12px; }
.pt-metric__value { margin: 4px 0; font: 400 26px/32px var(--st-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-metric__note { margin: 0; color: var(--st-text-dim); font-size: 12px; line-height: 17px; }
.pt-metric__note a { color: inherit; }

/* Filters and tables */
.pt-referrals { display: flex; flex-direction: column; gap: 12px; }
.pt-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pt-section__title { margin: 0; font: 600 14px/20px var(--st-font); }
.pt-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pt-filters__group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pt-filters__label { color: var(--st-text-dim); font-size: 12px; }
.pt-filters__rule { width: 1px; height: 22px; background: var(--st-line); }
.pt-chip { height: 30px; padding: 0 12px; border: 1px solid var(--st-line-strong); border-radius: 999px; background: transparent; color: var(--st-text); font: 500 12px/1 var(--st-font); cursor: pointer; }
.pt-chip:hover { background: var(--st-surface-2); }
.pt-chip--accent[aria-pressed='true'] { border-color: var(--st-accent); background: color-mix(in srgb, var(--st-accent) 18%, transparent); color: var(--st-accent-ink); }
.pt-chip--light[aria-pressed='true'] { border-color: var(--st-text-strong); background: var(--st-text-strong); color: var(--st-bg); }
.pt-dates { display: inline-flex; gap: 6px; }
.pt-date { height: 30px; padding: 0 8px; border: 1px solid var(--st-line-strong); border-radius: 8px; background: var(--st-surface); color: var(--st-text); font: 12px var(--st-font); color-scheme: light dark; }
.pt-scroll { overflow-x: auto; }
.pt-table .an-td { height: 36px; padding-top: 10px; padding-bottom: 10px; color: var(--st-text); }
.pt-table .an-th:first-child, .pt-table .an-td:first-child { padding-left: 10px; }
.pt-table .an-th:last-child, .pt-table .an-td:last-child { padding-right: 10px; }
.pt-table--small .an-td { height: auto; padding-top: 6px; padding-bottom: 6px; font-size: 12px; }
.pt-plan { display: inline-block; padding: 3px 8px; border-radius: 4px; background: var(--st-surface-2); color: var(--st-text-dim); font: 600 11px/14px var(--st-font); }
.pt-plan--pro { color: var(--st-warn); }
.pt-expand { padding: 0; border: 0; background: none; color: var(--st-text); font: inherit; cursor: pointer; }
.pt-expand::after { content: " ▸"; color: var(--st-text-faint); font-size: 10px; }
.pt-expand[aria-expanded='true']::after { content: " ▾"; }
.pt-detail > .an-td { padding: 4px 10px 16px; background: color-mix(in srgb, var(--st-surface-2) 50%, transparent); }
.pt-breakdown { display: flex; flex-direction: column; gap: 6px; }
.pt-breakdown .pt-line { color: var(--st-text-faint); font-size: 11.5px; }
.pt-paged { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.pt-paged > .pt-scroll { align-self: stretch; }
.pt-referrals__body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.pt-referrals__body > .pt-scroll { align-self: stretch; }
.pt-subnav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.pt-subnav__link { color: var(--st-text); font-size: 13px; text-decoration: none; }
.pt-subnav__link[aria-current='page'] { color: var(--st-accent-ink); }
.pt-subnav__link:hover { text-decoration: underline; }

/* Fields */
.pt-field { display: flex; align-items: center; gap: 16px; min-height: 38px; padding: 0 12px; border-radius: 10px; outline: 1px solid var(--st-line-strong); outline-offset: -0.5px; background: var(--st-surface-2); font-size: 13px; }
.pt-field:focus-within { outline: var(--st-focus-width, 2px) solid var(--st-focus-ring); }
.pt-field__label { flex: none; color: var(--st-text-dim); }
.pt-field__input { flex: 1; min-width: 0; height: 36px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--st-text); font: inherit; }
.pt-field__input--short { flex: 0 0 64px; }
.pt-flow { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: -8px 0 0; padding: 0; font-size: 13px; list-style: none; }
.pt-flow li + li::before { content: "→ "; color: var(--st-text-faint); }

/* Admin */
.pt-payouts, .pt-panel, .pt-settings { display: flex; flex-direction: column; gap: 20px; }
.pt-panel:empty { display: none; }
.pt-tabs { display: flex; gap: 8px; }
.pt-open { color: var(--st-text); font-size: 13px; text-decoration: none; white-space: nowrap; }
.pt-open:hover { text-decoration: underline; }
.pt-rowbuttons { display: flex; justify-content: flex-end; gap: 8px; }
.pt-codeline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.pt-codeline .pt-sub { font-size: 11.5px; }
.pt-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; font-size: 13px; list-style: none; }
.pt-checks li::before { content: "✓ "; color: var(--st-ok); }
.pt-checks .pt-check--no::before { content: "✗ "; color: var(--st-warn); }
.pt-textarea { flex: 1; min-height: 60px; padding: 8px 0; border: 0; outline: 0; background: transparent; color: var(--st-text); font: inherit; resize: vertical; }

@container an (width < 600px) {
  .pt-steps, .pt-metrics { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pt-card { padding: 18px 20px; }
  .pt-title { font-size: 22px; line-height: 28px; }
  .pt-link { font-size: 15px; }
  .pt-metric__value { font-size: 22px; }
  .pt-filters__rule { display: none; }
  /* Each row a small card: its first cell the heading, the rest labelled, two to a line. */
  .pt-table.an-table--stack .an-tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .pt-table.an-table--stack .an-td { height: auto; padding: 0; overflow-wrap: anywhere; }
  .pt-table.an-table--stack .an-td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .pt-table.an-table--stack .an-td:first-child::before, .pt-table.an-table--stack .an-td[data-label='']::before { display: none; }
  .pt-table.an-table--stack .an-num { text-align: left; }
  .pt-table--small.an-table--stack .an-tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Referrals as the phone frame lists them: who, plan, status on the left, the commission on the right. */
  .pt-referrals__table.an-table--stack .an-tr:not(.pt-detail) { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .pt-referrals__table.an-table--stack .an-tr:not(.pt-detail) > .an-td::before { display: none; }
  .pt-referrals__table.an-table--stack .an-tr:not(.pt-detail) > .an-td:nth-child(2) { display: none; }
  .pt-referrals__table.an-table--stack .an-tr:not(.pt-detail) > .an-td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .pt-referrals__table.an-table--stack .an-tr:not(.pt-detail) > .an-td:nth-child(3) { grid-column: 1; grid-row: 2; }
  .pt-referrals__table.an-table--stack .an-tr:not(.pt-detail) > .an-td:nth-child(4) { grid-column: 1; grid-row: 3; font-size: 12px; }
  .pt-referrals__table.an-table--stack .an-tr:not(.pt-detail) > .an-td:nth-child(5) { grid-column: 2; grid-row: 1 / span 3; text-align: right; }
  .pt-referrals__table.an-table--stack .an-tr:not(.pt-detail) > .an-td:nth-child(6) { grid-column: 1 / -1; }
  .pt-table.an-table--stack .pt-detail { display: block; padding: 0 0 12px; }
  .pt-detail > .an-td { padding: 8px 10px 12px; }
  .pt-field { flex-wrap: wrap; gap: 0 12px; padding: 6px 12px; }
}
.pt-field .pt-field__input:focus-visible, .pt-field .pt-textarea:focus-visible { outline: none; box-shadow: none; }

/* Long names and emails wrap rather than push the page wider (D912). */
.pt-title, .pt-card__title, .pt-top, .pt-sub, .pt-line, .pt-link { overflow-wrap: anywhere; }
.pt-referrals__table .an-td:first-child { min-width: 160px; max-width: 280px; }
.pt-state { align-self: stretch; }
.pt-paged > .pt-paged { align-self: stretch; }
.pt-card__body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; align-self: stretch; }
.pt-card__body > .pt-line, .pt-card__body > .pt-field, .pt-card__body > .pt-scroll, .pt-card__body > .pt-state { align-self: stretch; }
