/* ==========================================================================
   Comstocks flows (ui-flows), State of Blocks field-manual look in green.
   Trade card, token buy card, run badge, flow sheets, /app/launch, /app/portfolio.
   Loads after tokens.css, base.css, manual.css and shell.css. Composes the manual.css
   primitives (.sheet .kicker .display .lede .btn-m .stamp .exhibit .spec .paper-grid .cross).

   Page hero        .fx-hero (+ .paper-grid) .fx-hero-in .fx-copy .fx-title .fx-stamp .fx-wrap
   Controls         .fx-lbl (mono micro label)  .fx-seg (square segmented)  .fx-note (dashed SOB note)
                    .btn-m.is-loading / [aria-busy] spinner   .fx-btn (full-width .btn-m)
   Trade card       .tp (on .sheet)  .tp-head .tp-field .tp-amount .tp-unit .tp-presets .tp-lev
                    .tp-quote .tp-go .tp-msg .tp-row .tp-follow .tp-share .tp-foot
   Token buy card   .tb  .tb-side .tb-title
   Run badge        .rb  .rb-head .rb-main .rb-value .rb-pnl .rb-sub .rb-acts
   Flow sheets      .fl-confirm .fl-total .fl-legs .fl-leg .fl-rows .fl-row .fl-warn .fl-actions .fl-note
                    .fl-loading .fl-done .fl-share .fl-leglinks .fl-steps .fl-amount .fl-seg .fl-lead
   Portfolio        .pf-*        Launch   .ln-*
   Tap targets: every control is at least 40px tall below 640px.
   ========================================================================== */

/* ================================================================ shared */
.fx-page { display: block; width: 100%; min-width: 0; padding-bottom: 72px; }
.fx-wrap {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter-content));
  margin-inline: auto;
  padding-inline: var(--gutter-content);
  min-width: 0;
}

/* inner-page hero band (SOB /performance, /dashboards) */
.fx-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.fx-hero-in {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  padding-top: 52px;
  padding-bottom: 48px;
}
.fx-copy { min-width: 0; max-width: 680px; }
.fx-title { font-size: clamp(42px, 6.4vw, 60px); line-height: 1.02; }
.fx-copy .lede { max-width: 48ch; }
.fx-stamp { flex: none; margin-left: 4px; }
@media (min-width: 760px) {
  .fx-hero-in { flex-direction: row; justify-content: space-between; gap: 40px; padding-top: 84px; padding-bottom: 78px; }
  .fx-stamp { margin: 44px 12px 0 0; }
}

.fx-lbl {
  display: block;
  font: 500 10px/1.4 var(--mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
}
.fx-sec-gap { margin-top: 48px; }
@media (min-width: 760px) { .fx-sec-gap { margin-top: 64px; } }

/* square segmented control (leverage, exit share, how bold) */
.fx-seg, .tp-seg, .fl-confirm .fl-seg, .ln-form .ln-bold {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 0;
  padding: 0;
  border: 1px solid hsl(var(--ink-c) / .45);
  border-radius: var(--radius);
  background: var(--card);
}
.fx-seg > *, .tp-seg > *, .fl-confirm .fl-seg > *, .ln-form .ln-bold > * {
  --seg-h: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--seg-h);
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-2);
  font: 500 11px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color var(--dur-2), color var(--dur-2);
}
.fx-seg > * + *, .tp-seg > * + *, .fl-confirm .fl-seg > * + *, .ln-form .ln-bold > * + * { border-left: 1px solid hsl(var(--ink-c) / .3); }
.fx-seg > [aria-checked="true"], .tp-seg > [aria-checked="true"], .fl-confirm .fl-seg > [aria-checked="true"], .ln-form .ln-bold > [aria-checked="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.fx-seg > [aria-disabled="true"], .tp-seg > [aria-disabled="true"] { color: var(--muted-2); background: repeating-linear-gradient(135deg, transparent 0 6px, hsl(var(--ink-c) / .06) 6px 7px); cursor: not-allowed; }
@media (hover: hover) {
  .fx-seg > :hover:not([aria-checked="true"]):not([aria-disabled="true"]),
  .fl-confirm .fl-seg > :hover:not([aria-checked="true"]),
  .ln-form .ln-bold > :hover:not([aria-checked="true"]) { background: var(--hover-wash); color: var(--ink); }
}

/* SOB methodology note box: dashed rule, mono kicker, Inter body */
.fx-note {
  position: relative;
  padding: 22px 20px;
  border: 1px dashed hsl(var(--ink-c) / .35);
  background: hsl(var(--paper-c) / .6);
  min-width: 0;
}
@media (min-width: 600px) { .fx-note { padding: 26px 28px; } }
.fx-note .exhibit { margin-bottom: 12px; }
.fx-note p:not(.exhibit) { font: 400 14px/1.65 var(--font); color: var(--ink-2); max-width: 62ch; overflow-wrap: anywhere; }
.fx-note p:not(.exhibit) + p { margin-top: 8px; }
@media (max-width: 479.98px) { .fx-note .fx-note-acts .btn-m { flex: 1 1 100%; } }
.fx-note .fx-note-acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.fx-note a:not(.btn-m) { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

/* .btn-m busy spinner (busy() toggles .is-loading and aria-busy) */
.btn-m { position: relative; }
.btn-m.is-loading, .btn-m[aria-busy="true"] { color: transparent !important; pointer-events: none; opacity: 1 !important; }
.btn-m.is-loading::before, .btn-m[aria-busy="true"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--btn-ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-m .icon { flex: none; }
.fx-btn { display: flex; width: 100%; }
.btn-m-outline:disabled, .btn-m-outline[aria-disabled="true"] { opacity: .5; }
@media (max-width: 639.98px) { .btn-m { min-height: 44px; } .btn-m-sm { min-height: 40px; } }

/* field errors inside flows: a red rule, never a red wall */
.fl-confirm .field-error, .ln-form .field-error, .tp .field-error {
  margin: 0;
  padding-left: 10px;
  border-left: 2px solid var(--red);
  font: 400 13px/1.5 var(--font);
  color: var(--danger-ink);
  overflow-wrap: anywhere;
}

/* ================================================================ trade card */
.sheet.tp, .sheet.tb {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 18px 16px 16px;
  background: var(--paper);
  border: 1px solid hsl(var(--ink-c) / .55);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
}
@media (min-width: 400px) { .sheet.tp, .sheet.tb { padding: 22px 20px 20px; } }
.tp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
  min-width: 0;
}
.tp-head > span { font: 500 10px/1.3 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; white-space: nowrap; }
.tp-head > span:first-child { color: var(--green); }
.tp-head > span:last-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.tp-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tp-field-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 28px; }
.tp-unit {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 70%;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  font: 500 11px/1 var(--mono);
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color var(--dur-1), color var(--dur-1), background-color var(--dur-1);
}
.tp-unit > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tp-unit .icon { flex: none; color: var(--green); }
@media (hover: hover) { .tp-unit:hover { border-color: var(--ink); color: var(--ink); } }
@media (max-width: 639.98px) { .tp-unit, .tp-field-top { min-height: 40px; } }

/* ruled paper amount: faint green rules, ink baseline, big serif figure */
.tp-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px 6px;
  border: 1px solid hsl(var(--ink-c) / .3);
  border-bottom: 2px solid var(--ink);
  border-radius: var(--radius) var(--radius) 0 0;
  background-color: var(--card);
  background-image:
    linear-gradient(to bottom, var(--grid-minor) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-minor) 1px, transparent 1px);
  background-size: 100% 16px, 16px 100%;
  cursor: text;
  transition: border-color var(--dur-2);
}
.tp-amount:focus-within { border-color: var(--ink); border-bottom-color: var(--green); }
.tp-prefix { flex: none; font: 400 30px/1 var(--serif); color: var(--muted); }
.tp-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 400 44px/52px var(--serif);
  letter-spacing: -0.01em;
}
.tp-input::placeholder { color: var(--muted-2); }
.tp-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tp-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 32px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  font: 500 11px/1 var(--mono);
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--dur-1), background-color var(--dur-1), color var(--dur-1);
}
.tp-preset[aria-pressed="true"] { border-color: var(--green); color: var(--green); background: var(--accent-wash); }
@media (hover: hover) { .tp-preset:hover:not([aria-pressed="true"]) { border-color: var(--ink); color: var(--ink); } }
@media (max-width: 639.98px) { .tp-preset { height: 40px; } }

.tp-lev { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* quote ledger (.spec look) */
.tp-quote { margin: 0; border-top: 1px solid var(--border); }
.tp-quote > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.tp-quote dt { flex: none; font: 500 10px/1.4 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.tp-quote dd { margin: 0; min-width: 0; text-align: right; font: 400 12px/1.4 var(--mono); color: var(--ink); overflow-wrap: anywhere; }

.tp-go { width: 100%; padding: 0 16px; }
.tp-go .icon { margin-left: 2px; }
.tp-msg {
  margin: -6px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--red);
  font: 400 12.5px/1.5 var(--font);
  color: var(--danger-ink);
  overflow-wrap: anywhere;
}
.tp-msg[data-tone="muted"] { border-left-color: var(--border-strong); color: var(--muted); }
.tp-row { display: flex; gap: 8px; min-width: 0; }
.tp-follow { flex: 1 1 auto; min-width: 0; padding: 0 12px; }
.tp-follow > span { overflow: hidden; text-overflow: ellipsis; }
.tp-follow[aria-pressed="true"] { --btn-ink: var(--green); --btn-border: var(--green); background: var(--accent-wash); }
.tp-share { flex: none; width: 46px; padding: 0; }
.tp-foot {
  margin: 0;
  padding-top: 12px;
  border-top: 1px dotted hsl(var(--ink-c) / .35);
  font: 500 10px/1.6 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- token buy */
.tb-title { display: flex; align-items: center; gap: 10px; margin: 0; font: 400 24px/1.15 var(--serif); color: var(--ink); }
.tb-title .icon { flex: none; color: var(--green); }
.tb .tp-quote { margin: 0; }

/* ---------------------------------------------------------------- run badge */
.sheet.rb {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid hsl(var(--ink-c) / .55);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard-sm);
}
@media (min-width: 400px) { .sheet.rb { padding: 18px 20px; } }
.rb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.rb-head .fx-lbl { color: var(--green); }
.rb-link { display: inline-flex; align-items: center; gap: 6px; font: 500 10px/1 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-2); }
@media (hover: hover) { .rb-link:hover { color: var(--green); } }
@media (max-width: 639.98px) {
  .rb-head { min-height: 40px; }
  .rb-link { min-height: 40px; padding-left: 12px; }
}
.rb-main { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; min-width: 0; }
.rb-value { font: 400 32px/1.05 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
.rb-pnl { font: 500 12px/1.4 var(--mono); }
.rb-sub { margin: 0; font: 500 10px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.rb-acts { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.rb-acts .btn-m { flex: 1 1 auto; padding: 0 12px; letter-spacing: .14em; }

/* ================================================================ flow sheets */
.fl-confirm { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fl-lead { margin: 0; font: 400 14px/1.6 var(--font); color: var(--ink-2); overflow-wrap: anywhere; }
.fl-loading { display: flex; align-items: center; gap: 12px; min-height: 64px; color: var(--muted); font: 500 11px/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.fl-total {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  min-width: 0;
  background-color: var(--card);
  background-image: linear-gradient(to bottom, var(--grid-minor) 1px, transparent 1px);
  background-size: 100% 16px;
  border: 1px solid hsl(var(--ink-c) / .3);
  border-bottom: 2px solid var(--ink);
  border-radius: var(--radius) var(--radius) 0 0;
}
.fl-total .label-sm, .fl-total .fx-lbl { font: 500 10px/1.4 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--green); }
.fl-total-amt { font: 400 34px/1.05 var(--serif); color: var(--ink); overflow-wrap: anywhere; max-width: 100%; }
.fl-total-amt.mono { font-family: var(--serif); }
.fl-total-amt.is-name { font-size: 26px; line-height: 1.15; }
.fl-total-sub { font: 400 12px/1.4 var(--mono); color: var(--muted); min-height: 16px; overflow-wrap: anywhere; max-width: 100%; }
.fl-legs { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--paper); }
.fl-leg { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-width: 0; }
.fl-leg + .fl-leg { border-top: 1px solid var(--border); }
.fl-leg-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.fl-leg-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fl-leg-sym { font: 600 14px/18px var(--font); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fl-leg-w { font: 400 11px/16px var(--mono); color: var(--green); white-space: nowrap; }
.fl-leg-sub { font: 400 12px/16px var(--font); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fl-leg-sub.mono { font: 400 11px/16px var(--mono); }
.fl-leg-out { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 1 auto; min-width: 0; max-width: 50%; text-align: right; }
.fl-leg-est { font: 500 13px/18px var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fl-leg-out > * { max-width: 100%; }
.fl-leg-main > * { max-width: 100%; }
.fl-leg-state { font: 500 11px/16px var(--mono); color: var(--muted); }
.fl-leg-btn { flex: none; min-width: 108px; padding: 0 12px; }
.fl-leg-btn[data-done] { --btn-ink: var(--green); --btn-border: var(--green); opacity: 1; }
.fl-empty { padding: 14px; color: var(--muted); font: 400 14px/20px var(--font); }
.fl-rows { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.fl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.fl-row dt { flex: none; font: 500 10px/1.5 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.fl-row dd { margin: 0; min-width: 0; text-align: right; font: 400 12.5px/1.45 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.fl-row .mono { font-family: var(--mono); }
.fl-warn { display: flex; gap: 10px; padding: 12px 14px; border: 1px dashed hsl(var(--red-c) / .55); background: var(--down-wash); border-radius: var(--radius); color: var(--ink-2); font: 400 13px/1.55 var(--font); }
.fl-warn .icon { flex: none; margin-top: 3px; color: var(--down-ink); }
.fl-warn p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.fl-warn strong { color: var(--ink); font-weight: 600; }
.fl-actions { display: flex; flex-direction: column; gap: 12px; }
.fl-actions .btn-m { width: 100%; }
.fl-note { margin: 0; font: 500 10px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.fl-amount { width: 100%; }
.fl-amount-conv { flex: none; font: 400 12px/16px var(--mono); color: var(--muted); white-space: nowrap; align-self: center; }
.fl-help { margin: -8px 0 0; font: 400 11px/1.4 var(--mono); color: var(--muted); }

/* receipt: a TRANSMISSION note with a red stamp */
.fl-done { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; padding-top: 4px; min-width: 0; }
.fl-done .kicker { margin: 0 0 4px; }
.fl-done-title { margin: 0; padding-right: 96px; font: 400 34px/1.05 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
.fl-done-title .dot { color: var(--red); }
.fl-done-stamp { position: absolute; top: 34px; right: 2px; font-size: 10px; padding: 5px 9px; }
.fl-done-line { margin: 0; font: 400 14px/1.55 var(--font); color: var(--ink-2); overflow-wrap: anywhere; }
.fl-done-line .fx-tx { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font: 500 11px/1 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--green); }
@media (hover: hover) { .fl-done-line .fx-tx:hover { text-decoration: underline; text-underline-offset: 4px; } }
.fl-done-line .fx-tx:focus-visible { outline: 2px solid var(--ring, var(--green)); outline-offset: 3px; }
.fl-done-line .fx-tx:focus:not(:focus-visible) { outline: none; }
.fl-done .fl-actions { width: 100%; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border); }

.fl-share { display: flex; flex-direction: column; gap: 10px; }
.fl-share-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: transparent; font: 500 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink); transition: border-color var(--dur-2), background-color var(--dur-2); }
@media (hover: hover) { .fl-share-opt:hover { border-color: var(--ink); background: var(--hover-wash); } }
.fl-share-opt .icon { color: var(--green); }
.fl-leglinks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.fl-leglinks li + li { border-top: 1px solid var(--border); }
.fl-leglink { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; min-width: 0; transition: background-color var(--dur-2); }
@media (hover: hover) { .fl-leglink:hover { background: var(--hover-wash); } }
.fl-leglink-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.fl-leglink-sym { font: 600 14px/18px var(--font); color: var(--ink); }
.fl-leglink-name { font: 400 12px/16px var(--font); color: var(--muted); }
.fl-leglink-w { font: 400 11px/16px var(--mono); color: var(--green); }
.fl-leglink > .icon { color: var(--muted); }
.fl-steps { margin: 0; padding: 0 0 0 20px; color: var(--ink-2); font: 400 12px/1.8 var(--mono); }
.fl-steps li.is-done { color: var(--green); }

/* ================================================================ portfolio */
.pf-stats { margin-top: 40px; }
.pf-stats.stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--paper); box-shadow: var(--shadow-hard); border-color: hsl(var(--ink-c) / .55); }
.pf-stats .value { display: block; font-size: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-stats .value.t-down { color: var(--down); }
.pf-stats .sub { display: block; margin-top: 8px; font: 500 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 759.98px) {
  .pf-stats.stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-stats.stat-strip > :nth-child(3) { border-left: 0; }
  .pf-stats.stat-strip > :nth-child(n+3) { border-top: 1px solid var(--border-strong); }
  .pf-stats .value { font-size: 26px; }
}
@media (max-width: 359.98px) {
  .pf-stats.stat-strip { grid-template-columns: minmax(0, 1fr); }
  .pf-stats.stat-strip > * + * { border-left: 0; border-top: 1px solid var(--border-strong); }
}

.pf-signin { margin-top: 40px; }
.pf-signin .fx-note-acts .btn-m { min-width: 180px; }
.pf-block { margin-top: 48px; min-width: 0; }
@media (min-width: 760px) { .pf-block { margin-top: 64px; } }
.pf-block > .exhibit .pf-count { color: var(--muted); }

/* the run ledger */
.pf-ledger { min-width: 0; overflow: hidden; }
.pf-ledger-head {
  display: none;
  grid-template-columns: minmax(0, 1fr) 140px 160px 120px;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ink);
  background: hsl(var(--paper-2-c) / .6);
}
.pf-ledger-head > span { font: 500 10px/1.4 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.pf-ledger-head > span:not(:first-child) { text-align: right; }
@media (min-width: 880px) { .pf-ledger-head { display: grid; } }
.pf-run { padding: 18px 16px; scroll-margin-top: 120px; min-width: 0; }
@media (min-width: 600px) { .pf-run { padding: 20px; } }
.pf-run + .pf-run { border-top: 1px solid var(--border-strong); }
.pf-run:target { box-shadow: inset 3px 0 0 var(--green); }
.pf-run-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; }
@media (min-width: 880px) { .pf-run-row { grid-template-columns: minmax(0, 1fr) 140px 160px 120px; gap: 16px; } }
.pf-run-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 48px; min-width: 0; color: inherit; }
.pf-run-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pf-run-name { font: 400 22px/1.15 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
@media (hover: hover) { .pf-run-head:hover .pf-run-name { color: var(--green); } }
.pf-run-meta { font: 500 10px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pf-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border); min-width: 0; }
.pf-cell { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; min-width: 0; }
.pf-cell + .pf-cell { border-left: 1px solid var(--border); }
.pf-cell .fx-lbl { font-size: 9px; letter-spacing: .16em; }
.pf-cell-v { font: 400 13px/1.3 var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-cell-v.is-big { font: 400 20px/1.1 var(--serif); }
@media (min-width: 880px) {
  .pf-cells { display: contents; }
  .pf-cell { padding: 0; align-items: flex-end; text-align: right; }
  .pf-cell + .pf-cell { border-left: 0; }
  .pf-cell .fx-lbl { display: none; }
  .pf-cell-v { font-size: 13px; max-width: 100%; }
  .pf-cell-v.is-big { font-size: 22px; }
}
.pf-legs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 28px; margin-top: 16px; padding-top: 14px; border-top: 1px dotted hsl(var(--ink-c) / .3); }
@media (min-width: 720px) { .pf-legs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pf-leg { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; column-gap: 8px; row-gap: 6px; min-width: 0; }
.pf-leg-sym { font: 600 13px/18px var(--font); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-leg-w { font: 400 11.5px/16px var(--mono); color: var(--ink-2); white-space: nowrap; }
.pf-leg-w .t-muted { color: var(--muted); }
.pf-leg-w b { font-weight: 500; color: var(--ink); }
.pf-leg.is-drift .pf-leg-w b { color: var(--danger-ink); }
.pf-bar { grid-column: 1 / -1; position: relative; height: 6px; background: hsl(var(--ink-c) / .08); border: 1px solid var(--border); }
.pf-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); max-width: 100%; }
.pf-leg.is-drift .pf-bar > i { background: var(--red); }
.pf-bar > b { position: absolute; top: -4px; width: 2px; height: 12px; margin-left: -1px; background: var(--ink); }
.pf-run-foot { margin: 14px 0 0; font: 500 10px/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.pf-run-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.pf-run-actions .btn-m { width: 100%; padding: 0 10px; letter-spacing: .14em; }
@media (min-width: 720px) {
  .pf-run-actions { display: flex; flex-wrap: wrap; }
  .pf-run-actions .btn-m { width: auto; padding: 0 16px; }
}
.pf-skel { height: 132px; border-radius: var(--radius); }
.pf-skel + .pf-skel { margin-top: 1px; }
.pf-ledger > .pf-empty-note { border: 0; }

/* following + launched lists: ruled rows */
.pf-list { min-width: 0; overflow: hidden; }
.pf-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 16px; min-height: 68px; color: inherit; transition: background-color var(--dur-row) var(--ease-out); }
@media (min-width: 600px) { .pf-row { padding: 12px 20px; } }
.pf-row + .pf-row { border-top: 1px solid var(--border); }
@media (hover: hover) { a.pf-row:hover { background: var(--hover-wash); } a.pf-row:hover .pf-row-name { color: var(--green); } }
.pf-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pf-row-name { font: 400 20px/1.15 var(--serif); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--dur-2); }
.pf-row-sub { font: 500 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-row-ret { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; min-width: 0; }
.pf-row-ret-v { font: 400 15px/1.2 var(--mono); white-space: nowrap; }
.pf-row-ret .label-xs { font: 500 9px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pf-empty { margin: 0; padding: 20px 16px; font: 400 14px/1.6 var(--font); color: var(--ink-2); }
@media (min-width: 600px) { .pf-empty { padding: 22px 20px; } }
.pf-empty a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.pf-cover { border: 1px solid hsl(var(--ink-c) / .35); border-radius: 0; background: var(--paper-2); }

.pf-earn { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; padding: 18px 16px; }
@media (min-width: 600px) { .pf-earn { padding: 22px 20px; } }
.pf-earn-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-earn-v { font: 400 36px/1.05 var(--serif); color: var(--green); overflow-wrap: anywhere; }
.pf-earn-sub { font: 400 13px/1.5 var(--font); color: var(--ink-2); max-width: 44ch; }
.pf-earn .btn-m { flex: none; }
@media (max-width: 479.98px) { .pf-earn .btn-m { width: 100%; } }
.pf-mine { border-top: 1px solid var(--border-strong); }
.pf-gen { display: inline-flex; align-items: center; justify-content: center; background: var(--paper-2); }

/* ================================================================ launch */
.ln-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: 40px; align-items: start; }
@media (min-width: 960px) {
  .ln-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 48px; margin-top: 64px; }
  .ln-aside { position: sticky; top: calc(var(--header-h) + 24px); }
}

.ln-form.sheet { padding: 0; min-width: 0; }
.ln-sec { position: relative; padding: 22px 16px 24px; min-width: 0; }
@media (min-width: 600px) { .ln-sec { padding: 28px 28px 30px; } }
.ln-sec + .ln-sec { border-top: 1px solid var(--border-strong); }
.ln-sec-no { position: absolute; top: 14px; right: 16px; font: italic 400 40px/1 var(--serif); color: hsl(var(--ink-c) / .14); pointer-events: none; user-select: none; }
@media (min-width: 600px) { .ln-sec-no { top: 18px; right: 26px; font-size: 48px; } }
.ln-sec-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; padding-right: 56px; min-width: 0; }
.ln-sec-head .exhibit { margin: 0; }
.ln-sec-title { margin: 0; font: 400 26px/1.12 var(--serif); color: var(--ink); }
.ln-sec-sub { margin: 0; font: 400 14px/1.55 var(--font); color: var(--ink-2); }

.ln-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; position: relative; }
.ln-field + .ln-field { margin-top: 18px; }
.ln-label { font: 500 10px/1.4 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-2); }
.ln-input, .ln-textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid hsl(var(--ink-c) / .3);
  border-bottom: 2px solid var(--ink);
  border-radius: var(--radius) var(--radius) 0 0;
  background-color: var(--card);
  color: var(--ink);
  outline: 0;
  transition: border-color var(--dur-2);
}
.ln-input { height: 52px; font: 400 24px/1.2 var(--serif); }
.ln-textarea {
  min-height: 132px;
  resize: vertical;
  font: 400 16px/24px var(--font);
  background-image: linear-gradient(to bottom, transparent 23px, var(--grid-major) 23px, var(--grid-major) 24px);
  background-size: 100% 24px;
  background-position: 0 10px;
  background-attachment: local;
}
.ln-input::placeholder, .ln-textarea::placeholder { color: var(--muted-2); }
.ln-input:focus, .ln-textarea:focus { border-color: var(--ink); border-bottom-color: var(--green); }
.ln-input.is-invalid, .ln-textarea.is-invalid { border-bottom-color: var(--red); }
.ln-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 16px; }
.ln-meta .field-error { min-width: 0; }
.ln-count { flex: none; margin-left: auto; font: 400 11px/16px var(--mono); color: var(--muted); }
.ln-count.is-over { color: var(--danger-ink); }
.ln-slug { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 10px 12px; border: 1px dashed hsl(var(--ink-c) / .35); min-width: 0; }
.ln-slug-url { font: 400 12px/16px var(--mono); color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.ln-slug-url b { color: var(--ink); font-weight: 500; }
.ln-slug-state { display: inline-flex; align-items: center; gap: 6px; font: 500 10px/16px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.ln-slug-state[data-tone="ok"] { color: var(--green); }
.ln-slug-state[data-tone="bad"] { color: var(--danger-ink); }

.ln-picker { position: relative; }
.ln-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 12px;
  border: 1px solid hsl(var(--ink-c) / .45);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted);
  cursor: text;
  transition: border-color var(--dur-2);
}
.ln-search:focus-within { border-color: var(--ink); }
.ln-search input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 16px/1 var(--font); }
.ln-search input::placeholder { color: var(--muted-2); }
/* in the flow, never a popover: it pushes the form down instead of covering anything */
.ln-results { margin-top: 6px; border: 1px solid var(--ink); background: var(--paper); box-shadow: var(--shadow-hard-sm); }
.ln-result { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 12px; border: 0; background: transparent; text-align: left; }
.ln-result + .ln-result { border-top: 1px solid var(--border); }
.ln-result[aria-selected="true"], .ln-result:focus-visible { background: var(--paper-2); outline: none; box-shadow: inset 3px 0 0 var(--green); }
@media (hover: hover) { .ln-result:hover { background: var(--paper-2); } }
.ln-result-main { display: flex; flex-direction: column; min-width: 0; }
.ln-result-sym { font: 600 13px/17px var(--font); color: var(--ink); }
.ln-result-name { font: 400 12px/16px var(--font); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-result-px { font: 400 12px/16px var(--mono); color: var(--ink-2); white-space: nowrap; }
.ln-result-none { margin: 0; padding: 12px; font: 400 13px/18px var(--font); color: var(--muted); }

.ln-legs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--border-strong); }
.ln-legs:empty { display: none; }
.ln-leg { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 4px 6px 12px; min-height: 54px; }
.ln-leg + .ln-leg { border-top: 1px solid var(--border); }
.ln-leg-main { display: flex; flex-direction: column; min-width: 0; }
.ln-leg-sym { font: 600 13px/17px var(--font); color: var(--ink); }
.ln-leg-name { font: 400 12px/16px var(--font); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-w { display: flex; align-items: center; gap: 2px; width: 80px; height: 42px; padding: 0 8px; border: 1px solid hsl(var(--ink-c) / .35); border-radius: var(--radius); background: var(--card); }
.ln-w input { width: 100%; min-width: 0; height: 100%; padding: 0; background: transparent; border: 0; outline: 0; text-align: right; font: 500 16px/1 var(--mono); color: var(--ink); }
.ln-w span { font: 400 12px/16px var(--mono); color: var(--muted); }
.ln-w.is-static { border-color: transparent; background: transparent; }
.ln-w.is-static input { font-size: 13px; color: var(--green); }
.ln-w:focus-within { border-color: var(--ink); }
.ln-rm { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); }
@media (hover: hover) { .ln-rm:hover { background: var(--hover-wash); color: var(--red); } }
.ln-legs-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-width: 0; }
.ln-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font: 500 10px/1.4 var(--mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-2); cursor: pointer; user-select: none; }
.ln-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ln-switch i { position: relative; width: 34px; height: 18px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--card); transition: background-color var(--dur-2); flex: none; }
.ln-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: var(--ink-2); transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2); }
.ln-switch input:checked + i { background: var(--green); }
.ln-switch input:checked + i::after { transform: translateX(16px); background: var(--paper); }
.ln-switch input:focus-visible + i { outline: 2px solid var(--ring); outline-offset: 2px; }
.ln-total { font: 400 11px/16px var(--mono); color: var(--muted); }
.ln-total[data-tone="bad"] { color: var(--danger-ink); }
.ln-total[data-tone="ok"] { color: var(--green); }
.ln-bold-help { margin: 0; font: 400 13px/1.55 var(--font); color: var(--ink-2); }

.ln-submit { display: flex; flex-direction: column; gap: 12px; padding: 22px 16px 24px; border-top: 1px solid var(--ink); background: hsl(var(--paper-2-c) / .5); }
@media (min-width: 600px) { .ln-submit { padding: 26px 28px 28px; } }
.ln-go { width: 100%; }
.ln-fine { margin: 0; font: 500 10px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* live preview plate */
.ln-aside { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.ln-preview { position: relative; padding: 10px 10px 0; min-width: 0; }
.ln-preview-img { position: relative; height: 112px; overflow: hidden; border: 1px solid hsl(var(--ink-c) / .35); background: var(--green-deep); }
.ln-preview-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }
.ln-preview-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 8px 14px; min-width: 0; }
.ln-preview-name { margin: 0; font: 400 28px/1.1 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
.ln-preview-name.is-empty { color: var(--muted); font-style: italic; }
.ln-preview-url { font: 400 11px/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.ln-preview-idea { margin: 0; font: 400 13.5px/1.6 var(--font); color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ln-preview-idea.is-empty { color: var(--muted); font-style: italic; }
.ln-preview-legs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.ln-preview-legs:empty { display: none; }
.ln-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 4px; border: 1px solid var(--border-strong); font: 500 11px/1 var(--mono); color: var(--ink); white-space: nowrap; }
.ln-chip i { font-style: normal; color: var(--green); }
.ln-preview-stamp { position: absolute; top: 24px; right: 22px; background: hsl(var(--paper-c) / .9); }
.ln-preview figcaption { border-top: 1px solid var(--border); margin: 0 -10px; padding: 10px 12px 11px; }

.ln-chart { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-top: 12px; border-top: 1px dotted hsl(var(--ink-c) / .3); }
.ln-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ln-chart-ret { font: 400 13px/1.3 var(--mono); }
.ln-chart-box { position: relative; height: 120px; min-width: 0; border: 1px solid var(--border); overflow: hidden; background: var(--card); }
.ln-chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 12px; text-align: center; font: 500 10px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.ln-fees .spec { background: var(--paper); }
.ln-fees .spec dd { color: var(--green); }
.ln-fees-copy { margin: 12px 0 0; font: 400 13px/1.6 var(--font); color: var(--ink-2); }
.ln-small { margin: 40px 0 0; max-width: 760px; font: 400 12px/1.65 var(--font); color: var(--muted); }

@media (max-width: 359.98px) {
  .ln-leg { grid-template-columns: 22px minmax(0, 1fr) auto; padding-right: 4px; }
  .ln-leg .ln-rm { grid-column: 3; grid-row: 1; }
  .ln-leg .ln-w { grid-column: 2 / 4; grid-row: 2; justify-self: start; margin-bottom: 4px; }
  .ln-input { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-m.is-loading::before, .btn-m[aria-busy="true"]::before { animation-duration: 1.4s; }
}
