/* Unit Control · wizards by steps (PBI #660 «Nueva unidad», #661 «Nuevo evento»): the steps at the top, the
   step itself, what is folded («Más datos»), the summary and the foot (Back · draft saved · the main action, the only
   gold one). Console surface, the graphic language of #630. In the app layer (tokens.css declares the layers). */
@layer app {
    .uc-wizard .fcc-dialog-body { display:grid; gap:14px; align-content:start; }

    /* ---------- Steps ---------- */
    .uc-wizard-steps {
        display:flex;
        gap:6px;
        margin:0;
        padding:0;
        list-style:none;
    }
    .uc-wizard-steps li {
        flex:1;
        display:flex;
        align-items:center;
        gap:8px;
        min-width:0;
        padding:6px 10px;
        border:1px solid var(--line);
        border-radius:var(--uc-radius);
        color:var(--on-surface-muted);
        font-family:var(--ag-sans);
        font-size:var(--fs-label);
    }
    .uc-wizard-steps li span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .uc-wizard-steps b {
        flex:none;
        display:grid;
        place-items:center;
        width:22px;
        height:22px;
        border:1px solid currentColor;
        border-radius:var(--radius-round);
        font-size:var(--fs-label);
    }
    .uc-wizard-steps li.is-current { border-color:var(--gold); color:var(--on-surface); }
    .uc-wizard-steps li.is-current b { border-color:var(--gold); background:var(--gold); color:var(--btn-primary-text); }
    .uc-wizard-steps li.is-done { color:var(--on-surface-2); }
    /* Changing a record that exists: the whole step is the button that opens it. */
    .uc-wizard-steps li:has(> .uc-wizard-step-open) { padding:0; }
    .uc-wizard-step-open {
        display:flex;
        flex:1;
        align-items:center;
        justify-content:inherit;
        gap:8px;
        min-width:0;
        min-height:44px;
        padding:6px 10px;
        border:0;
        background:none;
        color:inherit;
        font:inherit;
        cursor:pointer;
    }

    /* ---------- The step ---------- */
    .uc-wizard-step { display:grid; gap:12px; }
    .uc-wizard-title {
        margin:0;
        color:var(--on-surface-title);
        font-family:var(--ag-display);
        font-size:1.05rem;
        letter-spacing:.04em;
        text-transform:uppercase;
    }
    .uc-wizard-title:focus { outline:none; }
    .uc-wizard-title:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
    .uc-wizard-subtitle { margin:6px 0 0; color:var(--on-surface-2); font-size:var(--fs-label); letter-spacing:var(--uc-label-tracking); text-transform:uppercase; }
    .uc-wizard-more { border-top:1px solid var(--line); padding-top:8px; }
    .uc-wizard-more > summary {
        display:flex;
        align-items:center;
        min-height:44px;
        color:var(--on-surface-2);
        cursor:pointer;
        font-size:var(--fs-meta);
    }
    .uc-wizard-more[open] > summary { margin-bottom:8px; }
    .uc-wizard-restored {
        display:flex;
        flex-wrap:wrap;
        align-items:center;
        justify-content:space-between;
        gap:8px;
        padding:6px 10px;
        border-left:3px solid var(--gold);
        color:var(--on-surface-2);
        font-size:var(--fs-meta);
    }

    /* ---------- Summary ---------- */
    .uc-wizard-summary { display:grid; grid-template-columns:max-content 1fr; gap:6px 14px; margin:0; }
    .uc-wizard-summary dt { color:var(--uc-label-dark); font-size:var(--uc-label-size); letter-spacing:var(--uc-label-tracking); }
    .uc-wizard-summary dd { margin:0; color:var(--on-surface); overflow-wrap:anywhere; }

    /* ---------- Foot: Back on the left, the main action on the right ---------- */
    .uc-wizard-foot { display:flex; flex-wrap:wrap; align-items:center; gap:8px; width:100%; }
    .uc-wizard-foot .btn { min-height:44px; }
    .uc-wizard-saved { margin-right:auto; color:var(--on-surface-muted); font-size:var(--fs-meta); }
    .uc-wizard-foot .btn-reason { flex-basis:100%; text-align:right; }

    @media (max-width: 700px) {
        .uc-wizard-steps li, .uc-wizard-step-open { padding:6px; }
        .uc-wizard-steps li:not(.is-current) span { display:none; }
        .uc-wizard-foot .btn-primary { flex:1; }
    }
}
