/* cp-earn — "Every swipe counts." Accent: amber, plus ink.
   A month of points as a printed receipt. It hangs from the figures row's bottom rule,
   as if that rule were the printer's slot, and prints downward once on scroll. */
#cp-earn { --rc-w: 384px; }

#cp-earn .ce {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

/* caption: the total, sitting under the first figure */
#cp-earn .ce-cap { grid-column: 1 / span 2; align-self: center; padding-right: 24px; }
#cp-earn .ce-k { color: var(--fg2); }
#cp-earn .ce-total {
  display: flex; align-items: flex-start; margin-top: 18px;
  font-family: var(--f-display); font-weight: 800; font-size: clamp(88px, 11vw, 168px); line-height: .82; letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}
#cp-earn .ce-plus { align-self: center; font-size: .56em; line-height: 1; margin: -.04em .04em 0 -.02em; letter-spacing: 0; }
#cp-earn .ce-unit { margin-top: 18px; font-size: var(--t-lead); line-height: 1.4; color: var(--fg2); max-width: 26ch; }
#cp-earn .ce-prog { margin-top: clamp(28px, 3vw, 40px); max-width: 420px; }
#cp-earn .ce-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; height: 10px; }
#cp-earn .ce-seg i { border-radius: 2px; background: rgba(22,33,29,.16); }
#cp-earn .ce-seg i.on { background: var(--ink); }
#cp-earn .ce-seg i.part { background: linear-gradient(90deg, var(--ink) 0 var(--p), rgba(22,33,29,.16) var(--p)); }
#cp-earn .ce-of { margin-top: 12px; font-size: 14.5px; color: var(--fg2); }
#cp-earn .ce-of b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }

/* the printer: a slot laid on the rule, and the paper feeding out under it */
#cp-earn .ce-printer { grid-column: 3; justify-self: center; position: relative; width: min(100%, var(--rc-w)); margin-top: -1px; }
#cp-earn .ce-slot {
  position: absolute; z-index: 2; left: -14px; right: -14px; top: -4px; height: 8px; border-radius: 4px;
  background: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.25);
}
/* clip only above the slot, so the paper's shadow still falls on the page */
#cp-earn .ce-feed { position: relative; clip-path: inset(0 -120px -160px -120px); }
#cp-earn .ce-shadow { filter: drop-shadow(0 2px 3px rgba(22,33,29,.12)) drop-shadow(0 22px 30px rgba(22,33,29,.28)); will-change: transform; }

/* the paper: off-white, mono, torn (zigzag) bottom edge drawn with a mask */
#cp-earn .ce-rcpt {
  --tooth: 16px;
  position: relative; background: var(--paper-3); color: var(--ink);
  padding: 34px 28px calc(28px + var(--tooth) / 2);
  font-family: var(--f-mono); font-size: 13px; line-height: 1.45; letter-spacing: .01em;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) / 2 + 1px) no-repeat,
                conic-gradient(from -45deg at 50% 100%, #0000, #000 .6deg 89.4deg, #0000 90deg) 50% 100% / var(--tooth) calc(var(--tooth) / 2) repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) / 2 + 1px) no-repeat,
                conic-gradient(from -45deg at 50% 100%, #0000, #000 .6deg 89.4deg, #0000 90deg) 50% 100% / var(--tooth) calc(var(--tooth) / 2) repeat-x;
}
/* faint feed shading near the top, where the paper leaves the slot */
#cp-earn .ce-rcpt::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: linear-gradient(rgba(22,33,29,.07), rgba(22,33,29,0)); }

#cp-earn .ce-rh { display: grid; justify-items: center; gap: 4px; text-align: center; text-transform: uppercase; letter-spacing: .1em; font-size: 12.5px; color: var(--ink-70); }
#cp-earn .ce-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-family: var(--f-display); font-weight: 800; font-size: 22px; letter-spacing: -0.035em; text-transform: none; color: var(--ink); }
#cp-earn .ce-brand svg { width: 22px; height: 22px; color: var(--ink); }
#cp-earn .ce-meta { justify-self: stretch; display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }
#cp-earn .ce-meta + .ce-meta { margin-top: 0; }
#cp-earn .ce-rh .ce-meta:first-of-type { margin-top: 18px; }

#cp-earn .ce-tbl { width: 100%; margin-top: 18px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#cp-earn .ce-tbl th, #cp-earn .ce-tbl td { padding: 0; font-weight: 400; text-align: right; white-space: nowrap; vertical-align: baseline; }
#cp-earn .ce-tbl th[scope="row"], #cp-earn .ce-tbl thead th:first-child { text-align: left; }
#cp-earn .ce-tbl td + td { padding-left: 12px; }
#cp-earn .ce-tbl td:nth-child(3) { width: 4ch; }
#cp-earn .ce-tbl td:last-child { width: 7ch; }
#cp-earn .ce-tbl thead tr {
  --dash: repeating-linear-gradient(90deg, var(--ink-28) 0 4px, transparent 4px 7px);
  background: var(--dash) 0 0 / 100% 1.5px no-repeat, var(--dash) 0 100% / 100% 1.5px no-repeat;
}
#cp-earn .ce-tbl thead th { padding: 10px 0; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-50); }
#cp-earn .ce-tbl thead th + th { padding-left: 12px; }
#cp-earn .ce-line > * { padding-top: 14px; }
#cp-earn .ce-tbl tbody tr:first-child > * { padding-top: 14px; }
#cp-earn .ce-line td:last-child { font-weight: 400; color: var(--ink); }
#cp-earn .ce-sub > * { padding-top: 3px; color: var(--ink-70); }
#cp-earn .ce-sub th { padding-left: 2ch; }
#cp-earn .ce-sub th[colspan] { white-space: normal; }

#cp-earn .ce-sum { margin-top: 16px; padding-top: 12px; border-top: 1.5px dashed var(--ink-28); display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
#cp-earn .ce-sum > div { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-70); }
#cp-earn .ce-sum dd { color: var(--ink); }
#cp-earn .ce-sum .ce-big { align-items: baseline; padding-bottom: 8px; color: var(--ink); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
#cp-earn .ce-sum .ce-big dd { font-family: var(--f-display); font-weight: 800; font-size: 30px; letter-spacing: -0.04em; text-transform: none; }

#cp-earn .ce-rf { margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed var(--ink-28); display: grid; gap: 2px; text-align: center; font-size: 12.5px; color: var(--ink-70); }
#cp-earn .ce-rf .ce-ill { margin-top: 10px; text-transform: uppercase; letter-spacing: .12em; font-size: 11.5px; color: var(--ink-50); }

@media (max-width: 1100px) {
  #cp-earn .ce { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #cp-earn .ce-cap { grid-column: 1; }
  #cp-earn .ce-printer { grid-column: 2; }
  #cp-earn .ce-total { font-size: clamp(64px, 10vw, 110px); }
}
@media (max-width: 900px) {
  #cp-earn .ce { grid-template-columns: minmax(0, 1fr) var(--rc-w); column-gap: 32px; }
  #cp-earn .ce-printer { justify-self: end; margin-right: 16px; }
}
@media (max-width: 700px) {
  #cp-earn .ce { grid-template-columns: minmax(0, 1fr); }
  #cp-earn .ce-printer { grid-column: 1; grid-row: 1; justify-self: center; margin-right: 0; width: min(100% - 16px, 420px); }
  #cp-earn .ce-cap { grid-column: 1; grid-row: 2; align-self: start; padding: clamp(40px, 8vw, 56px) 0 0; }
  #cp-earn .ce-total { font-size: clamp(88px, 26vw, 132px); }
  #cp-earn .ce-cap { padding-right: 0; }
}
@media (max-width: 420px) {
  #cp-earn .ce-rcpt { padding-inline: 20px; font-size: 12.5px; }
  #cp-earn .ce-tbl td + td, #cp-earn .ce-tbl thead th + th { padding-left: 8px; }
  #cp-earn .ce-tbl thead th { font-size: 12px; letter-spacing: .06em; }
  #cp-earn .ce-rh { font-size: 12.5px; letter-spacing: .06em; }
  #cp-earn .ce-rf .ce-ill { font-size: 12.5px; }
}
