/* The partner's home screen (doc 114, approved by Max on 2 October 2026); portal.css holds everything shared.
   These are mockup/home.css's rules, each scoped under .home-head or .home-grid because every page's stylesheet
   loads on every page, with three changes the page's CSP needs (no inline style): the leaderboard meter is an SVG
   whose fill is set by an attribute, the QR code is an image, and a figure's note is its own dd. No new colour. */

/* ---- Head: the month, how fresh the figures are, nothing else ---------------------------------- */
.home-head { padding: clamp(2rem, 4.2vw, 3.6rem) 0 clamp(1.4rem, 2.6vw, 2rem); }
.home-head h1 { max-width: 18ch; margin: 1rem 0 0; font: 400 var(--type-display)/var(--leading-display) var(--austin); letter-spacing: -.025em; text-wrap: balance; }
.home-head .lead { max-width: 34rem; margin: 1rem 0 0; color: var(--lead); font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.48; }
.home-head .meta { margin: .85rem 0 0; color: var(--quiet); font-size: .78rem; line-height: 1.45; }
@media (max-width: 700px) { .home-head { padding-top: 2rem; } .home-head h1 { margin-top: .8rem; } }

/* ---- Grid: twelve columns on a wide screen, one on a phone, in reading order ---------------------- */
.home-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.home-grid > * { grid-column: span 12; }
.home-grid > .w7 { grid-column: span 7; }
.home-grid > .w5 { grid-column: span 5; }
@media (max-width: 1040px) { .home-grid > .w7, .home-grid > .w5 { grid-column: span 12; } }
.home-grid .card { display: flex; flex-direction: column; }

/* ---- Card heads: a heading and one quiet link to the page with the detail ------------------------ */
.home-grid .card-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.home-grid .card-top h2 { font-size: clamp(1.35rem, 1.7vw, 1.75rem); }
.home-grid .more { display: inline-flex; flex: none; align-items: center; gap: .45rem; min-height: 44px; color: #fff; font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.home-grid .more svg { width: 15px; height: 15px; color: var(--icon); transition: transform 180ms ease; }
.home-grid .more:hover svg { transform: translateX(4px); }

/* ---- Commission: one big number, then pending and approved side by side -------------------------- */
.home-grid .earn-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.4rem 2rem; }
.home-grid .earn-value { display: block; margin-top: .9rem; font: 400 clamp(2.9rem, 5vw, 4.25rem)/.92 var(--austin); letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-grid .earn-value--second { font-size: clamp(2.2rem, 3.6vw, 3.1rem); }
.home-grid .earn .figure-note { max-width: 26rem; }
.home-grid .earn-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; margin: 1.6rem 0 0; }
.home-grid .earn-split > div { padding-top: 1rem; border-top: 1px solid rgba(209, 221, 255, .15); }
.home-grid .earn-split dt { margin: 0; }
.home-grid .earn-split dd { margin: .55rem 0 0; font: 400 clamp(1.45rem, 2vw, 1.9rem)/1.05 var(--austin); letter-spacing: -.012em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-grid .earn-split dd.note { margin-top: .45rem; color: var(--muted); font: 400 .78rem/1.45 var(--sans); letter-spacing: 0; white-space: normal; }
@media (max-width: 380px) { .home-grid .earn-split { grid-template-columns: minmax(0, 1fr); gap: .9rem; } }

/* ---- Next step: the one filled button on the page --------------------------------------------------- */
.home-grid .card.next {
  border-color: rgba(142, 165, 255, .42);
  background:
    radial-gradient(circle at 100% 0, rgba(50, 95, 255, .34), transparent 62%),
    linear-gradient(145deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)),
    rgba(10, 17, 34, .7);
}
.home-grid .next .eyebrow { display: inline-flex; align-items: center; gap: .55rem; }
.home-grid .next .eyebrow::before { width: 6px; height: 6px; border-radius: 50%; background: var(--azure); box-shadow: 0 0 0 4px rgba(50, 95, 255, .22); content: ""; }
.home-grid .card .eyebrow + h2 { margin-top: .9rem; }
.home-grid .next > .button, .home-grid .next > .button-quiet { align-self: flex-start; }
/* A new partner's next step that is not the link card ("Finish setting up", say) is a few lines beside the much
   taller How it works: it keeps its own height rather than stretching into a tall, mostly empty card. */
.home-grid > .card.next.w7:not(:has(.link-box)) { align-self: start; }
.home-grid .spacer { flex: 1 1 auto; min-height: 1.1rem; }
.home-grid .card .spacer + .link-box { margin-top: 0; }
@media (max-width: 600px) { .home-grid .next > .button { align-self: stretch; } }

/* ---- Today against yesterday: two columns of counts, then fourteen days of clicks ----------------- */
.home-grid .vs { width: 100%; margin: 1.1rem 0 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.home-grid .vs th, .home-grid .vs td { padding: .7rem 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.home-grid .vs thead th { padding-top: 0; color: var(--quiet); font-size: .72rem; font-weight: 400; line-height: 1.3; text-align: right; }
.home-grid .vs tbody th { color: var(--lead); font-size: .84rem; font-weight: 400; text-align: left; }
.home-grid .vs td { width: 30%; text-align: right; font: 400 clamp(1.7rem, 2.3vw, 2.15rem)/1 var(--austin); letter-spacing: -.012em; }
.home-grid .vs td.was { color: var(--muted); }
.home-grid .vs tbody tr:last-child > * { border-bottom: 0; }
.home-grid .spark { margin: 1.1rem 0 0; }
.home-grid .spark figcaption { display: flex; justify-content: space-between; margin-bottom: .6rem; color: var(--quiet); font-size: .72rem; }
.home-grid .spark svg { display: block; width: 100%; height: 64px; overflow: hidden; border-bottom: 1px solid var(--line); }
.home-grid .spark .day { fill: rgba(142, 165, 255, .6); }   /* 3.4:1 on the card, above the 3:1 WCAG asks of a chart mark */
.home-grid .spark .day--today { fill: var(--azure); }
.home-grid .spark-x { display: flex; justify-content: space-between; margin-top: .45rem; color: var(--quiet); font-size: .72rem; }
.home-grid .card .empty-note { margin-top: 1.1rem; }

/* ---- Your link: the best link, one line, Copy and the QR code ---------------------------------------- */
.home-grid .card .link-box { max-width: none; margin: 1.1rem 0 0; padding: .95rem 1.1rem; border: 1px solid rgba(209, 221, 255, .24); border-radius: 16px; color: #fff; background: rgba(8, 14, 30, .58); font: 400 .86rem/1.4 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.home-grid .button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1rem; }
.home-grid .button-row .more { margin-left: auto; }
@media (max-width: 600px) { .home-grid .next .button-row .button { flex: 1 1 100%; } .home-grid .button-row .more { margin-left: 0; } }
.home-grid .qr-tile { display: grid; justify-items: center; gap: .55rem; margin: 0; }
.home-grid .qr-tile img { display: block; width: 148px; height: 148px; border-radius: 14px; background: #fff; }
.home-grid .qr-tile figcaption { color: var(--quiet); font-size: .72rem; }
.home-grid .qr-panel-home { justify-items: start; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
/* A new partner: the QR code beside the link on a wide screen; on a phone the QR code button opens it. */
.home-grid .share { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: start; margin-top: .9rem; }
.home-grid .card .share p:first-child { margin-top: 0; }
.home-grid .share > div { min-width: 0; }
.home-grid .qr-only-phone { display: none; }
@media (max-width: 1040px) {
  .home-grid .share { grid-template-columns: minmax(0, 1fr); }
  .home-grid .qr-beside { display: none; }
  .home-grid .qr-only-phone { display: inline-flex; }
}

/* ---- Leaderboard place: the ordinal, the gap to the place above, a bar for the distance left ------ */
.home-grid .place { display: flex; align-items: baseline; gap: .9rem; margin-top: 1rem; }
.home-grid .place strong { font: 400 clamp(3rem, 5vw, 4rem)/.9 var(--austin); letter-spacing: -.03em; }
.home-grid .place span { color: var(--lead); font-size: .9rem; line-height: 1.35; }
.home-grid .meter { display: block; width: 100%; height: 6px; margin: 1.2rem 0 0; overflow: hidden; }
.home-grid .meter-track { fill: rgba(209, 221, 255, .12); }
.home-grid .meter-fill { fill: var(--azure); }
.home-grid .meter-key { display: flex; justify-content: space-between; margin-top: .5rem; color: var(--quiet); font-size: .72rem; }
.home-grid .nearby { margin: 1.1rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); font-size: .84rem; }
.home-grid .nearby li { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; gap: .75rem; min-height: 46px; border-bottom: 1px solid var(--rule); }
.home-grid .nearby li:last-child { border-bottom: 0; }
.home-grid .nearby .r { color: var(--quiet); font: 400 1.15rem/1 var(--austin); font-variant-numeric: tabular-nums; }
.home-grid .nearby .who { min-width: 0; overflow-wrap: anywhere; }
.home-grid .nearby .s { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-grid .nearby .me { margin: 0 -.75rem; padding: 0 .75rem; border-radius: 12px; background: rgba(50, 95, 255, .16); }
.home-grid .nearby .me .r { color: #fff; }

/* ---- Latest sales and the lead's introducers: short rows, never the stacked table ------------------ */
.home-grid .rows { margin: 1.1rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.home-grid .rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .3rem 1rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.home-grid .rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.home-grid .rows .what { min-width: 0; font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere; }
.home-grid .rows .what small { display: block; margin-top: .2rem; color: var(--quiet); font-size: .76rem; }
.home-grid .rows .amt { text-align: right; font: 400 1.2rem/1.1 var(--austin); font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-grid .rows .amt .status { display: flex; justify-content: flex-end; margin-top: .35rem; font-size: 11px; }
.home-grid .rows .amt small { display: block; margin-top: .35rem; color: var(--quiet); font: 400 .72rem/1 var(--sans); text-align: right; }
.home-grid .rows .amt.zero { color: var(--quiet); }
.home-grid .card .foot { max-width: none; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--rule); color: var(--quiet); font-size: .76rem; }

/* ---- New partner: three steps, and the zeros kept small ---------------------------------------------- */
.home-grid .steps { margin: 1.2rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.home-grid .steps li { padding: .9rem 0; border-top: 1px solid var(--rule); color: var(--muted); font-size: .84rem; line-height: 1.45; counter-increment: step; }
.home-grid .steps li:last-child { padding-bottom: 0; }
.home-grid .steps li::before { display: block; margin-bottom: .55rem; color: var(--quiet); font-size: .72rem; content: "0" counter(step); }
.home-grid .steps strong { display: block; margin-bottom: .3rem; color: #fff; font: 400 1.3rem/1.1 var(--austin); letter-spacing: -.012em; }
.home-grid .zeros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.1rem 0 0; }
.home-grid .zeros div { padding-top: .9rem; border-top: 1px solid rgba(209, 221, 255, .15); }
.home-grid .zeros dd { margin: .5rem 0 0; color: var(--muted); font: 400 1.6rem/1 var(--austin); font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .home-grid .zeros { gap: .75rem; } .home-grid .zeros dd { font-size: 1.35rem; } }

/* ---- My introducers, side by side (doc 170 card 25; app.js introducers()): a 14-day column chart in each row, and each
   introducer's sales one native disclosure below, closed until asked for. ------------------------------------------------ */
.team-spark { display: block; width: 7.5rem; height: 22px; }
.team-spark rect { fill: var(--azure); }
details.team-sales { margin-top: 1rem; }
details.team-sales > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; min-height: 44px; cursor: pointer; list-style: none; }
details.team-sales > summary > span { display: grid; gap: .35rem; }
details.team-sales > summary svg { width: 20px; height: 20px; color: var(--icon); transition: transform .2s ease; }
details.team-sales[open] > summary svg { transform: rotate(180deg); }
details.team-sales > summary::-webkit-details-marker { display: none; }
.team-sales-title { font: 400 clamp(1.35rem, 1.7vw, 1.75rem)/1.1 var(--austin); letter-spacing: -.012em; }
details.team-sales[open] > summary { margin-bottom: 1rem; }
details.team-sales > summary:focus-visible { outline: 2px solid var(--azure); outline-offset: 4px; border-radius: 8px; }

/* Doc 170 card 28: the home screen hint, only on a phone in a browser tab (never once opened from the home screen). */
.home-grid > .install { display: none; }
@media (max-width: 700px) and (display-mode: browser) { .home-grid > .install { display: flex; } }

/* ---- Doc 205 item 7 (held for Max): a note from CMC Markets Funded at the top of the Dashboard ------------ */
.home-grid .announce { border-color: rgba(159, 178, 255, .42); }
.home-grid .announce .eyebrow { display: inline-flex; align-items: center; gap: .55rem; }
.home-grid .announce .eyebrow::before { width: 6px; height: 6px; border-radius: 50%; background: var(--azure); box-shadow: 0 0 0 4px rgba(50, 95, 255, .22); content: ""; }
.home-grid .announce h2 { font-size: clamp(1.35rem, 1.7vw, 1.75rem); }
