/* Simple project setup — white wrapper over the create job */
body.setup-mode {
    background: var(--white);
}
body.setup-mode .status-bar,
body.setup-mode .assistant-fab,
body.setup-mode .validation-panel-tab,
body.setup-mode .project-setup-strip {
    display: none !important;
}
/* One frame for every step: the tabs, progress and action bar keep their place;
   only the content between them is a 1200 px column or, for the map and the
   programme workspace (.pf), the full width. */
#setup-shell {
    position: relative;
    background: var(--white);
    min-height: calc(100vh - var(--sticky-header-offset));
    padding: 24px 24px 0;
}
.setup-busy {
    position: fixed;
    top: var(--sticky-header-offset);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    cursor: wait;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(var(--white-rgb), 0.9);
    color: var(--gray-700);
    font-size: 15px;
}
.setup-busy[hidden] {
    display: none;
}
.setup-busy .spinner {
    width: 28px;
    height: 28px;
    border-width: 3px;
}
.setup-shell {
    --setup-column: 1200px;
    --setup-rail-w: var(--brief-rail-w, 400px);
    --setup-rail-gap: 28px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--sticky-header-offset) - 24px);
}
.setup-shell-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
#setup-panel-projects {
    padding-bottom: 48px;
}
#setup-panel-new:not([hidden]) {
    display: flex;
    flex: 1;
    flex-direction: column;
}
.setup-tabs {
    display: flex;
    gap: 28px;
}
.setup-tab {
    padding: 0 0 8px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--gray-500);
    font: inherit;
    font-size: 16px;
    cursor: pointer;
}
.setup-tab.is-active {
    color: var(--gray-900);
    border-bottom-color: var(--accent);
}
.setup-advanced {
    padding: 0;
    border: none;
    background: none;
    color: var(--gray-500);
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}
.setup-advanced:hover {
    color: var(--gray-800);
}
.setup-org-back {
    display: block;
    margin-bottom: 16px;
}
.setup-tenant select,
.setup-field input,
.setup-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font: inherit;
    background: var(--white);
}
.setup-progress {
    margin: 0 0 20px;
    color: var(--gray-500);
    font-size: 13px;
    letter-spacing: 0.01em;
}
/* The column: id-level selectors so step styles that set margins keep it centred. */
.setup-shell .setup-shell-top,
.setup-shell #setup-panel-projects,
.setup-shell .setup-progress,
.setup-shell #setup-error,
.setup-shell #setup-step > :not(.pf):not(.setup-split) {
    width: 100%;
    max-width: var(--setup-column);
    margin-left: auto;
    margin-right: auto;
}
.setup-shell #setup-step {
    padding-bottom: 28px;
}

/* Form steps: the step left, the Brief panel (.pf-panel, as on Context and
   Programme) right. The panel's collapsed and open states are in programme-rail.css. */
.setup-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--setup-rail-w);
    grid-template-areas: "main panel";
    align-items: start;
    width: 100%;
    max-width: none;
}
.setup-split-main {
    grid-area: main;
    min-width: 0;
    padding-right: var(--setup-rail-gap);
}
@media (min-width: 1100px) {
    .setup-split > .pf-panel {
        position: sticky;
        top: calc(var(--sticky-header-offset, 0px) + 12px);
        align-self: start;
        height: calc(100vh - var(--sticky-header-offset, 0px) - 160px);
        min-height: 320px;
    }
}
@media (max-width: 1099px) {
    .setup-split {
        display: block;
    }
    .setup-split-main {
        padding-right: 0;
    }
}
@keyframes setup-brief-focus {
    0% { background: rgba(var(--accent-rgb, 37, 99, 235), 0.12); }
    100% { background: transparent; }
}

/* One frame on every step with the panel: tabs, step list, heading, errors and
   actions line up with the work column, left of the panel. */
.setup-shell:has(#setup-step .is-panel-collapsed) {
    --setup-rail-w: 44px;
}
.setup-shell:has(#setup-step .pf .pf-panel) {
    --setup-rail-gap: 0px;
}
.setup-shell:has(#setup-panel-new:not([hidden]) #setup-step .pf-panel) .setup-shell-top,
.setup-shell #setup-panel-new:has(#setup-step .pf-panel) .setup-progress,
.setup-shell #setup-panel-new:has(#setup-step .pf-panel) #setup-error,
.setup-shell #setup-step:has(.pf-panel) > .setup-step-head {
    max-width: none;
    padding-right: calc(var(--setup-rail-w) + var(--setup-rail-gap));
}
.setup-shell #setup-panel-new:has(#setup-step .pf-panel) .setup-actions {
    padding-left: 0;
    padding-right: calc(var(--setup-rail-w) + var(--setup-rail-gap));
}
@media (max-width: 1099px) {
    .setup-shell {
        --setup-rail-w: 0px;
        --setup-rail-gap: 0px;
    }
    .setup-shell:has(#setup-step .is-panel-collapsed) {
        --setup-rail-w: 0px;
    }
}
.setup-progress strong {
    color: var(--gray-900);
    font-weight: 600;
}
.setup-progress-link {
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.setup-progress-link:hover:not(:disabled) {
    color: var(--gray-800);
}
.setup-progress-link:disabled {
    cursor: default;
    text-decoration: none;
}
/* Lanes: caption and brace sit above the steps, so every step shares one baseline. */
.setup-progress:has(.setup-progress-group) {
    padding-top: 30px;
    white-space: nowrap;
    overflow-x: auto;
}
.setup-progress-group {
    position: relative;
    display: inline-block;
}
.setup-progress-caption {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    color: var(--gray-400);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: help;
    text-decoration: underline dotted var(--gray-300);
    text-underline-offset: 3px;
}
.setup-progress-caption:hover,
.setup-progress-caption:focus-visible {
    color: var(--gray-600);
}
/* A horizontal curly brace: outer ends curl down to the steps, the point rises to the caption. */
.setup-progress-brace {
    position: absolute;
    bottom: calc(100% + 1px);
    left: 0;
    right: 0;
    height: 10px;
    pointer-events: none;
}
.setup-progress-brace::before {
    content: '';
    position: absolute;
    box-sizing: content-box;
    height: 4px;
    border: 0 solid var(--gray-300);
    top: 4px;
    left: 0;
    width: calc(50% - 7px);
    border-top-width: 1.5px;
    border-left-width: 1.5px;
    border-top-left-radius: 5px;
}
.setup-progress-brace::after {
    content: '';
    position: absolute;
    box-sizing: content-box;
    height: 4px;
    border: 0 solid var(--gray-300);
    top: 4px;
    left: calc(50% + 5.5px);
    right: 0;
    border-top-width: 1.5px;
    border-right-width: 1.5px;
    border-top-right-radius: 5px;
}
.setup-progress-brace i::before {
    content: '';
    position: absolute;
    box-sizing: content-box;
    height: 4px;
    border: 0 solid var(--gray-300);
    top: 0;
    left: calc(50% - 5.5px);
    width: 4px;
    border-bottom-width: 1.5px;
    border-right-width: 1.5px;
    border-bottom-right-radius: 5px;
}
.setup-progress-brace i::after {
    content: '';
    position: absolute;
    box-sizing: content-box;
    height: 4px;
    border: 0 solid var(--gray-300);
    top: 0;
    left: 50%;
    width: 4px;
    border-bottom-width: 1.5px;
    border-left-width: 1.5px;
    border-bottom-left-radius: 5px;
}
.setup-progress-group.is-skipped .setup-progress-brace {
    opacity: 0.6;
}
.setup-progress-group.is-skipped .setup-progress-brace::before,
.setup-progress-group.is-skipped .setup-progress-brace::after,
.setup-progress-group.is-skipped .setup-progress-brace i::before,
.setup-progress-group.is-skipped .setup-progress-brace i::after {
    border-style: dashed;
}
.setup-progress-group.is-skipped .setup-progress-steps {
    opacity: 0.6;
}
.setup-field {
    margin: 0 0 20px;
}
/* Two short fields side by side (Client and Number, Country and Language, ...). */
.setup-field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}
@media (max-width: 700px) {
    .setup-field-row { grid-template-columns: minmax(0, 1fr); }
}
/* Tip of a lane caption (editor-setup-lane-tips.js): on the body, under the caption. */
.setup-lane-tip {
    position: fixed;
    z-index: 1000;
    max-width: 300px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--gray-900);
    color: var(--white);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-line;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(var(--black-rgb), 0.18);
}
.setup-lane-tip[hidden] {
    display: none;
}
.setup-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--gray-800);
}
.setup-field-hint {
    margin: 6px 0 0;
    color: var(--danger);
    font-size: 13px;
}
.setup-field-hint:empty {
    display: none;
}
.setup-facts {
    margin: 0 0 20px;
}
.setup-facts-label {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--gray-800);
}
.setup-fact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    gap: 8px;
    margin: 0 0 8px;
    align-items: center;
}
.setup-fact-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font: inherit;
    background: var(--white);
}
.setup-fact-remove {
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
}
.setup-fact-remove:hover {
    color: var(--danger);
}
.setup-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font: inherit;
    background: var(--white);
    min-height: 120px;
    resize: vertical;
}
/* One bar for every step: Back, save status, Skip, Continue. At the bottom of
   the screen even on short steps; the line spans the frame, the buttons the column. */
.setup-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding: 12px max(0px, calc((100% - var(--setup-column)) / 2)) 16px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}
.setup-actions-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.setup-save-status {
    margin-right: 8px;
    color: var(--gray-500);
    font-size: 13px;
    white-space: nowrap;
}
.setup-save-status:empty {
    display: none;
}
.setup-save-status.is-failed {
    color: var(--danger);
}
.setup-save-status .setup-inline-link {
    margin-left: 4px;
}
.setup-skip {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-700);
    font: inherit;
    font-size: 14px;
    line-height: normal;
    cursor: pointer;
}
.setup-skip[hidden] {
    display: none;
}
.setup-back {
    padding: 0;
    border: none;
    background: none;
    color: var(--gray-600);
    font: inherit;
    cursor: pointer;
}
.setup-back[hidden] {
    visibility: hidden;
}
.setup-error {
    min-height: 1.2em;
    margin: 16px 0 0;
    color: var(--danger);
    font-size: 14px;
}
.setup-error:empty {
    display: none;
}
.setup-project-search {
    display: block;
    margin: 0 0 8px;
}
.setup-project-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.setup-project-search input {
    width: 100%;
    padding: 8px 0 10px;
    border: none;
    border-bottom: 1px solid var(--gray-300);
    border-radius: 0;
    font: inherit;
    font-size: 16px;
    background: transparent;
    color: var(--gray-900);
}
.setup-project-search input:focus {
    outline: none;
    border-bottom-color: var(--gray-900);
}
.setup-project-row[hidden] {
    display: none !important;
}
.setup-project-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 16px 0;
    border: none;
    border-bottom: 1px solid var(--gray-200);
    background: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.setup-project-row:hover .setup-project-name {
    text-decoration: underline;
}
.setup-project-name {
    color: var(--gray-900);
}
.setup-project-status {
    color: var(--gray-500);
    font-size: 13px;
    white-space: nowrap;
}
