/* HPC-AC v360 — senior UI/UX governance and competency dictionary workspace.
 * No-build, additive overrides only. Keeps operational pages dense, readable,
 * keyboard-visible, and responsive without changing lifecycle behavior.
 */

body[data-assessment-module="1"] :where(button, a, input, select, textarea):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--color-primary, #1c8fbd) 32%, transparent);
    outline-offset: 2px;
}

body[data-assessment-module="1"] :where(.ui-page, .assessment-page, .adw-page, [data-assessment-admin-page]) {
    width: 100%;
    max-width: none;
}

body[data-assessment-module="1"] :where(.assessment-form-grid, .ui-form-grid, .participant-level-grid) {
    align-items: start;
}

body[data-assessment-module="1"] :where(table) th {
    vertical-align: bottom;
}

body[data-assessment-module="1"] :where(.ui-table-wrap, .assessment-table-wrap, .hpc-blueprint-table-wrap) {
    overflow: auto;
    overscroll-behavior-inline: contain;
}

/* Review handoff: remove the large empty region shown in the reported desktop UI. */
@media (min-width: 1440px) {
    body[data-assessment-module="1"] .adw-shell--review {
        display: grid;
        grid-template-columns: minmax(17rem, 21rem) minmax(34rem, 1fr) minmax(18rem, 22rem);
        grid-template-areas: "rail main side";
        gap: 1rem;
        align-items: start;
    }

    body[data-assessment-module="1"] .adw-shell--review > .adw-rail {
        grid-area: rail;
        position: sticky;
        top: var(--app-shell-sticky-offset, 8.25rem);
        max-height: calc(100vh - var(--app-shell-sticky-offset, 8.25rem) - 1rem);
        overflow: auto;
    }

    body[data-assessment-module="1"] .adw-shell--review > .adw-main {
        grid-area: main;
        min-width: 0;
    }

    body[data-assessment-module="1"] .adw-shell--review > .adw-side {
        grid-area: side;
        position: sticky;
        top: var(--app-shell-sticky-offset, 8.25rem);
        max-height: calc(100vh - var(--app-shell-sticky-offset, 8.25rem) - 1rem);
        overflow: auto;
    }
}

@media (min-width: 1050px) and (max-width: 1439px) {
    body[data-assessment-module="1"] .adw-shell--review {
        display: grid;
        grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
        grid-template-areas: "rail main" "rail side";
        gap: 1rem;
        align-items: start;
    }
    body[data-assessment-module="1"] .adw-shell--review > .adw-rail { grid-area: rail; position: sticky; top: 8rem; max-height: calc(100vh - 9rem); overflow: auto; }
    body[data-assessment-module="1"] .adw-shell--review > .adw-main { grid-area: main; min-width: 0; }
    body[data-assessment-module="1"] .adw-shell--review > .adw-side { grid-area: side; }
}

body[data-assessment-module="1"] .adw-shell--review :where(.adw-panel-body, .adw-tab-panel) {
    padding: clamp(.8rem, 1.2vw, 1.15rem);
}
body[data-assessment-module="1"] .adw-shell--review .adw-section + .adw-section { margin-top: .85rem; padding-top: .85rem; }
body[data-assessment-module="1"] .adw-shell--review .adw-action-stack { display: grid; gap: .55rem; }
body[data-assessment-module="1"] .adw-shell--review .adw-action-stack .adw-button { width: 100%; justify-content: center; }
body[data-assessment-module="1"] .adw-shell--review .adw-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 840px) {
    body[data-assessment-module="1"] .adw-shell--review { display: block; }
    body[data-assessment-module="1"] .adw-shell--review > * + * { margin-top: 1rem; }
    body[data-assessment-module="1"] .adw-shell--review .adw-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Competency dictionary */
.acd-page { display: grid; gap: 1rem; }
.acd-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; border: 1px solid #dbe4ef; border-radius: 1rem; background: linear-gradient(135deg, #fff, #f6f9fd); }
.acd-eyebrow { color: #0f668b; font-size: .72rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.acd-hero h2 { margin: .25rem 0; font-size: clamp(1.2rem, 2vw, 1.65rem); }
.acd-hero p { max-width: 72ch; color: #526276; }
.acd-hero__actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.acd-alert { padding: .8rem 1rem; border-radius: .8rem; font-weight: 700; }
.acd-alert.is-danger { border: 1px solid #fecaca; background: #fff1f2; color: #9f1239; }
.acd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.acd-stats article { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border: 1px solid #dbe4ef; border-radius: .85rem; background: #fff; }
.acd-stats span { color: #64748b; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.acd-stats strong { font-size: 1.4rem; color: #173b63; }
.acd-toolbar { display: grid; grid-template-columns: minmax(18rem, 1fr) repeat(2, minmax(10rem, 14rem)); gap: .75rem; align-items: end; padding: .85rem; border: 1px solid #dbe4ef; border-radius: .9rem; background: #fff; }
.acd-toolbar label { display: grid; gap: .3rem; color: #526276; font-size: .75rem; font-weight: 800; }
.acd-toolbar :where(input, select) { width: 100%; border: 1px solid #cbd5e1; border-radius: .65rem; padding: .62rem .72rem; background: #fff; }
.acd-grid { display: grid; gap: .7rem; }
.acd-card { border: 1px solid #dbe4ef; border-radius: .9rem; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .04); }
.acd-card.is-open { border-color: #8bc7df; box-shadow: 0 12px 32px rgba(28, 143, 189, .10); }
.acd-card__summary { width: 100%; display: grid; grid-template-columns: 7rem minmax(16rem, 1fr) auto auto 1.2rem; gap: .8rem; align-items: center; padding: .9rem 1rem; border: 0; background: transparent; text-align: left; cursor: pointer; }
.acd-card__summary:hover { background: #f8fbfd; }
.acd-code { width: max-content; border-radius: 999px; padding: .3rem .55rem; background: #eef7fb; color: #0f668b; font-size: .72rem; font-weight: 900; }
.acd-card__title { display: grid; gap: .2rem; min-width: 0; }
.acd-card__title strong { color: #172b46; }
.acd-card__title small { color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acd-card__metrics { color: #526276; font-size: .78rem; white-space: nowrap; }
.acd-badge { display: inline-flex; border-radius: 999px; padding: .28rem .55rem; font-size: .7rem; font-weight: 900; }
.acd-badge.is-published { background: #dcfce7; color: #166534; }
.acd-badge.is-draft { background: #fef3c7; color: #92400e; }
.acd-badge.is-archived { background: #e2e8f0; color: #475569; }
.acd-chevron { font-size: 1.2rem; }
.acd-card__body { border-top: 1px solid #e2e8f0; padding: 1rem; background: #fbfdff; }
.acd-provenance { display: grid; grid-template-columns: 16rem 1fr; gap: 1rem; margin-bottom: .9rem; }
.acd-provenance span { color: #0f668b; font-weight: 800; }
.acd-provenance p { color: #475569; }
.acd-level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: .75rem; }
.acd-level { border: 1px solid #dbe4ef; border-radius: .8rem; background: #fff; overflow: hidden; }
.acd-level header { display: flex; justify-content: space-between; gap: .6rem; padding: .65rem .75rem; background: #f1f7fb; }
.acd-level header span { font-weight: 900; color: #173b63; }
.acd-level header strong { color: #0f668b; font-size: .73rem; text-align: right; }
.acd-level > p { padding: .7rem .75rem 0; color: #475569; font-size: .82rem; }
.acd-level ol { display: grid; gap: .45rem; padding: .75rem 1rem 1rem 2rem; }
.acd-level li { color: #334155; font-size: .8rem; }
.acd-level li b { margin-right: .35rem; color: #0f668b; }
.acd-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; padding-top: .9rem; }
.acd-empty { padding: 2rem; border: 1px dashed #cbd5e1; border-radius: .9rem; text-align: center; color: #64748b; }

/* Participant current/target levels and session blueprint targeting */
.participant-level-card { padding: .9rem; border: 1px solid #bae6fd; border-radius: .85rem; background: #f0f9ff; }
.participant-level-card__heading h3 { margin: 0; color: #075985; font-size: .95rem; }
.participant-level-card__heading p { margin: .2rem 0 .7rem; color: #0369a1; font-size: .78rem; }
.participant-level-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.participant-level-grid small { display: block; margin-top: .3rem; color: #64748b; font-size: .72rem; }
.hpc-blueprint-auto-level { display: inline-flex; max-width: 10rem; padding: .35rem .5rem; border-radius: .55rem; background: #eef7fb; color: #0f668b; font-size: .72rem; font-weight: 800; }
.hpc-blueprint-warning-text { display: block; margin-top: .35rem; max-width: 12rem; color: #b45309; font-size: .68rem; font-weight: 700; }

/* Evidence command center level provenance */
.aec-level-resolution { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.aec-level-resolution span { display: inline-flex; border-radius: 999px; padding: .26rem .5rem; background: #eef7fb; color: #0f668b; font-size: .7rem; font-weight: 850; }
.aec-level-explanation { margin-top: .45rem; color: #526276; font-size: .75rem; }

@media (max-width: 900px) {
    .acd-hero { flex-direction: column; }
    .acd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .acd-toolbar { grid-template-columns: 1fr 1fr; }
    .acd-search { grid-column: 1 / -1; }
    .acd-card__summary { grid-template-columns: 1fr auto; }
    .acd-code, .acd-card__metrics { display: none; }
    .acd-card__title { grid-column: 1; }
    .acd-badge, .acd-chevron { grid-column: 2; }
    .acd-provenance { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .acd-stats, .acd-toolbar, .participant-level-grid { grid-template-columns: 1fr; }
    .acd-search { grid-column: auto; }
    .acd-card__summary { padding: .75rem; }
}
