/* Publish Your Own Automations, Make Money (js/publish.js, index.html #publish). The app's Automations tab, Publish
   dialog and marketplace card (sidebars.bdeb2397/automations.03378ba4.css, publish.6c0fd59e.css) at the site's tokens;
   the earnings list is a payments feed in the app's row style; the paid-out figure is the section's one bold thing.
   Everything that moves is moved by js/publish.js (transform and opacity only); the frame, the list and the figure are
   out of scroll anchoring, so a row arriving never moves the page. */
.pub-stage {
  display: grid;
  grid-template-columns: var(--pub-cols);
  grid-template-areas: "head head" "app pay";
  gap: var(--sp-32) var(--sp-48);
  align-items: start;
}
/* the heading row: the heading and its lede on the left, the paid-out figure in the top right corner */
.pub-head { grid-area: head; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-48); }
.pub-intro { display: grid; gap: var(--sp-16); min-width: 0; }
.pub-head h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--tr-h2); font-weight: 700; }
.pub-lede { max-width: 60ch; font-size: var(--fs-lede); line-height: var(--lh-lede); color: var(--muted); }

/* ---------- the app's Automations tab ---------- */
.pub-app {
  grid-area: app; position: relative; overflow: hidden; overflow-anchor: none;
  height: var(--pub-frame); padding: var(--sp-16);
  font-size: var(--fs-meta); line-height: var(--lh-meta); user-select: none;
}
.pub-lu { width: var(--ic-s); height: var(--ic-s); fill: none; stroke: currentColor; stroke-width: var(--lu-stroke); stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pub-bar { display: flex; align-items: center; gap: var(--sp-8); margin-bottom: var(--sp-16); white-space: nowrap; }
.pub-btn {
  display: inline-flex; align-items: center; gap: var(--sp-6); flex: none;
  height: var(--sp-32); padding: 0 var(--sp-12) 0 var(--sp-8);
  border: var(--hair) solid var(--ink); border-radius: var(--r-pill);
  background: var(--ink); color: var(--surface); font-weight: 600; font-size: var(--fs-meta);
}
.pub-btn-ic { width: var(--ic-s); height: var(--ic-s); }
.pub-ghost { background: var(--surface); color: var(--ink); border-color: var(--sel); }
.pub-chip {
  display: inline-flex; align-items: center; gap: var(--sp-6); flex: none;
  height: var(--sp-32); padding: 0 var(--sp-12);
  border: var(--hair) solid var(--sel); border-radius: var(--r-pill);
  background: var(--surface); font-weight: 500;
}
.pub-chip.is-on { background: var(--sel); border-color: var(--sel); }
.pub-chip i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.pub-chip-ic { width: var(--ic-s); height: var(--ic-s); }
.pub-chip-new { opacity: 0; }

/* the marketplace card (.am-card), two of them: the one just published lands first, the seeded one makes way */
.pub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-12); }
.pub-card {
  display: flex; flex-direction: column; min-width: 0; padding: var(--sp-6);
  border: var(--hair) solid var(--sel); border-radius: var(--r-surf); background: var(--surface);
}
.pub-new { opacity: 0; }
.pub-seed { transform: translateX(calc((100% + var(--sp-12)) * var(--shift, 0) * -1)); }
.pub-thumb {
  position: relative; display: grid; place-items: center; overflow: hidden;
  aspect-ratio: var(--pub-thumb); border-radius: var(--r-ctl); background: var(--ground);
}
.pub-thumb > img:not(.pub-thumb-ic) { width: 100%; height: 100%; object-fit: cover; }
.pub-thumb-ic { width: var(--ic-l); height: var(--ic-l); }
.pub-badge {
  position: absolute; top: var(--sp-6); left: var(--sp-6);
  display: inline-flex; align-items: center; height: var(--sp-20); padding: 0 var(--sp-6);
  border: var(--hair) solid var(--sel); border-radius: var(--r-pill);
  background: var(--surface); color: var(--muted); font-size: var(--fs-tiny); font-weight: 500;
}
.pub-card-head { display: flex; align-items: center; gap: var(--sp-8); padding: var(--sp-8) var(--sp-6) 0; min-width: 0; }
.pub-card-ic { width: var(--ic-m); height: var(--ic-m); }
.pub-name { display: grid; min-width: 0; }
.pub-name b, .pub-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-name b { font-size: var(--fs-small); font-weight: 600; }
.pub-name small { font-size: var(--fs-tiny); color: var(--muted); }
.pub-desc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--pub-lines); line-clamp: var(--pub-lines); overflow: hidden;
  margin-top: var(--sp-6); padding: 0 var(--sp-6); font-size: var(--fs-tiny); line-height: var(--lh-small); color: var(--muted);
}
.pub-foot { display: flex; align-items: center; gap: var(--sp-8); margin-top: auto; padding: var(--sp-8) var(--sp-6) var(--sp-2); font-size: var(--fs-tiny); color: var(--muted); }
.pub-rate { display: inline-flex; align-items: center; gap: var(--sp-4); }
.pub-rate b { color: var(--ink); font-weight: 600; }
.pub-star { width: var(--star); height: var(--star); }
.pub-uses { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pub-try {
  display: inline-flex; align-items: center; flex: none; margin-left: auto;
  height: var(--sp-24); padding: 0 var(--sp-12); border-radius: var(--r-pill);
  background: var(--ink); color: var(--surface); font-weight: 600; white-space: nowrap;
}

/* ---------- the Publish dialog (publish.6c0fd59e.js), over a scrim ---------- */
.pub-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; }
.pub-dlg {
  position: absolute; top: var(--sp-16); bottom: var(--sp-16); left: 0; right: 0; margin-inline: auto;
  width: min(100% - 2 * var(--sp-16), var(--pub-dlg));
  display: flex; flex-direction: column; overflow: hidden; visibility: hidden; opacity: 0;
  border: var(--hair) solid var(--sel); border-radius: var(--r-surf); background: var(--surface); box-shadow: var(--lift-s);
}
.pub-dlg-top { display: flex; align-items: center; gap: var(--sp-8); padding: var(--sp-12) var(--sp-16); border-bottom: var(--hair) solid var(--sel); }
.pub-dlg-top b { font-size: var(--fs-body); font-weight: 600; white-space: nowrap; }
.pub-dlg-ic { width: var(--ic-m); height: var(--ic-m); }
.pub-saved { display: inline-flex; align-items: center; gap: var(--sp-4); margin-left: auto; font-size: var(--fs-tiny); color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity var(--d-base) var(--ease-std); }
.pub-x { color: var(--muted); }
.pub-dlg-body { position: relative; flex: 1; min-height: 0; padding: var(--sp-12) var(--sp-16); overflow: hidden; }
.pub-form { display: grid; gap: var(--sp-6); }
.pub-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-12); margin-bottom: var(--sp-6); }
.pub-drop {
  display: grid; place-content: center; justify-items: center; gap: var(--sp-2);
  width: calc(var(--sp-96) + var(--sp-72)); border: var(--hair) dashed var(--muted); border-radius: var(--r-ctl);
  background: var(--ground); font-size: var(--fs-tiny);
}
.pub-drop small { font-size: var(--fs-tiny); color: var(--muted); }
.pub-drop-ic { width: var(--ic-m); height: var(--ic-m); }
.pub-meta { display: grid; gap: var(--sp-6); min-width: 0; align-content: start; }
.pub-l { display: flex; align-items: center; gap: var(--sp-6); font-weight: 600; }
.pub-l-ic { width: var(--ic-s); height: var(--ic-s); }
.pub-in {
  height: var(--sp-32); padding: var(--sp-6) var(--sp-8); overflow: hidden;
  border: var(--hair) solid var(--sel); border-radius: var(--r-ctl); white-space: nowrap;
}
.pub-in.is-typing { border-color: var(--ink); }
.pub-ta { height: var(--sp-48); white-space: normal; }
.pub-prompt { height: var(--pub-prompt); white-space: normal; }
.pub-caret { display: inline-block; width: var(--hair); height: 1em; vertical-align: text-bottom; background: var(--ink); opacity: 0; }
.pub-in.is-typing .pub-caret { opacity: 1; }
.pub-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6); }
.pub-cat {
  display: flex; align-items: center; gap: var(--sp-6); min-width: 0; height: var(--sp-32); padding: 0 var(--sp-8);
  border: var(--hair) solid var(--sel); border-radius: var(--r-ctl); font-weight: 500; white-space: nowrap;
}
.pub-cat.is-on { border-color: var(--ink); }
.pub-radio { display: grid; place-items: center; margin-left: auto; width: var(--ic-s); height: var(--ic-s); border: var(--hair) solid var(--sel); border-radius: 50%; color: transparent; }
.pub-radio .pub-lu { width: var(--sp-12); height: var(--sp-12); }
.pub-cat.is-on .pub-radio { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.pub-result { position: absolute; inset: var(--sp-16); display: grid; align-content: start; justify-items: start; gap: var(--sp-8); visibility: hidden; }
.pub-result b { font-size: var(--fs-body); font-weight: 600; }
.pub-result .pub-btn { padding: 0 var(--sp-12); }
.pub-dlg-foot { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-12) var(--sp-16); border-top: var(--hair) solid var(--sel); }

/* the pointer that presses the app's buttons */
.pub-ptr { position: absolute; left: 0; top: 0; z-index: 2; width: var(--ic-s); pointer-events: none; }
.pub-ptr svg { display: block; width: 100%; height: auto; }
.pub-ptr path { fill: var(--ink); stroke: var(--surface); stroke-width: var(--hair); stroke-linejoin: round; }

/* ---------- Make Money: the figure and the earnings, as a payments feed ---------- */
/* the column beside the app frame, exactly its height: Make Money and its line on top, the earnings list filling
   the rest, so the list ends level with the frame */
.pub-pay { grid-area: pay; align-self: stretch; display: flex; flex-direction: column; gap: var(--sp-16); min-width: 0; }
.pub-money { font-size: var(--fs-title); line-height: var(--lh-title); letter-spacing: var(--tr-title); font-weight: 700; }
.pub-how { max-width: 44ch; color: var(--muted); }
.pub-total { flex: none; display: grid; justify-items: end; gap: var(--sp-4); text-align: right; overflow-anchor: none; }
.pub-total b {
  font-size: var(--fs-paid); line-height: var(--lh-display); letter-spacing: var(--tr-display); font-weight: 700;
  color: var(--win); font-variant-numeric: tabular-nums;
}
.pub-total span { color: var(--muted); }
.pub-feed {
  position: relative; overflow: hidden; overflow-anchor: none; list-style: none; padding: 0;
  flex: 1 1 0; min-height: calc(var(--pub-rows) * var(--pub-row));
  border: var(--hair) solid var(--sel); border-radius: var(--r-surf); background: var(--surface);
}
/* each row takes an exact share of the list (--pub-fit rows), so the list holds whole rows whatever height the column
   leaves it; js/publish.js steps them by the row's measured height */
.pub-tx {
  position: absolute; top: 0; left: 0; right: 0; height: calc((100% + var(--hair)) / var(--pub-fit)); /* the last row's divider falls under the list's own border */
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-12); padding: 0 var(--sp-16);
  border-bottom: var(--hair) solid var(--sel); background: var(--surface); opacity: 0;
}
.pub-av { display: grid; place-items: center; width: var(--sp-32); height: var(--sp-32); border-radius: 50%; background: var(--ground); font-size: var(--fs-meta); font-weight: 600; }
.pub-tx-t { display: grid; min-width: 0; }
.pub-tx-t b { font-size: var(--fs-small); font-weight: 600; }
.pub-tx-t small, .pub-tx-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-tx-t small { font-size: var(--fs-meta); color: var(--muted); }
.pub-tx-r { display: grid; justify-items: end; }
/* no runs yet: the app's empty state (its 3D icon, one line), over the list's fixed height */
.pub-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--sp-8);
  padding: 0 var(--sp-24); text-align: center; color: var(--muted); font-size: var(--fs-small);
}
.pub-empty-ic { width: var(--ic-l); height: var(--ic-l); }
.pub-amt { color: var(--win); font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums; }
.pub-ago { font-size: var(--fs-tiny); color: var(--muted); white-space: nowrap; }

/* reduced motion (js/publish.js draws the end and stops): the rows stack in place, nothing moves */
.pub.is-still .pub-tx { position: static; opacity: 1; transform: none; }
.pub.is-still .pub-ptr { display: none; }
.pub.is-still .pub-empty { display: none; }

@media (max-width: 900px) {
  .pub-stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "app" "pay"; }
  /* stacked, the figure sits under the lede and the list keeps its own height */
  .pub-head { flex-direction: column; gap: var(--sp-24); }
  .pub-total { justify-items: start; text-align: left; }
  .pub-feed { --pub-fit: var(--pub-rows); flex: none; height: calc(var(--pub-rows) * var(--pub-row)); }
}
@media (max-width: 640px) {
  .pub-app { height: var(--pub-frame-phone); padding: var(--sp-12); }
  .pub-bar .pub-chip:nth-child(3) { display: none; }
  .pub-grid { gap: var(--sp-8); }
  .pub-seed { transform: translateX(calc((100% + var(--sp-8)) * var(--shift, 0) * -1)); }
  .pub-rate { display: none; }
  .pub-dlg { top: var(--sp-12); bottom: var(--sp-12); width: calc(100% - 2 * var(--sp-12)); }
  .pub-dlg-top, .pub-dlg-foot { padding: var(--sp-8) var(--sp-12); }
  .pub-dlg-body { padding: var(--sp-8) var(--sp-12); }
  .pub-drop, .pub-saved { display: none; }
  .pub-details { grid-template-columns: minmax(0, 1fr); }
  .pub-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub-cat:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pub-ptr, .pub-dlg, .pub-scrim { display: none; }
  .pub-tx { position: static; opacity: 1; transform: none !important; }
  .pub-new, .pub-chip-new { opacity: 1; transform: none !important; }
  .pub-seed, .pub-publish, .pub-go, .pub-cat { transform: none !important; }
  .pub-saved { transition: none; }
  .pub-empty { display: none; }
}
