/* ============================================================================
   CREATE-TEST WORKSHOP (/tests/new)
   Shell only: the steps, the cover preview and the pickers wear the shared
   .ctm-* styles of test-constructor.css, so the page and the app flow cannot
   drift apart. What lives here is the page frame the modal never needed —
   a title row, the two-column split and the pinned preview.
   ========================================================================= */

.ctp-root {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
}

/* ---------- Draft note in the page bar ---------- */

@media (hover: hover) {
}

.ctp-top__saved {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: var(--t-cap);
    color: var(--text-tertiary);
}

.ctp-top__reset {
    border: none;
    background: none;
    padding: 0;
    font-size: var(--t-cap);
    font-weight: var(--w-semi);
    color: var(--accent-action);
    cursor: pointer;
}

@media (hover: hover) {
    .ctp-top__reset:hover {
        text-decoration: underline;
    }
}

/* ---------- Two-column split ---------- */

.ctp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
    align-items: start;
}

.ctp-side {
    display: grid;
    gap: var(--s-2);
}

/* On narrow screens the preview stays above the steps, the way the app shows it. */
.ctp-side .ctm-preview {
    max-width: 340px;
}

.ctp-side__hint {
    margin: 0;
    font-size: var(--t-cap);
    color: var(--text-tertiary);
}

.ctp-form {
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}

/* The progress bar heads the step column; on the page it needs no sticky plate. */
.ctp-form .ctm-progress {
    padding: 0;
}

.ctp-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--s-3);
    padding-top: var(--s-2);
    border-top: 1px solid var(--border);
}

@media (min-width: 900px) {
    .ctp-grid {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    /* Steps lead, the cover follows them down the page. The column scrolls inside itself,
       so a tall preview never drags its own top up under the header. */
    .ctp-side {
        order: 2;
        position: sticky;
        top: var(--sticky-top);
        align-self: start;
        max-height: calc(100dvh - var(--sticky-top) - var(--s-5));
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        padding-right: 2px;
    }

    .ctp-form {
        order: 1;
    }

    .ctp-side .ctm-preview {
        max-width: none;
    }
}
