/* =====================================================================
 * chroma-setup-tuner-steps.css — guided-setup layer for
 * chroma-setup-tuner-steps.html
 *
 * Loaded AFTER product-theme.css and chroma-setup-tuner.css. The theme's
 * .journey / .station own the step card, markers, spine and states; this
 * file only fits the tuner's existing sections into the station bodies.
 * Theme tokens only.
 * ===================================================================== */

/* The journey sits above the workbench on the page's 20px rhythm. */
.workbench > .setup-journey { margin: 0 0 20px; }

/* Sections inside a station are content, not panels of their own: the
   journey card is the panel. */
.setup-journey .station__body > .section,
.setup-journey .station__body > details.section {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* The station title names the step, so the sections' own titles go.
   #authSection's summary stays as a status line: it carries #tokenStatus
   (sign-in messages and errors) and the org hash. */
.setup-journey #authSection > summary {
    padding-left: 0;
    margin-bottom: 12px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    cursor: default;
    pointer-events: none;
}
.setup-journey #authSection > summary::before,
.setup-journey #authSection > summary > span:first-child { display: none; }
.setup-journey #authSection > summary:has(#tokenStatus:empty):has(#orgInfo.hidden) { display: none; }
.setup-journey #orgInfo { pointer-events: auto; }
.setup-journey #uploadSection > summary,
.setup-journey #configurationSection > h3 { display: none; }

/* The step script hides summaries and "Change" buttons with [hidden]; the
   theme's .station__summary and .btn display rules would override it. */
.setup-journey .station__summary[hidden],
.setup-journey .station-action[hidden] { display: none; }

/* Station head actions ("Change") and the step 2 Continue / Skip row. */
.setup-journey .station-action { margin: 0; }
.setup-journey .station-continue {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.setup-journey .station-optional {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
}
.setup-journey .station__marker svg { width: 14px; height: 14px; }

/* A done step 3 stays open: its body holds the loaded setup's stream
   cards, which stay in use while tuning. */
.setup-journey .station[data-state="done"][data-open="1"] > .station__body { padding-top: 4px; }

/* Step 4 "Tune & apply": two phases that point at the workbench below.
   Phase numbers follow the station markers: blue = done, orange = the
   phase that needs the user now (only while step 4 is the current step),
   neutral otherwise. */
.setup-journey .tune-phases {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    counter-reset: tune-phase;
}
.setup-journey .tune-phase {
    counter-increment: tune-phase;
    position: relative;
    padding: 12px 14px 12px 48px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.setup-journey .tune-phase::before {
    content: counter(tune-phase);
    position: absolute;
    left: 14px;
    top: 11px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}
.setup-journey .tune-phase__title {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
}
.setup-journey .tune-phase__text {
    display: block;
    margin-top: 2px;
    font-size: 13.5px;
    color: var(--text-secondary);
}
.setup-journey .tune-phase__status { display: block; margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.setup-journey .tune-phase__status:empty { display: none; }
.setup-journey .tune-phase[data-phase="done"]::before {
    content: '\2713';
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--text-on-accent);
}
.setup-journey .tune-phase[data-phase="done"] .tune-phase__status { color: var(--accent-blue); }
.setup-journey .station[data-state="current"] .tune-phase[data-phase="current"] { border-color: var(--accent-orange); }
.setup-journey .station[data-state="current"] .tune-phase[data-phase="current"]::before {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: var(--text-on-accent);
}
.setup-journey .tune-phase__status.is-pending { color: var(--accent-orange); }

/* The step 4 title names the workbench, so its own heading goes (embed
   mode hides the step chrome and keeps the heading). */
html:not(.embed-wb) .setup-journey + #workbenchBlock > .workbench-header { display: none; }

/* Narrow: the body's 70px marker indent leaves too little room for the
   upload grid and stream cards. */
@media (max-width: 760px) {
    .setup-journey .tune-phases { grid-template-columns: minmax(0, 1fr); }
    .setup-journey .station__head { padding: 14px 16px; column-gap: 12px; }
    .setup-journey .station__body { padding: 0 16px 18px; }
    .setup-journey .station::before { left: 31px; }
}

/* Embed mode (?embed=1): the host signs in, so the page shows what the
   original shows embedded: the background and stream sections, without
   the step chrome. */
html.embed-wb .setup-journey { background: transparent; box-shadow: none; }
html.embed-wb .setup-journey::after,
html.embed-wb .setup-journey .station::before,
html.embed-wb .setup-journey .station__head,
html.embed-wb .setup-journey .station__lead,
html.embed-wb .setup-journey .station__help,
html.embed-wb .setup-journey .station-continue,
html.embed-wb #stepAuth,
html.embed-wb #stepTune { display: none; }
html.embed-wb .setup-journey .station { border: 0; background: transparent; }
html.embed-wb .setup-journey .station > .station__body { display: block; padding: 0 0 20px; animation: none; }
