/* The admin site. Cream page, ink words, the notch's black for the funnel, orange for the one
   main button in each part, green for paid. */

:root {
  --orange: #f26b3a;
  --cream: #fff4ec;
  --ink: #1d1410;
  --ink-2: #6f5d54;
  --hair: rgb(29 20 16 / 0.1);
  --card: #fffaf6;
  --green: #3dcf7d;
  --green-ink: #178a4c;
  --amber: #ffb021;
  --red: #ff5a4f;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "SF Pro", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--cream);
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font: 15px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
h1,
h2 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 17px;
  margin-bottom: 12px;
}

/* the site's face, giving you side-eye */
.mark {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: url(/favicon.svg) center / cover;
  vertical-align: -6px;
}

/* ---------- buttons and fields ---------- */

button {
  cursor: pointer;
  border: 1px solid var(--hair);
  background: #fff;
  border-radius: 12px;
  padding: 9px 14px;
  font-weight: 600;
  white-space: nowrap;
}
button:active {
  transform: translateY(1px);
}
button.main {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}
button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
  padding-left: 8px;
  padding-right: 8px;
}
button.quiet:hover {
  color: #c4372c;
}
input[type="text"],
input[type="password"] {
  width: 100%;
  min-width: 0;
  border: 1px solid rgb(29 20 16 / 0.18);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 16px; /* no zoom on iPhone */
}
input:focus-visible,
button:focus-visible {
  outline: 3px solid rgb(242 107 58 / 0.4);
  outline-offset: 1px;
}
.row {
  display: flex;
  gap: 8px;
}

/* ---------- login ---------- */

body.login main {
  max-width: 340px;
  margin: 0 auto;
  padding: max(18vh, 60px) 16px 40px;
  text-align: center;
}
body.login .mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 18px;
}
body.login h1 {
  font-size: 22px;
  margin-bottom: 26px;
}
body.login form {
  display: grid;
  gap: 10px;
  text-align: left;
}
body.login label {
  font-weight: 600;
}
body.login button {
  padding: 12px;
  font-size: 16px;
}
.msg {
  min-height: 1.4em;
  margin: 2px 0 0;
  color: #c4372c;
  text-align: center;
}

/* ---------- the page ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 980px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px 6px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
}
.out {
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 0 6px 10px;
}
.out:hover {
  color: var(--ink);
}
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 16px max(40px, env(safe-area-inset-bottom));
}

.range {
  display: flex;
  padding: 3px;
  margin: 6px 0 14px;
  border-radius: 13px;
  background: rgb(29 20 16 / 0.07);
}
.range button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 4px;
  color: var(--ink-2);
}
.range button[aria-pressed="true"] {
  background: #000;
  color: var(--cream);
}

/* the funnel: the notch's black, four numbers, the share kept under each divider */
.funnel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 20px 0 34px;
  margin-bottom: 14px;
  border-radius: 24px;
  background: #000;
  color: var(--cream);
}
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 6px;
  text-align: center;
}
.step + .step {
  border-left: 1px solid rgb(255 244 236 / 0.16);
}
.step .n {
  font: 700 clamp(22px, 6.2vw, 46px) / 1.05 var(--round);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.step:last-child .n {
  color: var(--green);
}
.step .l {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.25;
  color: rgb(255 244 236 / 0.66);
}
.kept {
  position: absolute;
  left: 0;
  bottom: -26px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kept:empty {
  display: none;
}

.card {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--hair);
  border-radius: 20px;
  background: var(--card);
}

/* the daily bars */
.chart {
  position: relative;
  height: 130px;
}
.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart .bar {
  fill: var(--orange);
}
.chart .bar.on {
  fill: var(--ink);
}
.chart .zero {
  fill: rgb(29 20 16 / 0.14);
}
.chart .paid {
  fill: var(--green);
  stroke: var(--card);
  stroke-width: 2;
}
.chart .hit {
  fill: transparent;
  cursor: pointer;
}
.chart .grid {
  stroke: var(--hair);
  stroke-width: 1;
}
.chart .max {
  font: 11px var(--sans);
  fill: var(--ink-2);
}
.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.caption {
  margin: 10px 0 0;
  font-variant-numeric: tabular-nums;
}
.caption b {
  font-weight: 650;
}
.caption .g {
  color: var(--green-ink);
  font-weight: 650;
}

/* where they came from */
.sources {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.sources th {
  padding: 0 0 8px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-2);
  text-align: right;
  vertical-align: bottom;
}
.sources th:first-child {
  padding-left: 0;
  text-align: left;
}
.sources th:last-child {
  white-space: nowrap;
}
.sources td {
  padding: 9px 0 9px 8px;
  border-top: 1px solid var(--hair);
  text-align: right;
  white-space: nowrap;
}
.sources td:first-child {
  max-width: 0;
  width: 46%;
  padding-left: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-weight: 600;
}
.sources tr.sub td {
  border-top: 0;
  padding-top: 4px;
  padding-bottom: 6px;
  color: var(--ink-2);
}
.sources tr.sub td:first-child {
  padding-left: 14px;
  font-weight: 400;
}
.sources .paid,
.sources tr.sub td.paid {
  color: var(--green-ink);
  font-weight: 650;
}
.tag {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-2);
}
.tag.warn {
  color: #9a6400;
}
.empty {
  color: var(--ink-2);
}

/* the three small lists */
.trio {
  display: grid;
  gap: 0 14px;
}
.list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.list li + li {
  border-top: 1px solid var(--hair);
}
.list .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list .share {
  width: 34%;
  height: 6px;
  border-radius: 3px;
  background: rgb(29 20 16 / 0.08);
  overflow: hidden;
}
.list .share i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--orange);
}
.list .v {
  min-width: 2.5em;
  text-align: right;
  font-weight: 600;
}

/* your links */
.links label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
}
.made {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgb(61 207 125 / 0.14);
}
.made p {
  margin: 0 0 8px;
  font-weight: 600;
}
.made .url {
  margin: 0 0 10px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.linklist {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.linklist li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--hair);
}
.linklist .what {
  flex: 1;
  min-width: 0;
}
.linklist .what b {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.linklist .what span {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.linklist button {
  padding: 7px 11px;
  font-size: 14px;
}
.note {
  min-height: 1.4em;
  margin: 0;
  text-align: center;
  color: var(--ink-2);
  font-size: 13px;
}

@media (min-width: 760px) {
  main {
    padding-top: 12px;
  }
  .range {
    max-width: 420px;
  }
  .funnel {
    padding: 28px 0 40px;
  }
  .step .l {
    font-size: 14px;
  }
  .card {
    padding: 20px 22px;
  }
  .chart {
    height: 170px;
  }
  .trio {
    grid-template-columns: repeat(3, 1fr);
  }
  .list .share {
    width: 24%;
  }
  .sources td:first-child {
    width: 40%;
  }
}
