/*
 * The affiliate programme: its page and the account of an affiliate. Same language as the rest of the
 * site: the tokens, the grid and the figures come from site.css; nothing is boxed but the fields.
 */
.af-facts { margin-top: 0; }
.af-facts .tally-n { font-size: clamp(2.5rem, 6vw, 4.75rem); white-space: nowrap; }
.af-facts .tally-l { display: block; max-width: 17em; margin-top: 10px; text-wrap: pretty; }
.af-lede { margin-top: 0; }

/* The forms: one field per line, the button under them. */
.af-form { max-width: 34rem; margin-top: 0; }
.af-form .field + label { margin-top: var(--s-2); }
.af-form .field input { border-right: var(--field) solid var(--ink); }
.af-submit { margin-top: var(--s-3); }
main > .wrap > .af-form { margin-top: var(--s-4); }

/* The account: the links with what each brought, then the money. */
.af-table { width: 100%; margin-top: var(--s-3); border-collapse: collapse; font-size: var(--t-2); line-height: 1.4; }
.af-table th {
  padding: 0 var(--s-2) 8px 0;
  border-bottom: var(--hair) solid var(--line);
  color: var(--ink-2);
  font-size: var(--t-1);
  font-weight: var(--regular);
  text-align: left;
  vertical-align: bottom;
}
.af-table td { padding: 12px var(--s-2) 12px 0; border-bottom: var(--hair) solid var(--line-2); vertical-align: top; }
.af-table .num { padding-right: 0; padding-left: var(--s-2); text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.af-address { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.af-address code { font: inherit; overflow-wrap: anywhere; }
.af-note { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--t-2); }
.af-new { max-width: 34rem; margin-top: var(--s-4); }
.af-new-field { flex-direction: row; gap: 0; }
.af-new-field .input { border-right: 0; }
.af-money { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; margin-bottom: var(--s-3); }
.af-money .tally-n { font-size: clamp(2rem, 5vw, 3.5rem); white-space: nowrap; }

/* The space of an account: its analyses. */
.cp-url { display: block; color: var(--ink-2); font-size: var(--t-1); overflow-wrap: anywhere; }
.cp-start { margin-top: var(--s-3); }
.cp-new { margin-top: var(--s-3); }
.cp-table .act { white-space: nowrap; }
.cp-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cp-logo-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px var(--s-3); margin-top: var(--s-2); }
.cp-logo { max-width: 200px; max-height: 56px; width: auto; height: auto; }
.af-form .field input[type="file"] { height: auto; width: 100%; padding: 10px 0; border: 0; font: inherit; font-size: var(--t-2); }

.cp-lots { margin: var(--s-2) 0 0; padding: 0; list-style: none; border-top: var(--hair) solid var(--line-2); }
.cp-lots li { padding: 12px 0; border-bottom: var(--hair) solid var(--line-2); }
.cp-new { display: inline-block; margin-left: 8px; padding: 2px 8px; background: var(--signal); color: var(--ground); font-size: var(--t-1); font-weight: var(--bold); }

/* A batch of pages: the form, then the table that fills page after page. */
.lot-form { margin-top: var(--s-3); }
.lot-form + .lot-form { margin-top: var(--s-4); }
.lot-verdict { max-width: 28em; margin: 0 0 var(--s-2); font-size: var(--t-4); font-weight: var(--bold); line-height: 1.25; text-wrap: balance; }
.lot-url { overflow-wrap: anywhere; }
.lot-table td:first-child { max-width: 26rem; }
.lot-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px var(--s-3); margin-top: var(--s-3); }

/* The list of the affiliates, for the owner of the site. */
.adm-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--s-4); }
.adm-reset .input { margin: 6px 0; }
.adm-table th:last-child, .adm-table td:last-child { padding-left: var(--s-3); }
main > .wrap > .af { margin-top: var(--s-3); }

@media (min-width: 900px) {
  .lot-table th:nth-child(4), .lot-table td:nth-child(4) { padding-left: var(--s-3); }
  .adm-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .af-table, .af-table tbody { display: block; }
  .af-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .af-table tbody { border-top: var(--hair) solid var(--line); }
  .af-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px var(--s-2); padding: 14px 0; border-bottom: var(--hair) solid var(--line-2); }
  .af-table td { padding: 0; border: 0; text-align: left; }
  .af-table td:nth-child(-n+2) { grid-column: 1 / -1; }
  .af-table td.num { padding-left: 0; text-align: left; }
  .af-table td.num::before { content: attr(data-label) "\00a0: "; color: var(--ink-2); font-size: var(--t-1); }
}
