/* ── The split Studio (v5) ───────────────────────────────────────────────────
   Loaded LAST (after flow.css and home.css): it only adds to the single-page
   rules at the end of flow.css and to the landing screen of home.css.

   - .lp-steps            the step bar across the top (StepBar.tsx)
   - .lp-home--split      the empty Studio drawn as the same two panels
   - .lp-choice--split    the left panel: description under the images
   - .lp-flow-failure     a failed run, inside its own panel (FailureNotice)
   - .lp-flow-mobilebar   a phone's bottom bar repeating the current action
   Tokens only (lowpoly/base.css); no colour of its own. */

/* ── Step bar ── */
.lp-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 10px 18px;
    list-style: none;
    border-bottom: 1px solid var(--line);
    background: var(--bg-elev);
    flex: 0 0 auto;
}
.lp-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--fg-faint);
    white-space: nowrap;
}
.lp-step + .lp-step::before {
    content: "";
    width: 22px;
    height: 1px;
    margin-right: 6px;
    background: var(--line-strong);
}
.lp-step-n {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}
.lp-step.is-done { color: var(--fg-muted); }
.lp-step.is-done .lp-step-n { border-color: var(--accent-line); color: var(--accent-text); }
.lp-step.is-now { color: var(--fg); font-weight: 600; background: var(--accent-soft); }
.lp-step.is-now .lp-step-n { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ── The empty Studio, split ── */
.lp-home.lp-home--split {
    display: flex;
    flex-direction: column;
}
.lp-home--split > .lp-home-split { flex: 1 1 auto; min-height: 0; }
.lp-home--split .lp-home-ask { min-width: 0; overflow-y: auto; }

/* The right panel before an image is picked. */
.lp-flow-one-cube { width: 56px; height: 56px; color: var(--fg-faint); margin-bottom: 6px; }
.lp-flow-one-empty.is-quiet { opacity: 0.75; }
.lp-flow-one-nudge {
    margin-top: 8px;
    font-size: 1.25rem;
    color: var(--accent-text);
}

/* ── Left panel: heading, images, then the description under them ──
   Rows: head, grid, foot (run arrows; `display: none` when empty, so the
   compose block then takes the third track), compose. */
.lp-choice.lp-choice--split { grid-template-rows: auto minmax(0, 1fr) auto auto; }
.lp-choice-compose {
    display: grid;
    gap: 8px;
    padding: 6px 20px 14px;
}
.lp-choice-compose .lp-flow-composer textarea { min-height: 0; }
.lp-choice-compose .lp-flow-ask-actions { justify-content: flex-end; }
.lp-choice--split .lp-choice-foot:empty { display: none; }

/* The picked image under the ring while its model is made. */
.lp-model-image.is-working { position: relative; }
.lp-model-image.is-working img { opacity: 0.45; }
.lp-model-image.is-working .lp-model-ring {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

/* ── A failed run, inside its panel ── */
.lp-flow-failure {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 0 0 auto !important;
    margin: 12px 20px 0;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--danger) 8%, var(--bg-elev));
    font-size: 0.8125rem;
}
.lp-flow-failure-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
}
.lp-flow-failure-text { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.lp-flow-failure-text span { color: var(--fg-muted); }
.lp-flow-failure-close {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: var(--fg-muted);
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
}

/* ── Phone bottom bar: hidden on wide screens ── */
.lp-flow-mobilebar { display: none; }

@media (max-width: 900px) {
    .lp-steps { justify-content: flex-start; overflow-x: auto; padding: 8px 12px; gap: 2px; }
    .lp-step { padding: 4px 6px; font-size: 0.75rem; }
    .lp-step + .lp-step::before { width: 10px; margin-right: 2px; }
    /* Only the current word on a phone: the numbers carry the rest. */
    .lp-step:not(.is-now) .lp-home-step-label { display: none; }

    .lp-home.lp-home--split { height: auto; overflow-y: auto; }
    .lp-home--split .lp-home-ask { overflow: visible; }
    .lp-home--split .lp-flow-one-model { min-height: 0; }
    .lp-home--split .lp-flow-one-empty { padding: 18px 16px; }

    .lp-flow.lp-flow--one,
    .lp-flow-one,
    .lp-home--split { overflow-x: hidden; max-width: 100vw; }
    .lp-choice-compose { padding: 4px 16px 12px; }
    .lp-flow-failure { margin: 10px 16px 0; }

    .lp-flow-mobilebar.is-on {
        position: sticky;
        bottom: 0;
        z-index: 5;
        display: flex;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--line);
        background: var(--bg-elev);
        box-shadow: var(--shadow);
    }
    .lp-flow-mobilebar .btn { width: 100%; justify-content: center; }
    .lp-flow-mobilebar .lp-flow-cost-chip { background: rgba(0, 0, 0, 0.22); }
}
