/* pages.css: the landing, home, account and help pages, and the admin overview and audit pages.
   Loaded after app.css (its tokens and classes); only what those pages add. No inline styles anywhere (CSP). */

/* ---------- Section heads (landing) ---------- */
.sec-head { margin-bottom: 20px; max-width: 44em; }
.sec-head > * + * { margin-top: 8px; }
.sec-row { margin-bottom: 12px; }
.area-public .section { margin-top: clamp(48px, 7vw, 88px); }

/* ---------- Calls to action ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 20px; }
.center .cta-row { justify-content: center; }
.center .muted { margin-inline: auto; max-width: 36em; }
.hero__note { font-size: 14px; line-height: 20px; color: var(--ink-2); }
.hero__note a { color: var(--ink); font-weight: 500; }

/* ---------- Landing: the pitch on the left, the pay terms beside it (what a careful reader checks first) ---------- */
.hero { display: grid; gap: 32px clamp(32px, 5vw, 72px); align-items: center; }
.hero > * + * { margin-top: 0; }
.hero__pitch > * + * { margin-top: 16px; }
.hero__pitch > .hero__cta { margin-top: 28px; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); } }
.terms { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-l); overflow: hidden; }
.terms__head { padding: 16px 24px; border-bottom: 1px solid var(--rule); background: var(--card-2); font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: -0.008em; }
.terms .terms__list { list-style: none; margin: 0; padding: 0 24px; font-size: 15px; line-height: 22px; }
.terms__list li { padding: 12px 0; border-bottom: 1px solid var(--rule); color: var(--ink); }
.terms__foot { padding: 14px 24px 16px; font-size: 15px; line-height: 22px; }
@media (max-width: 520px) { .terms__head, .terms__foot, .terms .terms__list { padding-inline: 16px; } }

/* How it works is a sequence: four cells of one strip, numbered, split by hairlines (the portal's pipeline track) */
.how.grid-4 { gap: 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-l); overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.area-public .how__item.card { border: 0; border-radius: 0; border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); margin: -1px 0 0 -1px; padding: 24px; background: var(--card); }
.how__item.card > * + * { margin-top: 6px; }
/* What you need is three plain statements: a rule above each, no boxes */
.area-public .grid-3 { gap: 24px 32px; }
.area-public .grid-3 > .card--sand { background: none; border: 0; border-top: 1px solid var(--ink); border-radius: 0; padding: 16px 0 0; }
.area-public .grid-3 > .card--sand > * + * { margin-top: 6px; }

/* Dark blocks: plain links stay readable on forest (app.css sets the lede's colour). */
.card--forest a:not(.btn) { color: var(--pale); }
.card--forest .h4 { color: var(--on-forest); }
.area-public .card--forest { padding: clamp(24px, 4vw, 48px); }
.area-public .card--forest .h2 { color: var(--on-forest); }
.area-public .card--forest .sec-head { margin-bottom: 28px; }
.area-public .card--forest .grid-3 > li { border-top: 1px solid var(--forest-rule); padding-top: 16px; }
.area-public .card--forest .grid-3 > li > * + * { margin-top: 4px; }
.area-public .card--forest .cta-row { margin-top: 32px; }
.area-public .card--forest .btn--secondary { background: transparent; color: var(--on-forest); border-color: var(--forest-rule); }
.area-public .card--forest .btn--secondary:hover { background: var(--forest-3); }
/* the closing block: left-aligned like the rest of the page; the line on the left, the two ways in on the right */
.area-public .card--forest.center { text-align: left; }
.area-public .card--forest.center .cta-row { justify-content: flex-start; }
.area-public .card--forest.center .muted { margin-inline: 0; }
@media (min-width: 800px) {
  .area-public .card--forest.center { text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: center; }
  .area-public .card--forest.center > * { margin-top: 0; grid-column: 1; }
  .area-public .card--forest.center > .muted { margin: 8px 0 0; }
  .area-public .card--forest.center > .cta-row { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
}
/* Questions: the heading holds the left column, the answers the right */
@media (min-width: 900px) {
  .area-public .section:has(> .faq) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: clamp(32px, 5vw, 72px); align-items: start; }
  .area-public .section:has(> .faq) > .sec-head { margin: 0; position: sticky; top: 88px; }
}

/* ---------- Help: two even columns of plain panels ---------- */
@media (min-width: 800px) { .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

/* ---------- Project cards ---------- */
.pcard__rate { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.pcard__foot a:not(.btn) { font-weight: 700; }

/* ---------- Home ---------- */
.next > .eyebrow + .h3 { margin-top: 4px; }
.next > .eyebrow { color: var(--on-forest-2); }
.next .h3 { color: var(--on-forest); font-size: 20px; line-height: 28px; letter-spacing: -0.012em; }
.next .prose { color: var(--pale); }
.next .cta-row { margin-top: 16px; }
/* The earnings strip: three cells. Beside the steps (the home page's .split, from 1101px) its column is narrow until
   1280px, where three cells in a row would leave each about 100px, too little for a balance of $3,868.30: there the
   balance has the first row to itself and the two times share the row below. A strip with a sum of $10,000.00 or more
   (.stats--long, src/views/ui.tsx statsClass) keeps that until 1440px, and takes it on a phone too, with the phone's
   20px figures; so does every strip on a phone under 380px wide, where three cells side by side leave about 85px, too
   little for $3,868.30 at 18px (wider phones keep the three cells for shorter sums). */
@media (min-width: 1101px) and (max-width: 1279px) {
  .split:not(.split--stack) .stats:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split:not(.split--stack) .stats:has(> .stat:nth-child(3):last-child) > .stat:first-child { grid-column: 1 / -1; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
  .split:not(.split--stack) .stats--long:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split:not(.split--stack) .stats--long:has(> .stat:nth-child(3):last-child) > .stat:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .stats--long:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats--long:has(> .stat:nth-child(3):last-child) > .stat { padding-inline: var(--pad); }
  .stats--long:has(> .stat:nth-child(3):last-child) > .stat:first-child { grid-column: 1 / -1; }
  .stats--long:has(> .stat:nth-child(3):last-child) .stat__v { font-size: 20px; overflow-wrap: normal; }
}
@media (max-width: 379px) {
  .split:not(.split--stack) .stats:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split:not(.split--stack) .stats:has(> .stat:nth-child(3):last-child) > .stat { padding-inline: var(--pad); }
  .split:not(.split--stack) .stats:has(> .stat:nth-child(3):last-child) > .stat:first-child { grid-column: 1 / -1; }
  .split:not(.split--stack) .stats:has(> .stat:nth-child(3):last-child) .stat__v { font-size: 20px; overflow-wrap: normal; }
}

/* ---------- Admin ---------- */
/* Quick links repeat the sidebar, so they are a row of small buttons above the activity, not a column beside it;
   that gives the activity table the full width it needs (a waiting count is app.css's .count, as in the sidebar).
   .split--stack: a split whose parts stack at every width. */
.split--stack { grid-template-columns: minmax(0, 1fr); gap: 32px; }
.quick { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 720px) { .quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .quick .btn { width: 100%; } }
/* a narrow phone: one a row, so the longest ("Review applications" and its count) keeps its padding */
@media (max-width: 419px) { .quick { grid-template-columns: minmax(0, 1fr); } }
/* a tablet and a small laptop: two full rows of three, never one link alone on a second row */
@media (min-width: 721px) and (max-width: 1279px) { .quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } .quick .btn { width: 100%; } }
.audit-filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); align-items: end; margin-bottom: 20px; }
.audit-filters .form-actions { padding-top: 0; }

/* The audit table (.audit-tbl: the overview's recent activity, /admin/audit) is a trail. The time in mono; who did it,
   an email on one line cut with an ellipsis (the full address in a title); the action as a small log chip; the kind of
   thing with its ID under it, short and whole (the first 8 characters, the full ID in a title); on the full log the
   detail (.audit-more), one "key: value" a line, and the IP. The classes sit on the cells, so the column words can
   change freely. It reads cleanly at 1280px, scrolls inside its panel below that, and stacks into records on phones,
   the time as each record's heading line (app.css, Tables). */
.audit-time { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums slashed-zero; white-space: nowrap; }
.audit-actor { white-space: nowrap; }
/* the overview's activity has the page's whole width (.split--stack); the full log shares it with two more columns */
.audit-who { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
.audit-tbl--full .audit-who { max-width: 150px; }
/* the action: a log chip, on one line */
.audit-action code { display: inline-block; padding: 1px 6px; border-radius: var(--radius-xs); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--rule); font-size: 12px; line-height: 18px; white-space: nowrap; }
.audit-target .mono { display: block; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.audit-target a.mono { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-3); }
/* the detail: one "key: value" a line (src/admin/index.tsx compactDetail), broken only between words, a value too long
   for the line at its edge; 26 to 40 of its own characters wide, so the column stays readable */
.audit-detail { display: block; min-width: 26ch; max-width: 40ch; font-size: 12px; line-height: 16px; color: var(--ink-2); overflow-wrap: break-word; white-space: pre-wrap; }
/* an IPv6 address breaks only after its colons (<wbr> in the markup), three groups a line */
.audit-tbl td.audit-ip { font-size: 12px; color: var(--ink-2); white-space: normal; min-width: calc(15ch + 24px); }
/* .tbl.audit-tbl: more specific than app.css's .tbl th / .tbl td: closer columns, the outer ones on the one inset */
@media (min-width: 721px) {
  .tbl.audit-tbl th, .tbl.audit-tbl td { padding-left: 10px; padding-right: 10px; }
  .tbl.audit-tbl th:first-child, .tbl.audit-tbl td:first-child { padding-left: var(--pad); }
  .tbl.audit-tbl th:last-child, .tbl.audit-tbl td:last-child { padding-right: var(--pad); }
}
/* a stacked record has the room for the whole email; the detail sits under its label, left-aligned, and a record
   leaves out a detail it does not have */
@media (max-width: 720px) {
  .audit-actor { white-space: normal; overflow-wrap: anywhere; }
  .audit-tbl .audit-who { max-width: 100%; min-width: 0; }
  .tbl--rec.audit-tbl td.audit-time { font-weight: 500; color: var(--ink); font-size: 13px; }
  .audit-detail { min-width: 0; }
  .tbl td.audit-more { text-align: left; }
  .tbl td.audit-more::before { float: none; display: block; margin: 0 0 2px; }
  .tbl td.audit-more:has(> :empty), .tbl td.audit-more:empty { display: none; }
  .audit-tbl td.audit-ip { min-width: 0; }
}
