/* THE PLAN IN OUR BRAND (Steven 2026-10-13 night, his screenshot of the
   Refined plan on Sam's song, a plain white numbered list: "If I hit the
   Review button on the Refined plan card, it should land on the plan. Can
   you use our design styling to improve this plan look? How can you improve
   it with our brand?").

   Same words, same money, same doors; only the look. Markup: templates/feed/
   _proposal_cards.html (plan_list, plan_money, plan_foot, plan_steps and the
   plan sheet #plan-<id>); wiring static/cards/proposal-cards.js. The frame,
   the kicker row and the pinned foot are the sheet language (css/pages/
   step-cards.css .sl-*, walk mock 107); this file is what the plan adds:

     .psheet      the plan sheet's frame (.sl-sheet), the card's width, the
                  kicker row and the foot pinned, the middle scrolling
       .psheet__agent  the agent's row: its moving round, name, "with <mark>
                       <model>", so the plan reads as that agent's
     .ptl         THE TIMELINE: a brand purple rail down the left, one node
                  per step; the deal's signing (dark, the handshake), the
                  person's (yellow, a YOU tag by the title), the agent's (a
                  purple ring round its tiny round), the finish line (dark,
                  the yellow target); a step that pays wears the neon ring
       .ptl__line      the title in the heading face, in full up to two
                       lines, nothing to tap (Steven 2026-10-18)
       .ptl__mark      the money at the right: a release's amount in the
                       green highlighter over "pay when you approve" in
                       small mono; the held amount over "held" in purple
     .preceipt    THE RECEIPT STRIP: the three lines in mono between two
                  perforated rules, dotted leaders, the Total bold; the two
                  money lines under it in the quiet text
     .pfoot       the 107 foot (.sl-foot__go, __change, __fail) in a page's
                  own flow; .pfoot--pinned is the sheet's .sl-foot
     .psteps      the plan's steps in a page's flow (under the plan card,
                  in the /home deck's Details sheet)

   Tokens only (static/css/tokens.css; app/tests/test_layout_cards_proposal_
   cards.py reads this file with test_card_tokens' checks). Inside the
   want page's .boh-interface the interface standards point every font
   token at the system face; the plan points them back at their :root
   values, as the sheet language does, so the caps are mono and the titles
   the heading face. */

.psheet, .psteps {
  --font-body: var(--font-sans);
  --font-heading: var(--auth-title-font);
  --font-mono: var(--topbar-pill-font);
  --ptl-node: var(--size-8);
  --ptl-pad: var(--space-3);
  --ptl-rail: var(--tb-brand-purple);
  --ptl-you: var(--highlight-yellow);
  --ptl-pay: var(--accent-neon);
  --ptl-night: var(--color-dark-900);
}
.psteps { font-family: var(--font-body) !important; }
.psteps * { font-family: inherit !important; }

/* ── The sheet ─────────────────────────────────────────────────────────── */
/* The frame sits on the bottom of the screen inside the sheet's fixed
   layer (.sc-sheet: the scrim, Escape, the live refresh's wait). */
.pcards-sheet .psheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin: 0 auto;
  animation: psheet-up .28s cubic-bezier(.2, .7, .2, 1);
}
@keyframes psheet-up { from { translate: 0 var(--space-10); opacity: .4; } to { translate: 0 0; opacity: 1; } }
.psheet__head {
  flex: none;
  margin: 0;
  padding: var(--space-3) var(--space-5) var(--space-2);
  box-shadow: 0 1px 0 var(--border-default);
}
.psheet__scroll { padding-top: var(--space-4); }

/* The agent's row: the plan reads as that agent's. */
.psheet__agent { display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-4); }
.psheet__round {
  flex: none; display: block; overflow: hidden;
  width: var(--size-14); height: var(--size-14);
  border-radius: var(--radius-full);
  background: var(--ptl-night);
  box-shadow: 0 0 0 2px var(--surface-primary), 0 0 0 4px var(--tb-brand-purple);
}
.psheet__round > *, .psheet__round svg, .psheet__round img, .psheet__round video {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
.psheet__who { min-width: 0; }
.psheet .psheet__name {
  margin: 0;
  font: var(--font-bold) var(--text-lg)/var(--leading-snug) var(--font-heading);
  font-family: var(--font-heading) !important;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.psheet .psheet__model {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--space-1);
  margin: 0;
  font: var(--font-medium) var(--text-sm)/var(--leading-snug) var(--font-mono);
  font-family: var(--font-mono) !important;
  color: var(--text-secondary);
}
.psheet__mark { flex: none; width: 1em; height: 1em; font-size: var(--text-base); color: var(--text-primary); }
.psheet .psheet__title {
  margin: 0 0 var(--space-1);
  font: var(--font-bold) var(--text-2xl)/var(--leading-tight) var(--font-heading);
  font-family: var(--font-heading) !important;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.psheet .psheet__count { margin-top: var(--space-4); }

/* ── The timeline ──────────────────────────────────────────────────────── */
.ptl { position: relative; margin: 0; padding: 0; list-style: none; }
.ptl__step {
  position: relative;
  display: grid; grid-template-columns: var(--ptl-node) minmax(0, 1fr) auto;
  column-gap: var(--space-3); align-items: start;
  margin: 0; padding: var(--ptl-pad) 0;
}
/* The rail: each step draws its piece, its node's centre to the next's, so
   an opened title never breaks it. */
.ptl__step:not(:last-child)::before {
  content: "";
  position: absolute; z-index: 0;
  left: calc(var(--ptl-node) / 2 - 1px); width: 2px;
  top: calc(var(--ptl-pad) + var(--ptl-node) / 2);
  bottom: calc(-1 * (var(--ptl-pad) + var(--ptl-node) / 2));
  background: var(--ptl-rail);
}
.ptl__node {
  position: relative; z-index: 1;
  display: grid; place-items: center; overflow: hidden;
  width: var(--ptl-node); height: var(--ptl-node);
  border-radius: var(--radius-full);
  background: var(--surface-primary); color: var(--color-black);
  box-shadow: 0 0 0 2px var(--ptl-rail);
  font-size: var(--text-base);
}
.ptl__node iconify-icon { display: block; width: 1.05em; height: 1.05em; font-size: var(--text-base); }
.ptl__node img, .ptl__node svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.ptl__step--deal .ptl__node,
.ptl__step--finish .ptl__node { background: var(--ptl-night); color: var(--color-white); }
.ptl__step--finish .ptl__node { color: var(--ptl-you); }
.ptl__step--you .ptl__node { background: var(--ptl-you); box-shadow: 0 0 0 2px var(--ptl-you); }
.ptl__step--agent .ptl__node { background: var(--ptl-night); }
/* A step that pays: its node ringed in the neon green, a breath of white
   between, so the pay points read at a glance. */
.ptl__step--release .ptl__node { box-shadow: 0 0 0 2px var(--surface-primary), 0 0 0 5px var(--ptl-pay); }
/* A row with no money mark gives the mark's empty column (and its gap) back
   to the title (2026-10-18): 12 px more per line on a phone, the room the
   two-line cap was measured in (app/services/step_title_cap.py). */
.ptl__step:not(:has(> .ptl__mark)) { grid-template-columns: var(--ptl-node) minmax(0, 1fr); }

/* THE TITLE, IN FULL UP TO TWO LINES (Steven 2026-10-18, his shot of the
   Refined plan: three titles cut to one line behind a tap, one tapped open
   on two: "I DON'T LIKE HOW YOU HAVE TO CLICK TO SEE THE REST OF THE
   SENTENCE, AND IT'S NEVER THAT MUCH MORE. JUST SET A MAX NUMBER OF
   CHARACTERS. TWO LINES IS FINE."). The heading face, wrapping onto a
   second line and clamped there, nothing to tap. The cap is at the source
   (app/services/step_title_cap.py, 64 characters: two lines of this row on
   a 390 px phone), so a title filed today ends inside the two lines; a
   longer one stored before the cap is clamped. */
.ptl__line {
  display: flex; align-items: baseline; gap: var(--space-2);
  width: 100%; min-width: 0; min-height: var(--ptl-node);
  margin: 0; padding: var(--space-1) 0;
  border: 0; border-radius: var(--radius-sm); background: none; color: inherit;
  text-align: left; cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.ptl__line:focus-visible { outline: 2px solid var(--interactive-focus-ring); outline-offset: 2px; }
.ptl .ptl__num {
  flex: none;
  font: var(--font-semibold) var(--text-xs)/1 var(--font-mono);
  font-family: var(--font-mono) !important;
  letter-spacing: .04em; color: var(--tb-meta);
}
.ptl .ptl__you {
  flex: none;
  padding: calc(var(--space-1) / 2) var(--space-1);
  border-radius: var(--radius-xs);
  background: var(--ptl-you); color: var(--color-black);
  font: var(--font-bold) var(--text-xs)/1 var(--font-mono);
  font-family: var(--font-mono) !important;
  letter-spacing: .08em; text-transform: uppercase;
}
.ptl .ptl__agent {
  /* the agent's NAME on its steps, quiet: the same box as You, no yellow,
     the card's own strong border as a ring, one line, cut at 12 characters */
  flex: none; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: calc(var(--space-1) / 2) var(--space-1);
  border-radius: var(--radius-xs);
  background: none; color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  font: var(--font-bold) var(--text-xs)/1 var(--font-mono);
  font-family: var(--font-mono) !important;
  letter-spacing: .08em; text-transform: uppercase;
}
.ptl .ptl__title {
  flex: 1 1 auto; min-width: 0;
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; white-space: normal; overflow-wrap: anywhere;
  font: var(--font-semibold) var(--text-base)/var(--leading-snug) var(--font-heading);
  font-family: var(--font-heading) !important;
  color: var(--text-primary);
}
.ptl__step--deal .ptl__title, .ptl__step--finish .ptl__title { font-weight: var(--font-bold); }

/* The money at the right. */
.ptl__mark {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  min-height: var(--ptl-node); max-width: 8.5em;
  text-align: right;
}
.ptl .ptl__amt {
  font: var(--font-bold) var(--text-lg)/var(--leading-tight) var(--font-heading);
  font-family: var(--font-heading) !important;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--text-primary);
}
.ptl__mark--release .ptl__amt {
  padding: calc(var(--space-1) / 2) var(--space-1);
  border-radius: var(--radius-sm);
  background: var(--ptl-pay); color: var(--color-black);
}
.ptl .ptl__when {
  margin-top: calc(var(--space-1) / 2);
  font: var(--font-medium) var(--text-xs)/var(--leading-snug) var(--font-mono);
  font-family: var(--font-mono) !important;
  color: var(--tb-meta);
}
.ptl__mark--held .ptl__when { color: var(--tb-brand-purple); letter-spacing: .08em; text-transform: uppercase; }

/* THE OPEN TIMELINE, the checkout's plan (Steven 2026-10-14 ~12:55: "this
   needs to match the proposal page, it was more advanced"; templates/
   targets/_checkout.html, plan_list(lines, open=true)): every title in
   full, no tap to unfold; under the title, whose part and how long; on a
   pay point the small neon "$" on the node's corner (Steven, 76655f727:
   "just add a small button on the number that shows a $ so we know that
   is a pay point"); a step that pays nothing reads "$0" in the quiet text.
   The node keeps its colour; the "$" sits outside its clip. Its titles
   are never clamped: a checkout is read before it is bought. */
.ptl--open .ptl__title { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
.ptl__part {
  grid-column: 2;
  margin: 0;
  font: var(--font-normal) var(--text-sm)/var(--leading-snug) var(--font-body);
  color: var(--text-secondary);
}
.ptl__dollar {
  position: absolute; z-index: 2;
  top: calc(var(--ptl-pad) - var(--space-1));
  left: calc(var(--ptl-node) - var(--space-3));
  display: inline-grid; place-items: center;
  width: var(--size-4); height: var(--size-4);
  border: 1px solid var(--surface-primary); border-radius: var(--radius-full);
  background: var(--ptl-pay); color: var(--color-black);
  font: var(--font-bold) var(--text-xs)/1 var(--font-body);
}
.ptl__mark--zero .ptl__amt { font-weight: var(--font-medium); color: var(--text-muted); }

/* ── The receipt strip ─────────────────────────────────────────────────── */
.preceipt { margin: var(--space-5) 0 0; }
.preceipt__lines {
  margin: 0; padding: var(--space-3) 0;
  border-top: 2px dashed var(--border-strong);
  border-bottom: 2px dashed var(--border-strong);
}
.preceipt .preceipt__row {
  display: flex; align-items: baseline; gap: var(--space-2);
  padding: var(--space-1) 0;
  font: var(--font-medium) var(--text-sm)/var(--leading-snug) var(--font-mono);
  font-family: var(--font-mono) !important;
  color: var(--text-secondary);
}
.preceipt__row dt, .preceipt__row dd { margin: 0; }
/* the dotted leader between the words and the amount */
.preceipt__row::before {
  content: ""; order: 1; flex: 1 1 var(--space-4); align-self: center;
  border-bottom: 2px dotted var(--border-default);
}
.preceipt__row dd { order: 2; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.preceipt .preceipt__row--total {
  margin-top: var(--space-1); padding-top: var(--space-2);
  border-top: 1px solid var(--border-default);
  font-weight: var(--font-bold); font-size: var(--text-lg);
  color: var(--text-primary);
}
.preceipt__row--total::before { border-bottom-color: transparent; }
.preceipt .preceipt__pct {
  margin-left: var(--space-1);
  padding: 0 var(--space-1);
  border-radius: var(--radius-xs);
  background: var(--color-purple-100); color: var(--tb-brand-purple);
  font-size: var(--text-xs); font-weight: var(--font-bold);
}
.preceipt .preceipt__line {
  margin: var(--space-3) 0 0;
  font: var(--font-normal) var(--text-sm)/var(--leading-normal) var(--font-body);
  color: var(--text-secondary);
}
.preceipt__line + .preceipt__line { margin-top: var(--space-1); }

/* ── The foot ──────────────────────────────────────────────────────────── */
.pfoot { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); margin: var(--space-6) 0 0; }
.pfoot--pinned { margin: 0; }
/* A FREE PLAN IS ONE TAP (Steven 2026-11-10: "We don't need the double
   approval on this screen because it's free"): the agreement the Approve
   popup carried, small, right over Approve (plan_foot, a plan with no
   price), Approve signing at once. */
.pfoot__agree {
    margin: 0;
    font: var(--font-normal) var(--text-xs)/var(--leading-snug) var(--font-body);
    color: var(--text-secondary);
    text-align: center;
}
.pfoot__agree a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px; }
/* The plan sheet's foot is whole: a plan waiting on Approve has no deal
   yet, so the fail dot (which keeps to a live deal) is not in its corner,
   and the room the sheet language keeps for it would only push Approve
   off centre. */
.psheet .pfoot--pinned { padding-right: var(--space-4); }

/* ── The steps in a page's flow ────────────────────────────────────────── */
.psteps { margin: var(--space-4) 0 0; }
.psteps .psteps__label {
  display: block; margin: 0 0 var(--space-1);
  font: var(--font-bold) var(--text-xs)/var(--leading-snug) var(--font-mono);
  font-family: var(--font-mono) !important;
  letter-spacing: .1em; text-transform: uppercase; color: var(--tb-brand-purple);
}
.pcards__plan .psteps { padding: 0 var(--space-1); }

@media (prefers-reduced-motion: reduce) {
  .pcards-sheet .psheet { animation: none; }
}

/* the plan's agent row opens the agent only on a card's plan back
   (feed/_proposal_cards.html plan_head; cards/card-col.css shows the
   chevron there): elsewhere no chevron */
.psheet__chev { display: none; }

/* The current step keeps the ball: the proposal-waiting orbit around
   its existing person/agent node. The picture itself stays still. */
.ptl__step[aria-current="step"] {
  background: color-mix(in srgb, var(--tb-brand-purple) 9%, var(--surface-primary));
  border-radius: var(--radius-lg);
}
.ptl__step[aria-current="step"] .ptl__title,
.ptl__step[aria-current="step"] .ptl__num {
  color: var(--tb-brand-purple);
  font-weight: var(--font-bold);
}
/* Hidden by default in markup: live refreshes into an older stylesheet
   cannot introduce a stray grid cell. Only the positioned style reveals it. */
.ptl__orbit[hidden] { display: block !important; }
.ptl__orbit {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
  width: calc(var(--ptl-node) + var(--space-3));
  height: calc(var(--ptl-node) + var(--space-3));
  left: calc(var(--space-3) / -2);
  top: calc(var(--ptl-pad) - var(--space-3) / 2);
  border: 2px solid color-mix(in srgb, var(--tb-brand-purple) 25%, transparent);
  border-radius: var(--radius-full);
  /* Share the gathering spinner's 100 ms clock; transform only.
     The existing offscreen and idle gates pause it with the deck. */
  animation: ptl-current-orbit 5200ms steps(52) var(--gath-t, 0ms) infinite;
}
.ptl__orbit::after {
  content: "";
  position: absolute;
  width: var(--space-2);
  height: var(--space-2);
  top: calc(var(--space-2) / -2);
  left: calc(50% - var(--space-2) / 2);
  border-radius: var(--radius-full);
  background: var(--accent-neon);
  box-shadow: 0 0 0 1px var(--tb-brand-purple);
}
/* The unseen face must rest even while its card is on screen. */
.tb-card:not(.is-flipped) .tb-card__back .ptl__orbit,
.tb-card.is-flipped .tb-card__front .ptl__orbit { animation-play-state: paused; }
@keyframes ptl-current-orbit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ptl__orbit { animation: none; }
}
