/* ================================================================
 *  STORIES (lane SP-1, 2026-11-19; _build/story.py, assets/js/story.js)
 *  plan-panels.html, approved as recommended: every panel loops a
 *  real moment, 3–5 steps with a progress line and a caption under
 *  each. story.js only sets data-st (ahead | now | done | gone) on
 *  each [data-at] and data-step on the panel; this file draws them.
 *
 *  House rules: transform-only motion, never opacity or filters. A
 *  hidden state is visibility: hidden, so every box keeps its size
 *  (no layout shift); arrivals move or scale in. Alternatives that
 *  take turns share one grid cell (.cp-stack). Reduced motion: the
 *  page is written at the last step and every caption is listed.
 *  Colours are the theme's tokens; dark follows html[data-theme].
 *
 *  1. The engine          (every story: states, bar, captions)
 *  2. Shared pieces       (rows, chips, bubbles, fields: cp-sx-*)
 *  3. Home panels         (SP-1)
 *  4. Pages off the home  (SP-3)
 *  5. Feature pages       (SP-2: rows, board, timeline)
 *  SP-2 / SP-3: add your panels' rules in sections after 3.
 * ================================================================ */

/* ---------------------------------------------------------------
 *  1. The engine
 * --------------------------------------------------------------- */
.cp-story {
    --cp-ease: cubic-bezier(0.2, 0.9, 0.3, 1.15);
    --cp-in: 0.55s;
    position: relative;
    min-width: 0;
    container: cp-story / inline-size;
}
.cp-story [data-at] {
    transition: transform var(--cp-in) var(--cp-ease);
}
.cp-story [data-st="ahead"],
.cp-story [data-st="gone"] {
    visibility: hidden;
}
.cp-story [data-st="ahead"] {
    transform: translateY(0.75rem) scale(0.96);
    transition-duration: 0s;
}
/* a story laid out as a grid takes one column that can shrink (nothing inside widens the panel) */
:is(.cp-sx-signup, .cp-sx-reach, .cp-sx-tab, .cp-fx, .cp-fd, .cp-hero-cap, .cp-ba, .cp-tl).cp-story {
    grid-template-columns: minmax(0, 1fr);
}

/* turns in one cell: the box is as big as the biggest turn */
.cp-stack {
    display: grid;
}
.cp-stack > * {
    grid-area: 1 / 1;
    min-width: 0;
}

/* the progress line: a segment a step; the step that is playing fills as it plays */
.cp-story-bar {
    display: flex;
    gap: 0.3125rem;
    min-width: 0;
}
.cp-story-bar > i {
    position: relative;
    flex: 1;
    height: 0.25rem;
    overflow: hidden;
    background: color-mix(in srgb, currentColor 14%, transparent);
    border-radius: var(--radius-full, 99px);
}
.cp-story .cp-story-bar > i[data-st] {
    visibility: visible;
    transform: none;
    transition: none;
}
.cp-story-bar > i::after {
    content: "";
    position: absolute;
    inset: 0;
    background: currentColor;
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: 0 50%;
}
.cp-story-bar > i[data-st="done"]::after { transform: none; }
.cp-story-bar > i[data-st="now"]::after { transform: none; }
.cp-story.is-playing .cp-story-bar > i[data-st="now"]::after {
    animation: cp-story-fill var(--story-ms, 2.3s) linear both;
}
@keyframes cp-story-fill {
    from { transform: scaleX(0); }
    to { transform: none; }
}

/* the captions: one cell, the step's own caption showing */
.cp-story-caps {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--color-text-soft);
}
.cp-story-caps > li {
    grid-area: 1 / 1;
    min-width: 0;
    text-wrap: pretty;
}
.cp-story-caps > li > b {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.cp-story .cp-story-caps > li[data-st="ahead"] {
    transform: translateY(0.375rem);
}

/* reduced motion: the last step, every caption listed in order */
@media (prefers-reduced-motion: reduce) {
    .cp-story [data-at] { transition: none; animation: none !important; }
    .cp-story-caps { gap: 0.375rem; }
    .cp-story-caps > li { grid-area: auto; }
    .cp-story .cp-story-caps > li[data-st] { visibility: visible; transform: none; }
    .cp-story .cp-story-bar > i::after { transform: none; animation: none; }
}
/* NB-4: on a phone (SC-3's query) no story plays (story.js leaves every data-story-still="phone" story as written):
   the panel is its finished moment, its last step with every caption listed, as under reduced motion. */
@media (hover: none), (pointer: coarse), (max-width: 1023.98px) {
    .cp-story[data-story-still="phone"] .cp-story-caps { gap: 0.375rem; }
    .cp-story[data-story-still="phone"] .cp-story-caps > li { grid-area: auto; }
    .cp-story[data-story-still="phone"] .cp-story-caps > li[data-st] { visibility: visible; transform: none; }
}

/* ---------------------------------------------------------------
 *  2. Shared pieces
 * --------------------------------------------------------------- */
.cp-sx-tag.custom-delta {
    color: var(--color-text);
    background: color-mix(in srgb, var(--color-text) 7%, transparent);
    font-weight: 500;
    padding-inline: 0.625rem;
}
.cp-sx-on.custom-delta { padding-inline: 0.625rem; }
.cp-sx-wait.custom-delta {
    color: var(--color-text-soft);
    background: color-mix(in srgb, var(--color-text) 8%, transparent);
    padding-inline: 0.625rem;
}
.cp-sx-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.35;
    color: var(--color-text);
    background: var(--custom-card);
    border: 1px solid var(--custom-line);
    border-radius: 0.875rem;
}
.cp-sx-row > i { font-size: 1.125rem; color: var(--color-text-soft); }
.cp-sx-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cp-sx-row b { display: block; font-weight: 600; }
.cp-sx-row small { display: block; font-size: 0.8125rem; color: var(--color-text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sx-row:not(:has(> .custom-delta, > .cp-sx-flip)) { grid-template-columns: auto minmax(0, 1fr); }

.cp-sx-field,
.cp-sx-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    margin: 0;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    background: var(--custom-card);
    border: 1px solid var(--custom-line);
    border-radius: var(--radius-full, 99px);
}
.cp-sx-glyph {
    flex: none;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--color-text-soft);
    background: color-mix(in srgb, var(--color-text) 6%, transparent);
    border-radius: 0.625rem;
}
.cp-sx-typed {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 500;
}
.cp-story .cp-sx-typed[data-st] { visibility: visible; transform: none; }
.cp-story.is-playing .cp-sx-typed[data-st="now"]::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1.1em;
    margin-inline-start: 2px;
    vertical-align: -0.15em;
    background: currentColor;
    animation: cp-sx-caret 1s steps(1) infinite;
}
@keyframes cp-sx-caret { 50% { transform: scaleY(0); } }

.cp-sx-bub {
    justify-self: start;
    max-width: 92%;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: var(--color-text);
    background: color-mix(in srgb, var(--custom-tone-2) 55%, var(--custom-card));
    border-radius: 1rem 1rem 1rem 0.3rem;
    transform-origin: 0 100%;
}
.cp-sx-bub--out {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    justify-self: end;
    background: color-mix(in srgb, var(--custom-tone-1) 55%, var(--custom-card));
    border-radius: 1rem 1rem 0.3rem 1rem;
    transform-origin: 100% 100%;
}
.cp-sx-bub--me {
    justify-self: end;
    background: color-mix(in srgb, var(--custom-tone-3) 70%, var(--custom-card));
    border-radius: 1rem 1rem 0.3rem 1rem;
    transform-origin: 100% 100%;
}
.cp-sx-face {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: -0.0625rem;
    background: var(--custom-card);
    border-radius: 50%;
}
.cp-story .cp-sx-bub[data-st="ahead"] { transform: scale(0.6); }
.cp-story .cp-sx-late[data-st="now"] { transition-delay: 0.9s; }
.cp-story.is-playing .cp-sx-late[data-st="now"] {
    animation: cp-sx-late var(--story-ms, 2.3s) linear both;
}
@keyframes cp-sx-late {
    0%, 38% { transform: scale(0.6); visibility: hidden; }
    39% { visibility: visible; transform: scale(0.6); }
    52%, 100% { transform: none; visibility: visible; }
}

/* a chip that flips to its outcome (the outcome pops over the problem, part way into its step) */
.cp-sx-flip { justify-items: end; align-items: center; }
.cp-story .cp-sx-flipto[data-st="ahead"] { transform: scale(0.3); }
.cp-story.is-playing .cp-sx-flipto[data-st="now"] {
    animation: cp-sx-pop var(--story-ms, 2.3s) linear both;
}
.cp-sx-flip:has(> .cp-sx-flipto:is([data-st="done"], [data-st="now"])) > .custom-delta { visibility: hidden; }
.cp-story.is-playing .cp-sx-flip:has(> .cp-sx-flipto[data-st="now"]) > .custom-delta {
    animation: cp-sx-out var(--story-ms, 2.3s) linear both;
}
@keyframes cp-sx-pop {
    0%, 30% { transform: scale(0.3); visibility: hidden; }
    31% { transform: scale(0.3); visibility: visible; }
    42% { transform: scale(1.12); }
    50%, 100% { transform: none; visibility: visible; }
}
@keyframes cp-sx-out {
    0%, 30% { transform: none; visibility: visible; }
    31%, 100% { transform: scale(0); visibility: hidden; }
}

.cp-sx-yesbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.375rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-bg);
    background: var(--color-text);
    border-radius: var(--radius-full, 99px);
}

.cp-sx-onlist {
    display: grid;
    gap: 0.4375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cp-sx-onlist > li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4375rem 0.625rem;
    font-size: 0.9375rem;
    font-weight: 500;
    background: var(--custom-card);
    border: 1px solid var(--custom-line);
    border-radius: 0.75rem;
}
.cp-sx-onlist > li > i { font-size: 1.0625rem; color: var(--color-text-soft); }

/* a narrow panel: a row's outcome chip goes under its words */
@container cp-story (max-width: 26rem) {
    .cp-sx-row:has(> .custom-delta, > .cp-sx-flip) { grid-template-columns: auto minmax(0, 1fr); row-gap: 0.375rem; }
    .cp-sx-row > :is(.custom-delta, .cp-sx-flip) { grid-column: 2; justify-self: start; justify-items: start; }
}

/* staggered children of a turn: each arrives --d × 0.18 s after its turn starts */
.cp-story.is-playing [data-st="now"] :is(.cp-sx-answers, .cp-sx-onlist, .cp-fd-list) > li,
.cp-story.is-playing [data-st="now"] .cp-sx-pages > span,
.cp-story.is-playing [data-st="now"] .cp-fd-code > i {
    animation: cp-sx-rise 0.5s var(--cp-ease) calc(var(--d, 0) * 0.18s + 0.1s) both;
}
@keyframes cp-sx-rise {
    from { transform: translateY(0.625rem) scale(0.94); }
}

/* ---------------------------------------------------------------
 *  3. Home panels (SP-1; _build/story_home.py)
 * --------------------------------------------------------------- */

/* 3a. The sign-up card: the minute itself */
.cp-sx-signup {
    grid-column: 1 / -1;
    display: grid;
    gap: 0.875rem;
}
.cp-sx-signup > .cp-story-bar { color: var(--color-text); order: 2; }
.cp-sx-signup > .cp-story-caps { order: 4; min-height: 2.9em; }
.cp-sx-top {
    order: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0;
}
.cp-sx-top > b {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.cp-sx-signup .cp-sx-field { order: 1; }
.cp-sx-stage { order: 3; min-height: 13.75rem; align-items: start; }
.cp-sx-screen { display: grid; gap: 0.5rem; align-content: start; }
.cp-sx-found > i { color: var(--custom-ink); }
.cp-sx-answers {
    display: grid;
    gap: 0.4375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cp-sx-answers > li {
    display: grid;
    grid-template-columns: minmax(6.5rem, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    background: var(--custom-card);
    border: 1px solid var(--custom-line);
    border-radius: 0.75rem;
}
.cp-sx-answers small { color: var(--color-text-soft); font-size: 0.8125rem; }
.cp-sx-answers b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sx-answers i { color: var(--custom-up); }
.cp-sx-url > span { font-family: var(--font-heading); font-weight: 500; }
.cp-sx-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0;
}
.cp-sx-pages > span {
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--custom-card);
    border: 1px solid var(--custom-line);
    border-radius: var(--radius-full, 99px);
}
.cp-sx-signup .cp-sx-bub { margin-top: 0.125rem; }
@media (max-width: 559px) {
    .cp-sx-answers > li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; }
    .cp-sx-answers > li > small { grid-column: 1 / -1; }
    .cp-sx-stage { min-height: 15.5rem; }
}

/* 3b. Customers reach you */
.cp-sx-reachpanel { align-content: start; }
.cp-sx-reach {
    display: grid;
    gap: clamp(1rem, 2.4vw, 1.5rem);
    color: var(--color-text);
}
.cp-sx-reach > .cp-story-bar { order: 1; color: var(--color-text); }
.cp-sx-reach > .custom-art-head { order: 0; align-items: center; }
.cp-sx-reach > .cp-sx-inbox { order: 2; }
.cp-sx-reach > .cp-story-caps { order: 3; min-height: 2.9em; }
.cp-sx-inbox {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cp-sx-src {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding: 0.625rem 0.75rem;
    background: color-mix(in srgb, var(--color-text) 3%, var(--custom-card));
    border: 1px solid var(--custom-line);
    border-radius: 0.875rem;
}
.cp-sx-src > .cp-sx-ic { grid-row: 1 / span 2; align-self: start; }
.cp-sx-src > .custom-delta { grid-column: 2; justify-self: start; }
.cp-story .cp-sx-src[data-st="ahead"] { transform: translateX(-1.25rem); }
.cp-sx-ic {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.125rem;
    color: var(--custom-ink);
    background: var(--custom-tone-4);
    border-radius: 50%;
}
.cp-sx-src:nth-child(2) .cp-sx-ic { background: var(--custom-tone-1); }
.cp-sx-src:nth-child(3) .cp-sx-ic { background: var(--custom-tone-2); }
.cp-sx-src:nth-child(4) .cp-sx-ic { background: var(--custom-tone-3); }
.cp-sx-who { min-width: 0; font-size: 0.9375rem; line-height: 1.35; }
.cp-sx-who small { color: var(--color-text-soft); font-size: 0.8125rem; }
.cp-story.is-playing .cp-sx-src[data-st="now"] > .custom-delta {
    animation: cp-sx-pop var(--story-ms, 2.3s) linear both;
}

/* 3c. The five feature tabs */
.cp-sx-tab.custom-art { gap: 1rem; align-content: start; }
.cp-sx-tab > .custom-art-head { order: 0; align-items: center; }
.cp-sx-tab > .cp-story-bar { order: 1; color: var(--color-text); }
.cp-sx-tab > :not(.custom-art-head, .cp-story-bar, .cp-story-caps, .sr-only) { order: 2; }
.cp-sx-tab > .cp-story-caps { order: 3; min-height: 2.9em; margin-top: auto; }
.cp-sx-tab .custom-art-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sx-tree {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cp-sx-tree > li {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--custom-line);
}
.cp-sx-tree > li:last-child { border-bottom: 0; }
.cp-sx-tree > li:nth-child(n + 3):nth-child(-n + 5) { padding-inline-start: 1.25rem; }
.cp-sx-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; color: var(--color-text-soft); }
.cp-sx-tree .custom-crawl-code {
    padding-inline: 0.625rem;
    line-height: 1.5rem;
    color: var(--custom-ink);
    background: var(--custom-tone-3);
    border-radius: var(--radius-full, 99px);
    font-weight: 600;
    font-size: 0.8125rem;
}
.cp-story.is-playing .cp-sx-tree > li[data-st="now"] { transition-delay: calc(var(--d, 0) * 0.12s - 0.24s); }
.cp-story .cp-sx-tree > li[data-st="ahead"] { transform: translateX(-1rem); }
.cp-sx-thread { display: grid; gap: 0.5rem; align-content: start; }
.cp-sx-photos { display: flex; gap: 0.25rem; margin-top: 0.375rem; }
.cp-sx-photos > i {
    width: 2.5rem;
    height: 2rem;
    background: linear-gradient(160deg, color-mix(in srgb, var(--custom-tone-2) 80%, #fff), color-mix(in srgb, var(--custom-tone-4) 90%, #000 4%));
    border-radius: 0.375rem;
}
.cp-sx-draft { grid-template-columns: auto minmax(0, 1fr) auto; }
.cp-sx-yes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0;
    padding: 0.625rem 0.625rem 0.625rem 1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    background: var(--custom-tone-3);
    color: var(--custom-ink);
    border-radius: 1rem;
}
.cp-sx-yes .cp-sx-yesbtn { color: var(--custom-tone-3); background: var(--custom-ink); }
/* the tap: the button presses once, at the end of its step (it is never shown pressed before) */
.cp-story.is-playing .cp-sx-yes[data-st="now"] .cp-sx-yesbtn {
    animation: cp-sx-tap var(--story-ms, 2.3s) linear both;
}
@keyframes cp-sx-tap {
    0%, 70% { transform: none; }
    76% { transform: scale(0.9); }
    84%, 100% { transform: none; }
}
.cp-sx-ring { grid-template-columns: auto minmax(0, 1fr); font-family: var(--font-heading); font-weight: 500; }
.cp-sx-bell { color: var(--custom-ink) !important; }
.cp-story.is-playing .cp-sx-ring[data-st="now"] > .cp-sx-bell {
    animation: cp-sx-ringing 0.6s ease-in-out 3;
}
@keyframes cp-sx-ringing {
    25% { transform: rotate(-14deg); }
    75% { transform: rotate(14deg); }
}
.cp-sx-recap { grid-template-columns: auto minmax(0, 1fr); background: color-mix(in srgb, var(--custom-tone-3) 45%, var(--custom-card)); }
.cp-sx-search { padding-block: 0.375rem; }
.cp-sx-search .cp-sx-typed { font-size: 1rem; }
.cp-sx-result { display: grid; gap: 0.125rem; margin: 0; padding: 0.5rem 0.25rem; min-width: 0; }
.cp-sx-result b { font-family: var(--font-heading); font-size: 1.0625rem; font-weight: 600; color: var(--color-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--color-text) 25%, transparent); text-underline-offset: 3px; }
.cp-sx-result small { font-size: 0.8125rem; color: var(--color-text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sx-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 1rem;
    align-items: center;
    padding: 0.75rem 0.875rem;
    background: var(--custom-card);
    border: 1px solid var(--custom-line);
    border-radius: 0.875rem;
}
.cp-sx-page > b { font-family: var(--font-heading); font-weight: 600; font-size: 1.0625rem; }
.cp-sx-page > small { grid-column: 1; color: var(--color-text-soft); font-size: 0.8125rem; }
.cp-sx-page > .cp-sx-price { grid-column: 1; font-family: var(--font-heading); font-weight: 600; }
.cp-sx-page > .cp-sx-yesbtn { grid-column: 2; grid-row: 1 / span 3; }
.cp-sx-flips { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.cp-sx-flipr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    font-weight: 500;
    background: var(--custom-card);
    border: 1px solid var(--custom-line);
    border-radius: 0.875rem;
}
.cp-story .cp-sx-flipr[data-st="ahead"] { transform: translateX(-1rem); }
@media (max-width: 559px) {
    .cp-sx-page { grid-template-columns: minmax(0, 1fr); }
    .cp-sx-page > .cp-sx-yesbtn { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* 3d. The night shift: one night across the three cards */
.cp-nx-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem 1rem;
    margin: 0;
    padding: 0.25rem 0.5rem 0.125rem;
    color: var(--color-text);
}
.cp-nx-head > .cp-story-bar { flex: 1 1 12rem; }
.cp-nx-caps {
    min-height: 2.9em;
    padding-top: 0.25rem;
    font-size: 0.875rem;
}
.cp-nx .custom-fix-tile { grid-template-rows: auto auto auto 1fr; }
.cp-nx .custom-fix-tile > .cp-nx-caps { align-self: end; }
.cp-story .custom-vital[data-st="ahead"] { transform: translateX(-1rem); }
.cp-nx-well {
    display: grid;
    gap: 0.5rem;
    align-content: center;
}
.cp-nx-when {
    justify-self: center;
    margin: 0 0 0.25rem;
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.cp-story .cp-nx-when[data-st="ahead"] { transform: scale(0.7); }
.cp-nx-well .cp-sx-bub { max-width: 100%; }
.cp-story .cp-nx-brief[data-st="ahead"] { transform: translateY(1.5rem) scale(0.94); }
.cp-story.is-playing .cp-nx-brief[data-st="now"] > p {
    animation: cp-sx-rise 0.5s var(--cp-ease) both;
}
.cp-story.is-playing .cp-nx-brief[data-st="now"] > p:nth-child(2) { animation-delay: 0.25s; }
.cp-story.is-playing .cp-nx-brief[data-st="now"] > p:nth-child(3) { animation-delay: 0.5s; }

/* 3e. The requests feed */
.cp-fx { display: grid; gap: clamp(0.75rem, 1.6vw, 1rem); }
.cp-fx > .cp-story-bar { color: var(--color-text); margin: 0.25rem 0.5rem 0; }
.cp-fx > .cp-story-caps { min-height: 2.9em; padding-inline: 0.5rem; }
.cp-fx-prog { justify-items: start; align-items: center; }
.cp-story .cp-fx-tick[data-st="ahead"] { transform: scale(0.3); }
.cp-story.is-playing .cp-fx-tick[data-st="now"] { animation: cp-sx-pop var(--story-ms, 2.3s) linear both; }
.cp-story.is-playing .cp-fx-new[data-st="now"] { animation: cp-sx-out var(--story-ms, 2.3s) linear both; }
.cp-fx-new.custom-delta {
    color: var(--color-text);
    background: var(--custom-tone-2);
    font-size: 0.8125rem;
}
.cp-story .cp-fx-board > [data-at][data-st="ahead"] { transform: translateY(-0.75rem); }
.cp-story.is-playing .cp-fx-board > [data-st="now"] {
    background: color-mix(in srgb, var(--custom-tone-3) 22%, transparent);
}
.cp-fx-board > [data-at] { border-radius: 0.75rem; }

/* 3f. The first-day clock (home; SP-3 reuses it on /features/ and /how-it-works/) */
.cp-fd {
    display: grid;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 2.25rem);
    color: var(--custom-ink);
}
.cp-fd > .cp-fd-head { margin: 0; }
.cp-fd > .cp-story-bar { color: currentColor; }
.cp-fd > .cp-story-caps { min-height: 2.9em; color: color-mix(in srgb, currentColor 72%, transparent); }
.cp-fd > .cp-story-caps > li > b { color: currentColor; }
.cp-fd-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(0.875rem, 2vw, 1.5rem);
}
.cp-fd-clock { display: grid; justify-items: center; gap: 0.375rem; }
.cp-fd-dial {
    position: relative;
    width: clamp(4.5rem, 9vw, 5.5rem);
    aspect-ratio: 1;
    background: var(--custom-card);
    border: 3px solid currentColor;
    border-radius: 50%;
}
.cp-fd-dial::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -0.5rem;
    width: 0.75rem;
    height: 0.375rem;
    background: currentColor;
    border-radius: 2px;
    transform: translateX(-50%);
}
.cp-fd-hand {
    position: absolute;
    left: calc(50% - 1.5px);
    bottom: 50%;
    width: 3px;
    height: 40%;
    background: currentColor;
    border-radius: 2px;
    transform-origin: 50% 100%;
    transform: rotate(var(--a4));
    transition: transform 0.7s var(--cp-ease, ease);
}
.cp-fd-dial::after {
    content: "";
    position: absolute;
    inset: calc(50% - 0.25rem);
    background: currentColor;
    border-radius: 50%;
}
.cp-fd[data-step="0"] .cp-fd-hand { transform: rotate(var(--a0)); transition: none; }
.cp-fd[data-step="1"] .cp-fd-hand { transform: rotate(var(--a1)); }
.cp-fd[data-step="2"] .cp-fd-hand { transform: rotate(var(--a2)); }
.cp-fd[data-step="3"] .cp-fd-hand { transform: rotate(var(--a3)); }
.cp-fd[data-step="4"] .cp-fd-hand { transform: rotate(var(--a4)); }
.cp-fd-time {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    justify-items: center;
}
.cp-fd-screens { min-height: 9.5rem; align-items: center; color: var(--color-text); }
.cp-fd-screen { display: grid; gap: 0.4375rem; align-content: center; }
.cp-fd-list {
    display: grid;
    gap: 0.3125rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cp-fd-list > li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.3125rem 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    background: var(--custom-card);
    border-radius: 0.625rem;
}
.cp-fd-list > li > i { color: var(--custom-up); }
.cp-fd-code {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4375rem;
    margin: 0;
}
.cp-fd-code > small { flex: 1 0 100%; font-size: 0.875rem; font-weight: 500; color: currentColor; }
.cp-fd-code > i {
    width: 2.25rem;
    height: 2.75rem;
    background: var(--custom-card);
    border-radius: 0.625rem;
    position: relative;
}
.cp-fd-code > i::after {
    content: "";
    position: absolute;
    inset: calc(50% - 0.3125rem);
    background: var(--color-text);
    border-radius: 50%;
}
.cp-fd .cp-sx-row { padding: 0.5rem 0.625rem; font-size: 0.875rem; }
.cp-fd .cp-sx-onlist > li { padding: 0.3125rem 0.625rem; font-size: 0.875rem; }
.cp-fd .cp-sx-field { padding-block: 0.375rem; }
.cp-fd-tag { margin: 0; font-size: 0.8125rem; color: color-mix(in srgb, currentColor 70%, transparent); }
@media (max-width: 420px) {
    .cp-fd-main { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
    .cp-fd-clock { grid-auto-flow: column; justify-content: start; align-items: center; gap: 0.75rem; }
    .cp-fd-dial { width: 3.5rem; }
}

html[data-theme="dark"] .cp-fd { color: var(--color-text); }

/* 3g. The hero: a caption under the search for each phase */
.cp-hero-cap {
    display: grid;
    gap: 0.625rem;
    max-width: 34rem;
    margin: clamp(1rem, 2vw, 1.375rem) auto 0;
    text-align: center;
}
.cp-hero-cap > .cp-story-bar { width: 9rem; justify-self: center; color: var(--color-text); }
.cp-hero-cap > .cp-story-caps { min-height: 1.45em; }
@media (max-width: 559px) {
    .cp-hero-cap > .cp-story-caps { min-height: 2.9em; }
}

/* dark (the toggle: html[data-theme="dark"]) — cards and bubbles on the dark surface */
html[data-theme="dark"] .cp-sx-bub { color: oklch(from var(--custom-tone-2) 0.93 min(c, 0.05) h); background: oklch(from var(--custom-tone-2) 0.36 min(c, 0.07) h); }
html[data-theme="dark"] .cp-sx-bub--out { color: oklch(from var(--custom-tone-1) 0.93 min(c, 0.05) h); background: oklch(from var(--custom-tone-1) 0.36 min(c, 0.07) h); }
html[data-theme="dark"] .cp-sx-bub--me { color: oklch(from var(--custom-tone-3) 0.95 min(c, 0.06) h); background: oklch(from var(--custom-tone-3) 0.38 min(c, 0.08) h); }
html[data-theme="dark"] .cp-sx-ic { color: var(--custom-ink); }
html[data-theme="dark"] .cp-sx-photos > i { background: linear-gradient(160deg, oklch(from var(--custom-tone-2) 0.5 min(c, 0.06) h), oklch(from var(--custom-tone-4) 0.4 min(c, 0.06) h)); }
html[data-theme="dark"] .cp-sx-recap { background: oklch(from var(--custom-tone-3) 0.34 min(c, 0.07) h); }
html[data-theme="dark"] .cp-fx-new.custom-delta { color: var(--custom-ink); }
html[data-theme="dark"] .cp-sx-bell,
html[data-theme="dark"] .cp-sx-found > i { color: var(--color-text) !important; }

/* ---------------------------------------------------------------
 *  4. Pages off the home (SP-3; _build/story_pages.py)
 * --------------------------------------------------------------- */
:is(.cp-mo, .cp-cd, .cp-wk, .cp-bd).cp-story { grid-template-columns: minmax(0, 1fr); }

/* 4a. /how-it-works: your morning (inside the theme's browser frame) */
.cp-mo {
    display: grid;
    gap: 0.875rem;
    padding: var(--custom-gutter, 1.25rem);
}
.cp-mo > .cp-story-bar { color: var(--color-text); }
.cp-mo > .cp-story-caps { min-height: 2.9em; }
.cp-mo .custom-art-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 0; }
.cp-mo .custom-art-name { font-family: var(--font-heading); font-size: 1.125rem; font-weight: 600; }
.cp-mo-day { display: grid; gap: 0.625rem; }
.cp-mo-turns { align-items: stretch; }
.cp-mo-book {
    display: grid;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    background: var(--custom-tray);
    border-radius: var(--custom-radius-well, 1rem);
}
.cp-mo-title { margin: 0; font-size: 1rem; font-weight: 600; }
.cp-mo-rows { display: grid; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }
.cp-mo-rows > li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4375rem 0.75rem;
    font-size: 0.9375rem;
    background: var(--custom-card);
    border-radius: 0.75rem;
}
.cp-mo-rows > li > i { color: var(--color-text-soft); }
.cp-mo-rows > li > b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-story.is-playing.cp-mo[data-step="0"] .cp-mo-rows > li {
    animation: cp-sx-rise 0.5s var(--cp-ease) calc(var(--d, 0) * 0.22s + 0.15s) both;
}
.cp-mo-face { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; background: var(--custom-card); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--custom-line); }
.cp-mo-face > .cp-sx-face { width: 1.75rem; height: 1.75rem; }
.cp-mo .cp-sx-row small { white-space: normal; }
.cp-mo-recap { background: color-mix(in srgb, var(--custom-tone-3) 40%, var(--custom-card)); }
.cp-mo-urgent { background: color-mix(in srgb, var(--custom-tone-4) 55%, var(--custom-card)); }
.cp-mo-urgent > i { color: var(--custom-ink); }
.cp-mo-hot.custom-delta { color: #fff; background: var(--custom-ink); padding-inline: 0.625rem; }
.cp-story.is-playing .cp-mo-urgent[data-st="now"] > i { animation: cp-sx-ringing 0.6s ease-in-out 0.5s 3; }
html[data-theme="dark"] .cp-mo-recap { background: oklch(from var(--custom-tone-3) 0.34 min(c, 0.07) h); }
html[data-theme="dark"] .cp-mo-urgent { background: oklch(from var(--custom-tone-4) 0.34 min(c, 0.07) h); }
html[data-theme="dark"] .cp-mo-urgent > i { color: var(--color-text); }
html[data-theme="dark"] .cp-mo-hot.custom-delta { color: var(--custom-ink); background: var(--custom-tone-4); }

/* 4b. /start: the minute, matched to the name typed (story-pages.js sets .is-yours) */
.cp-st3:not(.is-yours) .cp-yo-you,
.cp-st3.is-yours .cp-yo-ex { display: none; }
.cp-st3 [data-yo="name"] { overflow-wrap: anywhere; }
.cp-st3 .cp-sx-url > span { white-space: nowrap; }
.cp-st3-listing > li { grid-template-columns: minmax(6.5rem, auto) minmax(0, 1fr); }
.cp-story.is-playing .cp-sx-screen[data-st="now"] .cp-st3-listing > li { animation: cp-sx-rise 0.5s var(--cp-ease) calc(var(--d, 0) * 0.25s + 0.4s) both; }
.cp-st3 .cp-sx-top > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* 4c. /sites/northside-auto: one car's day */
.cp-cd { display: grid; gap: 1rem; }
.cp-cd > .cp-story-bar { color: var(--color-text); }
.cp-cd > .cp-story-caps { min-height: 2.9em; font-size: 1rem; }
.cp-cd-main {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
}
.cp-cd-track { position: relative; display: grid; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.cp-cd-track::before {
    content: "";
    position: absolute;
    top: 1.125rem;
    bottom: 1.125rem;
    left: calc(0.75rem - 1px);
    width: 2px;
    background: var(--custom-line);
}
.cp-cd-stage {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.25rem;
    font-size: 0.9375rem;
    color: var(--color-text-soft);
}
.cp-cd-stage > small { font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.cp-cd-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-cd-dot {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--custom-card);
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--custom-line);
}
.cp-cd-dot > i { width: 1rem; height: 1rem; background: var(--custom-tone-3); border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--custom-ink); }
.cp-story .cp-cd-dot > i[data-st="ahead"] { transform: scale(0.2); }
.cp-cd-stage:has([data-st="done"], [data-st="now"]) { color: var(--color-text); }
.cp-cd-stage:has([data-st="now"]) > .cp-cd-name { font-weight: 600; }
.cp-cd-screens { min-height: 12.5rem; align-items: center; }
.cp-cd-screen { display: grid; gap: 0.5rem; align-content: center; }
.cp-cd-from { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--color-text-soft); }
.cp-cd-yes { display: flex; justify-content: flex-start; margin: 0; }
.cp-cd-tracker {
    display: grid;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--custom-card);
    border: 1px solid var(--custom-line);
    border-radius: 0.875rem;
}
.cp-cd-trhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.375rem 0.75rem; margin: 0; }
.cp-cd-trhead > b { font-family: var(--font-heading); font-weight: 600; }
.cp-cd-trsteps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.375rem; margin: 0; padding: 0; list-style: none; }
.cp-cd-trsteps > li { display: grid; gap: 0.375rem; font-size: 0.75rem; line-height: 1.25; color: var(--color-text-soft); }
.cp-cd-trsteps > li > i { height: 0.375rem; background: color-mix(in srgb, var(--color-text) 12%, transparent); border-radius: 99px; }
.cp-cd-trsteps > li.is-on { color: var(--color-text); }
.cp-cd-trsteps > li.is-on > i { background: var(--color-text); }
.cp-cd-tag { margin: 0; font-size: 0.8125rem; color: var(--color-text-soft); }
@container cp-story (max-width: 40rem) {
    .cp-cd-main { grid-template-columns: minmax(0, 1fr); align-items: start; }
    .cp-cd-screens { min-height: 13.5rem; }
}

/* 4d. /blog/booked-after-hours: the week's hours (the bars fill, then the closed hours light up) */
.cp-wk .custom-shift-bar { clip-path: none; transition: none; }
.cp-wk > .cp-story-bar { color: var(--color-text); }
.cp-wk > .cp-story-caps { min-height: 1.45em; font-size: 1rem; }
.cp-wk-seg { position: relative; isolation: isolate; overflow: hidden; background: transparent; box-shadow: inset 0 0 0 1.5px var(--shift-fill); }
.cp-wk-seg.custom-shift-seg--none { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 22%, transparent); }
.cp-wk-fill { position: absolute; inset: 0; z-index: -1; background: var(--shift-fill); border-radius: inherit; transform-origin: 0 50%; transition-duration: 0.8s; }
.cp-story .cp-wk-fill[data-st] { visibility: visible; }
.cp-story .cp-wk-fill[data-st="ahead"] { transform: scaleX(0); }
.cp-wk-seg:has(> .cp-wk-fill[data-st="ahead"]) { color: var(--color-text); }
.cp-wk-lit {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding-inline: 0.5rem;
    font-style: normal;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--custom-ink);
    background: var(--custom-tone-1);
    border-radius: inherit;
    transform-origin: 0 50%;
}
.cp-wk-lit > .cp-sx-face { width: 1.375rem; height: 1.375rem; }
.cp-wk-lit > span { overflow: hidden; text-overflow: ellipsis; }
.cp-story .cp-wk-lit[data-st="ahead"] { transform: scaleX(0); }
.cp-wk-key { --shift-fill: var(--custom-tone-1); }
.cp-story .cp-wk-key[data-st="ahead"] { transform: scale(0.6); }

/* 4e. Every page's sign-up band card: the eight things switching on, one a step (on the footer's ink sheet) */
.cp-bd-body { display: grid; gap: 1.125rem; }
.cp-bd > .cp-story-bar { color: #fff; }
.cp-bd > .cp-story-caps { min-height: 2.9em; color: var(--footer-body); font-size: 0.875rem; }
.cp-bd > .cp-story-caps > li > b { color: #fff; }
.cp-bd-n { display: inline-grid; justify-items: end; vertical-align: baseline; }
.cp-story .cp-bd-n > span[data-st] { transform: none; transition: none; }
.cp-bd .cp-band-ok > i[data-at],
.cp-bd .cp-ring-s[data-at],
.cp-bd .cp-bd-all[data-at] { transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.45); }
.cp-story.cp-bd .cp-band-ok > i[data-st="ahead"],
.cp-story.cp-bd .cp-ring-s[data-st="ahead"],
.cp-story.cp-bd .cp-bd-all[data-st="ahead"] { transform: scale(0); transition-duration: 0s; }
.cp-story.cp-bd [data-st="now"],
.cp-story.cp-bd [data-st="done"] { transform: none; }
.cp-bd .cp-band-list > li:has(.cp-band-ok > i[data-st="now"]) .cp-band-name { color: var(--custom-tone-3); }
/* the band's .visible entrance (VP-1) is the story's job here: it plays the arrivals one a step */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
    .cp-band.cp-bd .cp-ring-s[data-st],
    .cp-band.cp-bd .cp-band-ok > i[data-st] { transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.45); }
    .cp-band.cp-bd:is(.visible, :not(.visible)) .cp-ring-s:is([data-st="now"], [data-st="done"]),
    .cp-band.cp-bd:is(.visible, :not(.visible)) .cp-band-ok > i:is([data-st="now"], [data-st="done"]) { transform: none; }
    .cp-band.cp-bd:is(.visible, :not(.visible)) .cp-ring-s[data-st="ahead"],
    .cp-band.cp-bd:is(.visible, :not(.visible)) .cp-band-ok > i[data-st="ahead"] { transform: scale(0); transition-duration: 0s; }
}
/* narrow panels: the example tag wraps instead of running past the card; the lit bars keep Click's face only */
.cp-mo .cp-sx-tag.custom-delta { white-space: normal; max-width: 100%; line-height: 1.35; }
@container cp-story (max-width: 30rem) {
    .cp-wk-lit > span { display: none; }
}

/* 4f. Whole frames (SP-3b; PERF-1 rule 2): in a "cp-whole" story what has not happened yet is drawn as an
   outline of itself (readable, never hidden), and fills in when its step arrives; so no step is a near-empty card.
   The inbox and the home's feature tabs. Turns that replace each other (.cp-stack) and outcome chips still wait. */
/* NB-4 (plan-never-blank.html, "approved as recommended"): this is now EVERY story's rule, not only cp-whole's. A step
   still to come is never hidden, so no card, row or bubble is ever an empty box mid-loop (the home night shift's
   "A Price Question" card sat empty for a whole step). In a story without cp-whole the outline keeps its own
   "ahead" offset, so it still rises into place by its own transition when its step arrives. */
html .cp-story [data-at][data-st="ahead"]:not(.cp-sx-flipto, .cp-story-cap, .cp-story-bar > i, .cp-stack > *) {
    visibility: visible;
    color: var(--color-text-soft);
    background: transparent;
    border-color: transparent;
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 16%, transparent);
}
html .cp-story.cp-whole [data-at][data-st="ahead"]:not(.cp-sx-flipto, .cp-story-cap, .cp-story-bar > i, .cp-stack > *) {
    transform: none;
}
html .cp-story [data-st="ahead"] :is(.custom-delta, .cp-sx-yesbtn, .cp-sx-ic, .cp-sx-price, .custom-crawl-code) {
    color: var(--color-text-soft);
    background: transparent;
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-text) 16%, transparent);
}
html .cp-story [data-st="ahead"] :is(.cp-sx-photos > i, .cp-sx-face) { background: color-mix(in srgb, var(--color-text) 8%, transparent); }
html .cp-story [data-st="ahead"] .cp-sx-face { visibility: hidden; }
html .cp-story [data-st="ahead"] b { color: var(--color-text-soft); }
/* the arrival: the outline fills and the piece rises into place (transform only) */
.cp-story.cp-whole.is-playing [data-at][data-st="now"]:not(.cp-sx-flipto, .cp-story-cap, .cp-story-bar > i, .cp-sx-late, .cp-sx-typed, .cp-stack > *) {
    animation: cp-sx-rise 0.5s var(--cp-ease) both;
}
.cp-story.cp-whole.is-playing .cp-sx-late[data-st="now"] { animation: cp-wh-late var(--story-ms, 2.3s) linear both; }
@keyframes cp-wh-late {
    0%, 38% { transform: scale(0.94); }
    46% { transform: scale(1.04); }
    54%, 100% { transform: none; }
}

/* ---------------------------------------------------------------
 *  5. Feature pages (SP-2; _build/story_features.py)
 *     5a rows: each before → after row flips, one a step
 *     5b board: an item is picked up (the doer's chip), then lands
 *        in the after tree with its outcome
 *     5c timeline: the day's moments, one at a time
 * --------------------------------------------------------------- */

/* 5a. Before → after rows (What It Does, the first card's well) */
.cp-ba.custom-fix-well {
    gap: 1rem;
    align-content: start;
}
.cp-ba > .cp-story-bar { order: 1; color: var(--color-text); }
.cp-ba > .cp-ba-head { order: 0; margin: 0; align-items: center; }
.cp-ba > .cp-ba-rows { order: 2; }
.cp-ba > .cp-story-caps { order: 3; min-height: 4.35em; color: color-mix(in srgb, currentColor 78%, transparent); }
.cp-ba .custom-art-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-ba-rows {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cp-ba-row > b { min-width: 0; }
.cp-ba-row > b > small {
    display: block;
    margin-top: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-body, inherit);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0;
    color: color-mix(in srgb, currentColor 70%, transparent);
}
.cp-ba-row > s { align-self: center; }
.cp-ba-row > .cp-ba-to { align-self: center; }
/* the problem is struck through once its outcome is in */
html[data-demo] .cp-ba .custom-vitals.site-vitals-plain .cp-ba-row:has(> .cp-ba-to:is([data-st="now"], [data-st="done"])) > s {
    text-decoration: line-through;
}
.cp-story .cp-ba-to[data-st="ahead"] { transform: scale(0.4); }
.cp-story.is-playing .cp-ba-to[data-st="now"] { animation: cp-sx-pop var(--story-ms, 2.3s) linear both; }

/* 5b. The board: the copy's before and after trees */
.cp-fb > .cp-story-bar,
.cp-fb > .cp-story-caps { grid-column: 1 / -1; }
.cp-fb > .cp-story-bar { color: var(--color-text); }
.cp-fb > .cp-story-caps {
    min-height: 2.9em;
    margin-top: -0.25rem;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--color-text);
}
.cp-fb-flip { justify-items: end; align-items: center; }
/* the before chip, as the theme draws it (it now sits one level down, in the flip cell) */
.custom-service-trees .is-broken > .cp-fb-flip > .custom-crawl-code {
    color: var(--color-text);
    background: var(--custom-tray);
    border-radius: var(--radius-full);
    padding-inline: 0.75rem;
    font-weight: 600;
    line-height: 1.75rem;
}
.cp-fb-doing.custom-delta {
    gap: 0.375rem;
    padding: 0.1875rem 0.75rem 0.1875rem 0.25rem;
    line-height: 1.375rem;
}
.cp-fb-doing.custom-delta:not(:has(> img)) { padding-inline-start: 0.75rem; }
.cp-fb-doing > .cp-sx-face { width: 1.375rem; height: 1.375rem; margin: 0; }
.cp-fb-moved {
    font-size: 1.125rem;
    line-height: 2.75rem;
    color: var(--color-text-muted);
}
/* picked up: the before chip gives way to the doer, then to the arrow (gone across) */
.cp-fb-flip:has(> :is(.cp-fb-now, .cp-fb-moved):is([data-st="now"], [data-st="done"])) > .custom-crawl-code { visibility: hidden; }
.cp-story:not(.is-playing) .cp-fb-now { visibility: hidden; }
.cp-story.is-playing .cp-fb-moved[data-st="now"] { visibility: hidden; }
li:has(> .cp-fb-flip > .cp-fb-moved:is([data-st="now"], [data-st="done"])) > .custom-crawl-path { color: var(--color-text-muted); }
.cp-story.is-playing li:has(> .cp-fb-flip > .cp-fb-moved[data-st="now"]) > .custom-crawl-path { color: inherit; }
.cp-story .cp-fb-now[data-st="ahead"] { transform: scale(0.4); }
.cp-story.is-playing .cp-fb-now[data-st="now"] { animation: cp-sx-pop var(--story-ms, 2.3s) linear both; }
.cp-story .cp-fb-moved[data-st="ahead"] { transform: translateX(-0.5rem); }
/* landing: the item slides into the after tree, its outcome pops on, late in the step */
.cp-story .cp-fb :is(.cp-fb-in, .cp-fb-land) { animation: none; }
.cp-story .cp-fb-in[data-st="ahead"] { transform: translateX(-1.25rem); }
.cp-story .cp-fb-land[data-st="ahead"] { transform: scale(0.3); }
.cp-story.is-playing .cp-fb-in[data-st="now"] { animation: cp-fb-in var(--story-ms, 2.3s) linear both; }
.cp-story.is-playing .cp-fb-land[data-st="now"] { animation: cp-fb-land var(--story-ms, 2.3s) linear both; }
@keyframes cp-fb-in {
    0%, 44% { transform: translateX(-1.25rem); visibility: hidden; }
    45% { transform: translateX(-1.25rem); visibility: visible; }
    62%, 100% { transform: none; visibility: visible; }
}
@keyframes cp-fb-land {
    0%, 58% { transform: scale(0.3); visibility: hidden; }
    59% { transform: scale(0.3); visibility: visible; }
    68% { transform: scale(1.12); }
    76%, 100% { transform: none; visibility: visible; }
}

/* 5c. The timeline: one moment at a time */
.cp-tl { display: grid; gap: 0; align-content: start; }
.cp-tl > .cp-story-bar {
    color: var(--color-text);
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}
.cp-tl-list > li { transition: transform var(--cp-in) var(--cp-ease); }
.cp-tl-out.custom-delta { justify-self: start; margin-top: 0.25rem; padding-inline: 0.625rem; }
@media (min-width: 640px) {
    .cp-tl-out.custom-delta { grid-column: 2; }
}
.cp-story .cp-tl-out[data-st="ahead"] { transform: scale(0.4); }
.cp-story.is-playing .cp-tl-out[data-st="now"] { animation: cp-sx-pop var(--story-ms, 2.3s) linear both; }
/* while it plays: the moment playing steps forward, the ones still to come are muted */
@media (min-width: 640px) {
    .cp-story.is-playing .cp-tl-list > li:has(> .cp-tl-out[data-st="now"]) { transform: translateX(0.5rem); }
}
.cp-story.is-playing .cp-tl-list > li:has(> .cp-tl-out[data-st="ahead"]) :is(h3, p, .custom-service-when) { color: var(--color-text-muted); }
.cp-story.is-playing .cp-tl-list > li:has(> .cp-tl-out[data-st="now"]) .custom-service-when { color: var(--color-text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
    .cp-tl-list > li { transition: none; }
}

/* ---------------------------------------------------------------
 *  6. TB-1: the home feature tabs in plain English (plan-feature-tabs.html, concept C)
 *  A promise, three moments, then the text on the owner's phone. The page as written is the finished moment;
 *  on phones story.js leaves it there (data-story-still="phone"), so nothing plays or moves.
 * --------------------------------------------------------------- */
.cp-tb-card.custom-art { gap: 0.875rem; }
.cp-tb-card .custom-art-name { white-space: normal; overflow: visible; }
.cp-tb { display: grid; gap: 0.875rem; align-content: start; min-width: 0; }
.cp-tb-promise {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}
.cp-tb-steps { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.cp-tb-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: var(--color-text-soft);
    background: var(--custom-card);
    border: 1px solid var(--custom-line);
    border-radius: 0.875rem;
}
.cp-tb-step b { font-weight: 600; color: var(--color-text); }
.cp-tb-n {
    display: grid;
    place-items: center;
    width: 1.625rem;
    height: 1.625rem;
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--custom-ink);
    background: var(--custom-tone-3);
    border-radius: 50%;
}
.cp-tb-phone {
    display: grid;
    gap: 0.375rem;
    padding: 0.75rem;
    background: color-mix(in srgb, var(--custom-tone-1) 22%, var(--custom-card));
    border-radius: 1.125rem;
}
.cp-tb-from { display: flex; align-items: center; gap: 0.375rem; margin: 0; font-size: 0.8125rem; font-weight: 500; color: var(--color-text-soft); }
.cp-tb-text {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    justify-self: start;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: var(--color-text);
    background: var(--custom-card);
    border-radius: 1rem 1rem 1rem 0.3rem;
}
.cp-story .cp-tb-step[data-st="ahead"] { transform: translateX(-0.75rem); }
html[data-theme="dark"] .cp-tb-phone { background: oklch(from var(--custom-tone-1) 0.32 min(c, 0.07) h); }

/* 6b. TC-1: the features card in one screen (plan-tabs-card.html, layout A, "approved as recommended").
 * Founder: "sexify this card its unecessarily tall doesnt even fit in the viewport". The whole section, heading
 * included, fits under the menu at 1280x800 (flick.mjs --fit). The theme's pieces, rearranged by
 * story_home.tabs_one_screen(): the heading on one line, the tabs as a row of theme pills (icon and name) across
 * the top, each panel two columns (the words; the example story with its three steps side by side and the text
 * under them). Phones: the pills wrap with short names, no swipe row (SC-3), every step shows (NB-4). */
#ag4-services .cp-tc-head.custom-head {
    padding: clamp(1rem, 2.4vw, 1.75rem) clamp(0.25rem, 1.2vw, 1rem) 0.5rem;
    margin-bottom: 0;
    row-gap: 0.75rem;
}
#ag4-services .cp-tc-head .custom-title { font-size: clamp(2rem, 1.25rem + 2.2vw, 3rem); line-height: 1.08; }
.cp-tc-tabs.tabs { display: grid; gap: 0.75rem; }
.cp-tc-tabs .tabs-panels { margin-top: 0; }
.cp-tc-nav.tabs-nav { flex-wrap: wrap; overflow: visible; gap: 0.5rem; padding: 0; }
.cp-tc-tabs .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.3125rem 1.125rem 0.3125rem 0.3125rem;
    border-radius: var(--radius-pill);
    background: var(--custom-card);
    color: var(--color-text);
    white-space: nowrap;
}
.cp-tc-tabs .tab-btn:hover { background: var(--color-bg-muted); }
.cp-tc-tabs .tab-btn.is-active { background: var(--color-text); color: var(--color-bg); }
.cp-tc-tabs .tab-btn:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.cp-tc-tabs .tab-btn::after,
.cp-tc-tabs .tab-btn-caption { display: none; }
.cp-tc-tabs .tab-btn-icon {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.125rem;
    border-radius: 50%;
    color: var(--color-text);
    background: var(--custom-tray);
}
.cp-tc-tabs .tab-btn.is-active .tab-btn-icon { color: var(--custom-ink); background: var(--svc-tone); }
.cp-tc-tabs .tab-btn-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; color: inherit; }
.cp-tc-short { display: none; }
.cp-tc-panel.custom-svc-panel {
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
    padding: clamp(1rem, 2.4vw, 1.75rem);
}
.cp-tc-panel > .grid { gap: 0.875rem; }
.cp-tc-panel .custom-svc-name { font-size: clamp(1.5rem, 1.2rem + 0.9vw, 2rem); }
.cp-tc-panel .custom-svc-line { font-size: 1rem; line-height: 1.5; }
.cp-tc-panel .custom-points { gap: 0.5rem; }
.cp-tc-panel .cp-tb-card { --card-pad: 1.125rem; gap: 0.75rem; }
.cp-tc-panel .cp-tb { gap: 0.625rem; }
.cp-tc-panel .cp-tb-promise { font-size: 1.0625rem; }
@media (width >= 768px) {
    .cp-tc-panel.custom-svc-panel { grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.5fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
    .cp-tc-panel .cp-tb-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cp-tc-panel .cp-tb-step { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0.5rem; font-size: 0.875rem; }
    .cp-story .cp-tc-panel .cp-tb-step[data-st="ahead"],
    .cp-tc-panel .cp-story .cp-tb-step[data-st="ahead"] { transform: translateY(0.5rem); }
}
@media (width < 640px) {
    .cp-tc-long { display: none; }
    .cp-tc-short { display: inline; }
    .cp-tc-nav.tabs-nav { gap: 0.3125rem; }
    .cp-tc-tabs .tab-btn { gap: 0.3125rem; padding: 0.375rem 0.625rem 0.375rem 0.375rem; }
    .cp-tc-tabs .tab-btn-icon { width: 1.75rem; height: 1.75rem; font-size: 0.9375rem; }
    .cp-tc-tabs .tab-btn-title { font-size: 0.9375rem; }
}
/* the sweep: the Minute One tiles' site line is words now, not an address */
.cp-m1-url { font-family: inherit; }
/* HQ-1: the home hero's Booking Queue rows carry words, one set per scenario (builders.py home); the set of the
   active pick shows, the first scenario's without :has() */
.custom-serp :is(.cp-q, .cp-qi):not([data-s="0"]) { display: none; }
.custom-serp:has([data-scen="1"].is-active) :is(.cp-q, .cp-qi)[data-s="0"],
.custom-serp:has([data-scen="2"].is-active) :is(.cp-q, .cp-qi)[data-s="0"] { display: none; }
.custom-serp:has([data-scen="1"].is-active) .cp-q[data-s="1"],
.custom-serp:has([data-scen="2"].is-active) .cp-q[data-s="2"] { display: grid; }
.custom-serp:has([data-scen="1"].is-active) .cp-qi[data-s="1"],
.custom-serp:has([data-scen="2"].is-active) .cp-qi[data-s="2"] { display: inline-block; }
