/* How it works, step 4 (Earn): the parts of Reach's console (how-console.css draws its frame and
   pages): the figures, money over the weeks, what just happened, each page's list and Reach's faces.
   Reach's colors are its own (reach/design/theme.ts), named on the console's window. */

/* A figure: what it counts, the number, and how much of it came this week */
.ea-card {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px 16px 16px;
}
.ea-card b {
  font-size: 26px;
  line-height: 32px;
  font-weight: 650;
  letter-spacing: -0.018em;
  color: var(--r-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ea-card .ea-up {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--r-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ea-card .ea-up svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
  color: var(--r-live);
}
.ea-card .ea-up [data-fig] {
  font-weight: 560;
  color: var(--r-up);
}
.ea-card .wd {
  margin-inline-start: 2px;
}

/* Money over the weeks: the line draws as far as how.js says (--p, and the tip's --v) */
.ea-chart {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px 16px 12px;
}
.plot {
  position: relative;
  flex: 1;
  min-height: 72px;
  border-bottom: 1px solid var(--r-hair);
}
.plot::before {
  content: "";
  position: absolute;
  inset: 46% 0 auto;
  border-top: 1px dashed var(--r-hair);
}
.hw-earn .plot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  clip-path: inset(-8px calc((1 - var(--p, 1)) * 100%) -8px -8px);
}
.plot .area {
  fill: var(--r-wash);
  stroke: none;
}
.plot polyline {
  fill: none;
  stroke: var(--r-strong);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.tip {
  position: absolute;
  left: calc(var(--p, 1) * 100%);
  bottom: calc(var(--v, 1) * 92%);
  width: 10px;
  height: 10px;
  margin: 0 0 -5px -5px;
  border-radius: 50%;
  background: var(--r-strong);
  box-shadow:
    0 0 0 3px var(--r-panel),
    0 0 0 4px var(--r-hair);
}
.wk {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 16px;
  color: var(--r-muted);
}

/* What just happened, on Overview: the newest on top, four of them */
.ea-feed {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 8px;
}
.ea-feed ul,
.ea-rows {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ea-feed li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 0;
  color: var(--r-body);
}
.ea-feed li + li,
.ea-rows li + li {
  border-top: 1px solid var(--r-hair);
}
.ea-feed time,
.ea-rows time {
  font-size: 12px;
  color: var(--r-muted);
  font-variant-numeric: tabular-nums;
}
.ea-feed li.on ~ li.on ~ li.on ~ li.on ~ li.on,
.hw:not(.js) .ea-feed li:nth-child(n + 5) {
  display: none;
}

/* A page's list: a face, a name and what it is, and one word or amount at the end */
.ea-list {
  grid-column: 1 / -1;
  align-self: start;
  padding: 4px 16px;
}
.ea-list > small {
  padding-top: 10px;
}
.ea-rows li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-inline: -16px;
  padding: 8px 16px;
}
.ea-rows b,
.ea-rows small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ea-rows b {
  font-weight: 560;
  color: var(--r-strong);
}
.ea-rows small {
  font-size: 12px;
  line-height: 16px;
  color: var(--r-muted);
}
.ea-rows .fc {
  width: 32px;
  height: 32px;
}
.ea-rows .ea-amt {
  font-variant-numeric: tabular-nums;
}
.ea-st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 560;
  color: var(--r-body);
  white-space: nowrap;
}
.ea-st.wait i {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--r-muted);
}
.ea-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--r-wash);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* Faces: Reach's soft tints, initials in their deep ink */
.fc {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-style: normal;
  font-weight: 620;
}
.fc.f1 {
  background: #f7dad4;
  color: #6d372c;
}
.fc.f2 {
  background: #f7e7d4;
  color: #6d4f2c;
}
.fc.f3 {
  background: #f7f1d4;
  color: #6d622c;
}
.fc.f4 {
  background: #d4f7e0;
  color: #2c6d42;
}
.fc.f5 {
  background: #d4f7f7;
  color: #2c6d6d;
}
.fc.f6 {
  background: #d4e6f7;
  color: #2c4d6d;
}
.fc.f7 {
  background: #e6d4f7;
  color: #4d2c6d;
}
.fc.f8 {
  background: #f7d4e6;
  color: #6d2c4d;
}

/* What arrives while a page is open: it takes its place on top, lit for a moment */
.hw.js .ea-feed li[data-at]:not(.on),
.hw.js .ea-rows li[data-at]:not(.on) {
  display: none;
}
.hw.js .ea-feed li.on {
  animation: hw-in 350ms var(--ease-out);
}
.hw.js .ea-rows li.on {
  animation:
    hw-in 350ms var(--ease-out),
    ea-lit 2400ms var(--ease-out);
}
@keyframes ea-lit {
  from {
    background: #fff7e0;
  }
}

/* Narrower: the figures stand alone */
/* Narrower: the rail keeps only its icons, the figures stand alone */
@container (max-width: 960px) {
  .ea-card b {
    font-size: 22px;
    line-height: 28px;
  }
}

/* On a phone: smaller figures, and the lists keep clear of the phone in front of the corner */
/* On a phone: the rail is a row of icons under the top, the pointer gives way to the row's own
   highlight, and the lists keep clear of the phone in front of the corner */
@container (max-width: 680px) {
  .ea-card {
    gap: 2px;
    padding: 10px;
  }
  .ea-card b {
    font-size: 18px;
    line-height: 24px;
  }
  .ea-card .ea-sub {
    display: none;
  }
  .ea-chart {
    height: 170px;
  }
  .ea-feed {
    align-self: start;
    margin-inline-end: 43%;
    padding: 12px 12px 6px;
  }
  .ea-feed li {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    padding: 6px 0;
  }
  .ea-feed time {
    display: none;
  }
  .ea-feed .fc {
    width: 24px;
    height: 24px;
  }
  .ea-feed li.on ~ li.on ~ li.on ~ li.on,
  .hw:not(.js) .ea-feed li:nth-child(n + 4) {
    display: none;
  }
  .ea-list {
    padding-inline: 12px;
  }
  .ea-rows li {
    gap: 10px;
    min-height: 52px;
    margin-inline: -12px;
    padding-inline: 12px;
  }
  .ea-rows li:nth-child(n + 6),
  .ea-card ~ .ea-list .ea-rows li:nth-child(n + 5) {
    display: none;
  }
}
