/* Runners dashboard (2026-10-29, opt-in key runnerDashboard; public/js/runner-dashboard.js). Theme tokens only, light + dark.
   Desktop: a card with a header row and one grid row per runner (click to open the watches). Phone: each runner is a stacked card.
   The KPI row, search and pills ride on the shared thin-KPI / list-filter classes; this file holds only what is new. */
.rd-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; font-family: var(--font-body); }
.rd-thead, .rd-line { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) minmax(0, 1.3fr) minmax(0, 1.5fr) minmax(0, 1.2fr); gap: 16px; align-items: center; padding: 0 24px; }
.rd-thead { min-height: 44px; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--off-white); border-bottom: 1px solid var(--border); background: var(--bg-void, transparent); }
.rd-row { border-top: 1px solid var(--border); }
.rd-row:first-child { border-top: 0; }
.rd-line { min-height: 76px; padding-top: 12px; padding-bottom: 12px; cursor: pointer; transition: background-color .15s; }
.rd-line:hover { background: color-mix(in srgb, var(--gold) 4%, transparent); }
.rd-line:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.rd-c { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rd-c-who { flex-direction: row; align-items: center; gap: 12px; }
.rd-av { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; letter-spacing: .4px; color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.rd-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-name { font-size: 15px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-sub, .rd-note { font-size: 12.5px; color: var(--off-white); line-height: 1.35; }
.rd-amt { font-size: 17px; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; font-family: var(--font-body); white-space: nowrap; }
.rd-amt.is-owed { color: var(--gold); }
.rd-n { font-size: 17px; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; }
.rd-c-act { flex-direction: row; align-items: center; justify-content: flex-end; gap: 10px; }
.rd-pay { white-space: nowrap; word-spacing: 0.3em; }   /* Absans at button size loses the word space ("Markpaid") */
.rd-chev { display: inline-flex; color: var(--off-white); transition: transform .15s; }
.rd-row.is-open .rd-chev { transform: rotate(180deg); }
.rd-detail { padding: 4px 24px 16px 76px; background: var(--bg-void, transparent); border-top: 1px solid var(--border); }
.rd-detail[hidden] { display: none; }
.rd-acq-head, .rd-acq { display: grid; grid-template-columns: minmax(0, 1fr) 120px 80px; gap: 16px; align-items: center; }
.rd-acq-head { padding: 12px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--off-white); }
.rd-acq-head span:nth-child(2), .rd-acq-cost { text-align: right; }
.rd-acq { min-height: 52px; padding: 6px 0; border-top: 1px solid var(--border); cursor: pointer; }
.rd-acq-ro { cursor: default; }
.rd-acq-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-acq-t { font-size: 14px; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-acq-s { font-size: 12.5px; color: var(--off-white); }
.rd-acq-cost { font-size: 14px; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; font-family: var(--font-body); }
.rd-acq-st { text-align: right; }
.rd-more, .rd-none { padding: 12px 0 4px; font-size: 13px; color: var(--off-white); }
.rd-recent { margin-top: 20px; padding: 16px 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-raised); }
.rd-recent-t { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--off-white); margin-bottom: 8px; }
.rd-rec { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-top: 1px solid var(--border); font-size: 14px; color: var(--white); }
.rd-rec:first-of-type { border-top: 0; }
.rd-rec-w { min-width: 0; }

/* ── Mark paid modal ─────────────────────────────────────────────────────────── */
.rd-modal { width: min(560px, 94vw); max-width: 560px; max-height: 92vh; overflow-y: auto; font-family: var(--font-body); }
.rd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.rd-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.rd-modal .modal-title { font-size: 24px; margin-bottom: 4px; }
.rd-modal .modal-sub { margin-bottom: 0; }
.rd-x { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--off-white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.rd-x:hover { color: var(--white); border-color: var(--gold); }
.rd-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 8%, var(--bg-raised)); border: 1px solid color-mix(in srgb, var(--gold) 25%, var(--border)); }
.rd-sum-l { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--off-white); flex: 1 0 100%; }
.rd-sum-v { font-size: 28px; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; font-family: var(--font-body); }
.rd-sum-s { font-size: 13px; color: var(--off-white); }
.rd-pv { margin-top: 14px; border: 1px solid var(--border); border-radius: 14px; max-height: 240px; overflow-y: auto; }
.rd-pv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); }
.rd-pv-row:first-child { border-top: 0; }
.rd-pv-row.is-held { opacity: .6; }
.rd-pv-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rd-pv-t { font-size: 14px; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-pv-s { font-size: 12.5px; color: var(--off-white); }
.rd-pv-a { font-size: 14px; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; font-family: var(--font-body); white-space: nowrap; }
.rd-lab { margin: 16px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--off-white); }
.rd-segs { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-seg { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-raised); color: var(--white); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.rd-seg.active { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--bg-raised)); color: var(--gold); }
.rd-modal input[type="text"] { width: 100%; min-height: 44px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-void, var(--bg-raised)); color: var(--white); padding: 10px 14px; font: inherit; }
.rd-modal input:focus { outline: none; border-color: var(--gold); }
.rd-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.rd-warn { margin-top: 12px; padding: 10px 14px; border-radius: 12px; font-size: 13px; color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.rd-warn-s { margin-top: 10px; }

/* ── the runner's own card on Money ───────────────────────────────────────────── */
.rd-mine-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.rd-mine-t { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-raised); min-width: 0; }
.rd-mine-l { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--off-white); }
.rd-mine-v { font-size: 20px; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; font-family: var(--font-body); }
#runner-money-acq .rd-acq-head, #runner-money-acq .rd-acq { grid-template-columns: minmax(0, 1fr) 110px 112px; }

/* ── phone: each runner is a stacked card, no sideways scroll ─────────────────── */
@media (max-width: 760px) {
  .rd-thead { display: none !important; }
  .rd-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; padding: 16px; }
  .rd-c-who { grid-column: 1 / -1; }
  .rd-c[data-label]::before { content: attr(data-label); font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--off-white); }
  .rd-c-owed { grid-column: 1 / 2; }
  .rd-c-acq { grid-column: 2 / 3; }
  .rd-c-last { grid-column: 1 / 2; }
  .rd-c-act { grid-column: 2 / 3; justify-content: flex-end; align-self: end; }
  .rd-pay { min-height: 44px; }
  .rd-detail { padding: 0 16px 14px; }
  .rd-acq-head, .rd-acq { grid-template-columns: minmax(0, 1fr) 124px; gap: 2px 12px; }
  .rd-acq-t { white-space: normal; overflow: visible; text-overflow: clip; }
  .rd-acq-head span:nth-child(3) { display: none; }
  .rd-acq { grid-template-areas: "main cost" "main st"; }
  .rd-acq-main { grid-area: main; } .rd-acq-cost { grid-area: cost; } .rd-acq-st { grid-area: st; text-align: right; }
  .rd-recent { padding: 14px 16px; }
  .rd-modal { width: 100%; max-width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .rd-overlay { align-items: flex-end; }
  .rd-mine-sum { grid-template-columns: 1fr 1fr; }
  .rd-mine-sum .rd-mine-t:last-child { grid-column: 1 / -1; }
}

/* KPI law: the figure is shown in FULL and wraps if it must; never an ellipsis. The card height is its content. */
html body #rd-kpis .pay-kpi { height: auto !important; min-height: 0; }
html body #rd-kpis .pay-kpi-value, html body #rd-kpis .wf-kpi-thin-v { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; height: auto !important; line-height: 1.3 !important; }
html body #rd-kpis .pay-kpi-label, html body #rd-kpis .pay-kpi-sub, html body #rd-kpis .pay-kpi-footer { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; }

/* ── fix round 1: pick what to pay, a set amount, no-login buyers, runner card with owed only ── */
label.rd-pv-row { cursor: pointer; min-height: 44px; }
.rd-pv-row.is-off .rd-pv-t, .rd-pv-row.is-off .rd-pv-s, .rd-pv-row.is-off .rd-pv-a { opacity: .45; }
.rd-ck { min-height: 0 !important; max-height: 22px; appearance: none; -webkit-appearance: none; flex: 0 0 22px; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--border-strong, var(--border)); border-radius: 7px; background: var(--bg-void, transparent); display: inline-grid; place-content: center; cursor: pointer; }
.rd-ck:checked { background: var(--gold); border-color: var(--gold); }
.rd-ck:checked::after { content: ''; width: 5px; height: 10px; border: solid var(--bg-void, #0a0a0a); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.rd-ck:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.rd-ck:disabled { opacity: .5; cursor: not-allowed; }
.rd-ck-ph { flex: 0 0 22px; }
.rd-pv-of { display: block; font-size: 11px; font-weight: 500; color: var(--off-white); text-align: right; }
#rd-amt.currency-input { width: 100%; min-height: 44px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-void, var(--bg-raised)); color: var(--white); padding: 10px 14px; font: inherit; }
#rd-amt-err { color: var(--red, #c0392b); font-size: 12.5px; }
.rd-nologin { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--off-white); vertical-align: middle; }
.rd-mine-sum.is-one { grid-template-columns: minmax(0, 1fr); }

/* The parts of "Owed to you now" (watches / profit share / trips / fees): one quiet line each, adds up to the figure above. */
.rd-mine-parts { display: flex; flex-direction: column; margin: 0 0 12px; padding: 4px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-raised); }
.rd-mine-part { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; min-width: 0; }
.rd-mine-part + .rd-mine-part { border-top: 1px solid var(--border); }
.rd-mine-part .rd-mine-v { font-size: 15px; font-weight: 600; white-space: nowrap; }

/* The runner's big "owed to you now" (standard for every runner, Hal 2026-10-30): first thing on his Money page. */
.rd-owed { margin: 0 0 22px; padding: 22px 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-raised); }
.rd-owed .rd-owed-l { font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--off-white); }
.rd-owed .rd-owed-v { margin-top: 6px; font-size: clamp(38px, 7vw, 60px); line-height: 1.05; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; font-family: var(--font-body); overflow-wrap: anywhere; }
.rd-owed .rd-owed-s { margin-top: 6px; font-size: 13.5px; color: var(--off-white); }
.rd-owed .rd-mine-parts { margin: 16px 0 0; padding: 2px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
@media (max-width: 640px) { .rd-owed { padding: 18px 16px; } }
/* Paid / Not paid yet on a runner's own Acquisitions row or card. */
.rd-paid-pill { margin-left: 8px; vertical-align: middle; white-space: nowrap; flex: 0 0 auto; }
#inventory-tbody .rd-paid-pill { display: inline-flex; margin: 4px 0 0; }
.inv-card-brand-row .rd-paid-pill { margin-left: auto; }
/* Phone: the mark sits UNDER the watch name, left-aligned, on every card (same place whether the name is short or long).
   Why the first try never applied: the customer inventory stylesheet sets `flex-wrap: nowrap !important` on `.inv-card-brand-row` under the page id plus a page class,
   and the private-view rule adds html.wf-private-view on top of it. These selectors carry html + body + the id + the same classes, so they win the tie. */
@media (max-width: 768px) {
  html body #page-inventory[class*="-r01"] .inv-card-brand-row:has(.rd-paid-pill),
  html body #page-inventory .inv-card.wf-ct-card .inv-card-brand-row:has(.rd-paid-pill) { flex-wrap: wrap !important; row-gap: 6px !important; align-items: flex-start !important; }
  html body #page-inventory[class*="-r01"] .inv-card-brand-row:has(.rd-paid-pill) > .inv-card-brand,
  html body #page-inventory .inv-card.wf-ct-card .inv-card-brand-row:has(.rd-paid-pill) > .inv-card-brand { flex: 1 1 100% !important; }
  html body #page-inventory .inv-card-brand-row > .rd-paid-pill { margin: 0 !important; flex: 0 0 auto; align-self: flex-start; }
}

/* ── Money "Your acquisitions" on phones (<= 768px): the name has the full width, the pill sits under it on the left, the cost stays on the right ── */
@media (max-width: 768px) {
  #runner-money-acq .rd-acq-head { display: none; }
  #runner-money-acq .rd-acq { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main main" "st cost"; gap: 6px 12px; align-items: center; padding: 10px 0; }
  #runner-money-acq .rd-acq-main { grid-area: main; }
  #runner-money-acq .rd-acq-t { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; word-break: normal; }
  #runner-money-acq .rd-acq-st { grid-area: st; text-align: left; justify-self: start; }
  #runner-money-acq .rd-acq-cost { grid-area: cost; text-align: right; white-space: nowrap; }
}
