h1:focus {
    outline: none;
}

/* ---- Layout & typography ------------------------------------------------ */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1b1b1f;
    margin: 0;
    line-height: 1.5;
}

h1, h2, h3 {
    color: #12233b;
}

.btn {
    display: inline-block;
    border: 1px solid #2c5cc5;
    background: #2c5cc5;
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { background: #224aa0; }

.btn--ghost {
    background: transparent;
    color: #b3261e;
    border-color: #d8a7a3;
    padding: 0.2rem 0.6rem;
}

.btn--ghost:hover { background: #fbeceb; }

.preview-tag {
    font-size: 0.55em;
    vertical-align: middle;
    background: #ffd866;
    color: #5a4500;
    border-radius: 4px;
    padding: 0.1em 0.45em;
}

.lead { color: #444; max-width: 60ch; }
.hint { color: #6b6b6b; font-size: 0.85rem; }

/* ---- Top bar + language switcher ---------------------------------------- */
.app-topbar { display: flex; justify-content: flex-end; padding: 0.4rem 0.6rem; }
.lang-switch { display: inline-flex; gap: 0.25rem; font-size: 0.8rem; }
.lang-switch__link {
    color: #6b6b6b; text-decoration: none; padding: 0.1rem 0.4rem; border-radius: 4px;
}
.lang-switch__link:hover { background: #f0f0f4; }
.lang-switch__link--active { color: #1a1a1a; font-weight: 600; background: #ececf2; }

/* ---- Onboarding page layout --------------------------------------------- */
.onboarding-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16rem;
    gap: 2rem;
    align-items: start;
}

.onboarding-aside {
    position: sticky;
    top: 1rem;
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    padding: 1rem;
    background: #fafafc;
}

.aside__title { margin-top: 0; font-size: 1rem; }

/* Anchors are jump targets from the progress aside; keep them clear of the top. */
.onboarding-anchor { scroll-margin-top: 1rem; }

/* ---- Progress aside ----------------------------------------------------- */
.progress-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.progress-list__item { margin: 0; }

.progress-list__link {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3rem 0.25rem;
    border-radius: 6px;
    text-decoration: none;
    color: #1b1b1f;
}

.progress-list__link:hover { background: #eef1f8; }

.progress-list__mark {
    flex: none;
    min-width: 2.1rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #555;
    background: #e3e3e8;
    border-radius: 10px;
    padding: 0.05rem 0.3rem;
}

.progress-list__item--done .progress-list__mark { background: #4a7a4a; color: #fff; }
.progress-list__item--done .progress-list__label { color: #4a7a4a; }

/* ---- Help panel (in the aside, below progress) -------------------------- */
.help-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e3e3e8;
}

.help-panel__title { margin: 0 0 0.35rem; font-size: 0.95rem; }
.help-panel .hint { margin: 0 0 0.5rem; }
.help-panel__link { font-size: 0.9rem; font-weight: 600; color: #2c5cc5; word-break: break-all; }

.state-dl { display: grid; grid-template-columns: auto auto; gap: 0.2rem 0.75rem; margin: 0; }
.state-dl dt { color: #6b6b6b; }
.state-dl dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---- Schema renderer ---------------------------------------------------- */
.schema-section {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.schema-section__title { margin-top: 0; font-size: 1.15rem; }

.field { margin: 0.75rem 0; }
.field__head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.2rem; }
.field__label { font-weight: 600; font-size: 0.9rem; }
.field__required { color: #b3261e; margin-left: 0.15rem; }
.field__example { color: #6b6b6b; font-size: 0.8rem; font-style: italic; }

/* ---- Item help (?) & important notes ------------------------------------ */
.help-toggle {
    flex: none;
    width: 1.2rem;
    height: 1.2rem;
    padding: 0;
    line-height: 1;
    border: 1px solid #b9c6e6;
    background: #f5f8ff;
    color: #2c5cc5;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.help-toggle:hover { background: #e8eefb; }
.help-toggle[aria-expanded="true"] { background: #2c5cc5; color: #fff; border-color: #2c5cc5; }

.item-help {
    margin: 0.4rem 0 0;
    padding: 0.5rem 0.75rem;
    background: #f5f8ff;
    border: 1px solid #dde6f7;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #33415c;
}

.item-important {
    display: flex;
    gap: 0.6rem;
    margin: 0.5rem 0 0;
    padding: 0.5rem 0.75rem;
    background: #fff8e6;
    border: 1px solid #f0d98a;
    border-left: 3px solid #d8a300;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #5a4500;
}

.item-important__tag {
    flex: none;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #8a6d00;
    padding-top: 0.1rem;
}

.item-help :first-child,
.item-important__body :first-child { margin-top: 0; }
.item-help :last-child,
.item-important__body :last-child { margin-bottom: 0; }

.field__input {
    width: 100%;
    max-width: 32rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid #c2c2cc;
    border-radius: 6px;
    font: inherit;
}

.field--error .field__input { border-color: #b3261e; }

.field__path {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: #6b6b6b;
}

.field__message { color: #b3261e; font-size: 0.8rem; margin-top: 0.2rem; }

/* ---- Checklist ---------------------------------------------------------- */
.checklist { padding: 0.5rem 0; border-bottom: 1px dashed #ececf1; }
.checklist__row { display: flex; gap: 0.6rem; align-items: flex-start; }
.checklist__box { margin-top: 0.3rem; flex: none; width: 1.1rem; height: 1.1rem; }
.checklist__body :first-child { margin-top: 0; }
.checklist__body :last-child { margin-bottom: 0; }
.checklist--done .checklist__body { color: #4a7a4a; }
.checklist__gate { color: #8a6d00; font-size: 0.8rem; margin: 0.25rem 0 0 1.7rem; }

/* ---- List --------------------------------------------------------------- */
.list { margin: 0.75rem 0; }
.list__head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.4rem; }
.list__empty { color: #6b6b6b; font-size: 0.85rem; margin: 0.25rem 0; }
.list__table { border-collapse: collapse; width: 100%; max-width: 48rem; margin-bottom: 0.5rem; }
.list__table th { text-align: left; font-size: 0.8rem; color: #6b6b6b; padding: 0.2rem 0.4rem; }
.list__table td { padding: 0.2rem 0.4rem; vertical-align: top; }
.list__cell--error .field__input { border-color: #b3261e; }
.list__actions { width: 1%; white-space: nowrap; }
/* GUID columns (e.g. workspace-access object IDs) need room for a full 36-char hyphenated GUID. */
.list__table .field__input--guid { min-width: 22rem; }

/* ---- Access group (one list per bound set entry, e.g. per environment) --- */
.access-group__entry { margin: 0.75rem 0; padding-left: 0.75rem; border-left: 2px solid #e3e3e8; }
.access-group__entry .list { margin-top: 0.25rem; }

/* ---- Opt-in toggle (reveals the items gated on it) ---------------------- */
.toggle { margin: 0.75rem 0; }
.toggle__row { display: flex; align-items: center; gap: 0.5rem; }
.toggle__control { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.toggle__label { font-weight: 500; }

/* ---- Adopt grid (existing-resource names per set entry / per pair) ------- */
.matrix { margin: 0.75rem 0; }
.matrix__scroll { overflow-x: auto; }
.matrix__table { max-width: none; }
.matrix__table th, .matrix__table td { white-space: nowrap; }
.matrix__rowhead { color: #1a1a1a; font-weight: 600; padding-right: 0.6rem; }
.matrix__table .field__input { min-width: 12rem; }

/* ---- Bounded value set (environments, domains) -------------------------- */
.set { margin: 0.75rem 0; }
.set__rows { margin-bottom: 0.5rem; }
.set__row { margin-bottom: 0.4rem; max-width: 48rem; }
.set__control { display: flex; gap: 0.5rem; align-items: center; }
.set__control .field__input { max-width: 22rem; }
.set__control .field__input.set__abbr { max-width: 11rem; }
.set__control .field__input[readonly] { background: #f3f3f6; color: #555; }
.set__badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b6b6b;
    background: #ececf1;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}
.set__bounds { margin: 0.35rem 0 0; }
.set__meta-field { margin: 0.35rem 0 0 0.25rem; padding-left: 0.6rem; border-left: 2px solid #ececf1; max-width: 34rem; }
.set__meta-label { display: block; font-size: 0.78rem; color: #555; margin-bottom: 0.2rem; }
.field__input.set__description { max-width: 34rem; width: 100%; }
.set__badge--admin { color: #7a4b00; background: #fbe6cf; margin-left: 0.4rem; }
.set__depends-options { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; }
.set__depends-option { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; }
.field__input--error { border-color: #b3261e; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: #2c5cc5; }
.btn--ghost:disabled:hover { background: transparent; }

/* ---- Operator dashboard ------------------------------------------------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-head__user { display: flex; align-items: center; gap: 0.75rem; }
.row-actions { white-space: nowrap; }
.row-actions__link { margin-right: 0.9rem; font-size: 0.9rem; }

/* Progress counter pill — same look as the form aside's section marks. */
.progress-pill {
    display: inline-block;
    min-width: 2.1rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #555;
    background: #e3e3e8;
    border-radius: 10px;
    padding: 0.05rem 0.4rem;
}

.progress-pill--done { background: #4a7a4a; color: #fff; }

/* ---- Code gate (the only thing shown before a code is entered) ---------- */
.gate {
    max-width: 26rem;
    margin: 4rem auto 0;
    text-align: center;
}

.gate__title { font-size: 1.6rem; margin-bottom: 0.25rem; }
.gate__prompt { color: #555; margin-top: 0; }
.gate__form { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.25rem; }
.gate__input { max-width: 18rem; }

/* ---- Resume / dev / status --------------------------------------------- */
.resume-card {
    border: 1px solid #e3e3e8;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    max-width: 36rem;
}

.resume-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.resume-form .field__input { max-width: 24rem; }
.resume-test { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.6rem 0 0; }

.code-reveal {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px dashed #b9c6e6;
    border-radius: 6px;
    background: #f5f8ff;
}

.code-reveal__row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.code-reveal__code {
    display: inline-block;
    font-size: 1rem;
    letter-spacing: 0.05em;
    background: #fff;
    border: 1px solid #c2c2cc;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    word-break: break-all;
}

.save-status { color: #4a7a4a; font-size: 0.85rem; margin: 0.5rem 0 0; }

.error-banner {
    border: 1px solid #d8a7a3;
    background: #fbeceb;
    color: #7a1d17;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    max-width: 36rem;
}

/* ---- Verify status ------------------------------------------------------ */
.verify-status {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.verify-status--run { background: #fff4d6; color: #7a5b00; }
.verify-status--ok { background: #e3f4e3; color: #2f6f2f; }
.verify-status--fail { background: #fbeceb; color: #7a1d17; }

/* ---- Federation panel --------------------------------------------------- */
.fed-panel { background: #fafafc; }
.fed-done { color: #2f6f2f; font-weight: 600; }
.fed-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.fed-command {
    background: #12233b;
    color: #e8eefb;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yM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NjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}