:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --form-primary: oklch(var(--p));
    --form-primary-content: oklch(var(--pc));
    --form-primary-soft: color-mix(in oklab, oklch(var(--p)) 9%, oklch(var(--b1)));
    --form-primary-hover: color-mix(in oklab, oklch(var(--p)) 88%, black);
    --form-success: oklch(var(--su));
    --form-success-soft: color-mix(in oklab, oklch(var(--su)) 10%, oklch(var(--b1)));
    --form-success-border: color-mix(in oklab, oklch(var(--su)) 55%, oklch(var(--b1)));
}

.reference-text {
    white-space: pre-line;
}

.collapse-content {
    transition: none;
    padding-bottom: 0.5rem;
}

.notification-toasts {
    position: fixed;
    z-index: 60;
    top: 4.75rem;
    right: 1rem;
    display: grid;
    width: min(24rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 5.75rem);
    gap: 0.65rem;
    overflow-y: auto;
    pointer-events: none;
}

.notification {
    --notification-accent: oklch(var(--in));
    --notification-soft: color-mix(in oklab, oklch(var(--in)) 8%, oklch(var(--b1)));
    --notification-border: color-mix(in oklab, oklch(var(--in)) 30%, oklch(var(--b1)));
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr) 2.75rem;
    align-items: start;
    gap: 0.65rem;
    padding: 0.65rem 0.5rem 0.65rem 0.85rem;
    border: 1px solid var(--notification-border);
    border-left: 3px solid var(--notification-accent);
    border-radius: 0.75rem;
    background: var(--notification-soft);
    color: oklch(var(--bc));
    font-size: 0.875rem;
    line-height: 1.45;
}

.notification-success {
    --notification-accent: oklch(var(--su));
    --notification-soft: color-mix(in oklab, oklch(var(--su)) 8%, oklch(var(--b1)));
    --notification-border: color-mix(in oklab, oklch(var(--su)) 30%, oklch(var(--b1)));
}

.notification-error {
    --notification-accent: oklch(var(--er));
    --notification-soft: color-mix(in oklab, oklch(var(--er)) 7%, oklch(var(--b1)));
    --notification-border: color-mix(in oklab, oklch(var(--er)) 30%, oklch(var(--b1)));
}

.notification-warning {
    --notification-accent: oklch(var(--wa));
    --notification-soft: color-mix(in oklab, oklch(var(--wa)) 9%, oklch(var(--b1)));
    --notification-border: color-mix(in oklab, oklch(var(--wa)) 35%, oklch(var(--b1)));
}

.notification-toast {
    box-shadow: 0 0.75rem 2rem color-mix(in oklab, oklch(var(--bc)) 13%, transparent);
    pointer-events: auto;
}

.notification-inline {
    margin-bottom: 1rem;
}

.notification-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.05rem;
    color: var(--notification-accent);
}

.notification-content {
    align-self: center;
    min-width: 0;
}

.notification-title {
    display: block;
    margin-bottom: 0.1rem;
    font-weight: 700;
}

.notification-dismiss {
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    margin: -0.55rem -0.2rem -0.55rem 0;
    padding: 0.7rem;
    color: oklch(var(--bc) / 0.6);
}

.notification-dismiss:hover {
    color: oklch(var(--bc));
}

.notification-dismiss svg {
    width: 100%;
    height: 100%;
}

.notification-local:focus-visible {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
    border-radius: 0.75rem;
}

.notification[data-auto-dismiss] {
    transition: opacity 180ms ease, transform 180ms ease;
}

.notification[data-auto-dismiss].is-dismissing {
    transform: translateY(-0.25rem);
    opacity: 0;
}

@media (max-width: 640px) {
    .notification-toasts {
        top: 4.5rem;
        right: 1rem;
        left: 1rem;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notification[data-auto-dismiss],
    .profile-goal-field input,
    .profile-cycle-goal-row input {
        transition: none;
    }
}

@media print {
    .notification-toasts,
    .notification-inline-stack,
    .notification-dismiss {
        display: none;
    }
}

.category-layout {
    display: grid;
    min-width: 0;
    grid-template-columns: 4rem minmax(0, 1fr);
    align-items: start;
    gap: 0.5rem 0.75rem;
    padding: 0.65rem 0.75rem;
}

.category-code {
    padding-top: 0.125rem;
    color: oklch(var(--p));
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
}

.category-heading {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.category-heading h3 {
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
}

.qualifier-matrix {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-column: 1 / -1;
    gap: 0.2rem;
    border: 1px solid color-mix(in oklab, oklch(var(--bc)) 12%, transparent);
    border-radius: 0.375rem;
    background: color-mix(in oklab, oklch(var(--bc)) 3%, transparent);
    padding: 0.45rem 0.5rem;
}

.qualifier-scale,
.qualifier-row {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr) 1.5rem;
    align-items: center;
    gap: 0.25rem;
}

.qualifier-label {
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.2;
}

.qualifier-options {
    display: grid;
    grid-template-columns: repeat(var(--option-count), minmax(0, 1fr));
    gap: 0.125rem;
}

.qualifier-option {
    display: flex;
    min-width: 0;
    min-height: 1.65rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    padding: 0.125rem;
}

.qualifier-option:hover {
    background: color-mix(in oklab, oklch(var(--bc)) 6%, transparent);
}

.qualifier-option .radio {
    flex-shrink: 0;
    margin: 0;
}

.qualifier-value {
    display: flex;
    align-items: center;
    justify-content: center;
    color: color-mix(in oklab, oklch(var(--bc)) 70%, transparent);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.qualifier-option:has(input:checked) {
    border-color: oklch(var(--p));
    background: color-mix(in oklab, oklch(var(--p)) 12%, transparent);
}

.qualifier-option:has(input:focus-visible) {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

.qualifier-option:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.35;
}

.qualifier-option.tooltip::before {
    z-index: 50;
    width: max-content;
    max-width: 15rem;
    white-space: normal;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.3;
}

.qualifier-option:focus-within::before,
.qualifier-option:focus-within::after {
    opacity: 1;
}

.qualifier-clear {
    width: 1.5rem;
    min-height: 1.5rem;
    height: 1.5rem;
    padding: 0;
    font-size: 1rem;
}

.chapter-summary {
    display: flex;
    min-height: 1.75rem;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-radius: 0.25rem;
    padding: 0.375rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    list-style: none;
}

.chapter-summary::-webkit-details-marker {
    display: none;
}

.chapter-summary:focus-visible {
    outline: 2px solid var(--p);
    outline-offset: -1px;
}

.chapter-chevron {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    transition: transform 120ms ease;
}

.chapter-disclosure:not([open]) > .chapter-summary .chapter-chevron {
    transform: rotate(-90deg);
}

.chapter-content {
    padding: 0.125rem 0 0.375rem;
}

@media (prefers-reduced-motion: reduce) {
    .chapter-chevron {
        transition: none;
    }
}

.source-bar {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;
    border-top: 1px solid color-mix(in oklab, oklch(var(--bc)) 10%, transparent);
    padding: 0.5rem 0.75rem;
}

.source-heading {
    flex-shrink: 0;
    padding-top: 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.source-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.65rem;
}

.source-option {
    display: flex;
    min-height: 1.5rem;
    cursor: pointer;
    align-items: center;
    gap: 0.3rem;
    border-radius: 0.25rem;
    padding: 0.15rem 0.25rem;
    font-size: 0.72rem;
    line-height: 1.2;
}

.source-option:hover,
.source-option:has(input:checked) {
    background: color-mix(in oklab, oklch(var(--bc)) 7%, transparent);
}

.source-option:has(input:focus-visible) {
    outline: 2px solid oklch(var(--p));
    outline-offset: 1px;
}

.category-reference {
    margin: 0 0.75rem;
    border-top: 1px solid color-mix(in oklab, oklch(var(--bc)) 10%, transparent);
    padding: 0.5rem 0;
    color: color-mix(in oklab, oklch(var(--bc)) 76%, transparent);
    font-size: 0.78rem;
    line-height: 1.45;
}

.category-reference-details {
    margin-top: 0.35rem;
}

.category-reference-details > summary,
.detailed-notes > summary {
    display: inline-flex;
    cursor: pointer;
    align-items: center;
    gap: 0.25rem;
    border-radius: 0.25rem;
    color: color-mix(in oklab, oklch(var(--bc)) 68%, transparent);
    font-size: 0.75rem;
    font-weight: 650;
    list-style: none;
}

.category-reference-details > summary::-webkit-details-marker,
.detailed-notes > summary::-webkit-details-marker {
    display: none;
}

.category-reference-details > summary::before,
.detailed-notes > summary::before {
    content: "+";
    width: 0.75rem;
    font-size: 0.875rem;
    text-align: center;
}

.category-reference-details[open] > summary::before,
.detailed-notes[open] > summary::before {
    content: "−";
}

.category-reference-details > summary:focus-visible,
.detailed-notes > summary:focus-visible {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

.category-brief-note {
    display: grid;
    gap: 0.25rem;
    border-top: 1px solid color-mix(in oklab, oklch(var(--bc)) 10%, transparent);
    padding: 0.5rem 0.75rem;
}

.category-brief-note label {
    font-size: 0.75rem;
    font-weight: 700;
}

.category-brief-note label span,
.detailed-notes summary span {
    color: color-mix(in oklab, oklch(var(--bc)) 52%, transparent);
    font-weight: 400;
}

.detailed-notes {
    margin: 0 0.75rem 0.65rem;
}

.detailed-notes textarea {
    width: 100%;
    margin-top: 0.4rem;
}

@media (min-width: 768px) {
    .category-layout {
        grid-template-columns: 4rem minmax(14rem, 1fr) minmax(25rem, 30rem);
    }

    .category-code {
        grid-column: 1;
        grid-row: 1;
    }

    .category-heading {
        grid-column: 2;
        grid-row: 1;
    }

    .qualifier-matrix {
        grid-column: 3;
        grid-row: 1;
    }

    .category-brief-note {
        grid-template-columns: 12rem minmax(0, 1fr);
        align-items: center;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .qualifier-options {
        grid-template-columns: repeat(var(--option-count), minmax(0, 1fr));
    }

    .qualifier-option {
        min-height: 1.5rem;
        padding: 0.125rem;
    }

    .qualifier-option.tooltip::before {
        position: fixed;
        top: auto;
        right: auto;
        bottom: 0.75rem;
        left: 50%;
        max-width: calc(100vw - 2rem);
        transform: translateX(-50%);
    }

    .qualifier-option.tooltip:hover::before,
    .qualifier-option.tooltip:focus-within::before {
        transform: translateX(-50%);
    }

    .qualifier-option.tooltip::after {
        display: none;
    }

    .source-bar {
        display: block;
    }

    .source-options {
        margin-top: 0.25rem;
    }
}

.assessment-category[hidden],
.category-record[hidden],
.form-chapter[hidden],
.form-component[hidden],
.core-set-option[hidden] {
    display: none;
}

.core-set-marker {
    display: inline-block;
    width: 0.625rem;
    height: 0.625rem;
    flex-shrink: 0;
    cursor: help;
    border-radius: 999px;
    background: var(--core-set-color);
    box-shadow: 0 0 0 1px color-mix(in oklab, var(--bc) 18%, transparent);
}

.core-set-marker:focus-visible {
    outline: 2px solid var(--p);
    outline-offset: 2px;
}

.core-set-marker.tooltip:focus::before,
.core-set-marker.tooltip:focus::after {
    opacity: 1;
}

.core-set-marker.tooltip::before {
    width: max-content;
    max-width: 16rem;
    white-space: normal;
    text-align: left;
    line-height: 1.25;
}

.form-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.component-nav {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    overflow-x: auto;
    border-top: 1px solid color-mix(in oklab, oklch(var(--bc)) 10%, transparent);
    padding-top: 0.5rem;
}

.component-nav a {
    display: flex;
    min-width: max-content;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid color-mix(in oklab, oklch(var(--bc)) 12%, transparent);
    border-radius: 0.375rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 650;
}

.component-nav a:hover {
    border-color: oklch(var(--p));
    background: color-mix(in oklab, oklch(var(--p)) 7%, transparent);
}

.component-nav a:focus-visible {
    outline: 2px solid oklch(var(--p));
    outline-offset: 1px;
}

.component-nav-count {
    color: color-mix(in oklab, oklch(var(--bc)) 58%, transparent);
    font-size: 0.68rem;
    font-weight: 500;
}

.form-component {
    overflow: hidden;
    scroll-margin-top: 9rem;
    border: 1px solid color-mix(in oklab, oklch(var(--bc)) 16%, transparent);
    border-radius: 0.5rem;
    background: oklch(var(--b1));
}

.form-component-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid color-mix(in oklab, oklch(var(--bc)) 14%, transparent);
    background: #e7f1f8;
    padding: 0.75rem;
    color: #17232d;
}

.form-component-header h2 {
    font-size: 0.95rem;
    font-weight: 750;
}

.form-component-description {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.form-component-guidance {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    font-weight: 650;
}

.form-component-count {
    flex-shrink: 0;
    border: 1px solid #b8c7d2;
    border-radius: 999px;
    background: #fff;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 650;
}

.form-component-body {
    padding: 0.5rem;
}

.form-chapter {
    min-width: 0;
    margin-bottom: 0.375rem;
    border: 0;
    background: transparent;
}

.form-chapter > .chapter-summary {
    padding: 0.45rem 0.5rem;
    background: color-mix(in oklab, oklch(var(--bc)) 5%, transparent);
}

.form-chapter > .chapter-content {
    padding: 0.375rem 0 0.25rem;
}

.form-chapter-categories,
.form-category-children {
    display: grid;
    min-width: 0;
    gap: 0.5rem;
    margin-left: 0.75rem;
    border-left: 2px solid color-mix(in oklab, oklch(var(--bc)) 12%, transparent);
    padding-left: 0.5rem;
}

.form-child-chapters {
    margin: 0.5rem 0 0 0.5rem;
    border-left: 2px solid color-mix(in oklab, oklch(var(--bc)) 12%, transparent);
    padding-left: 0.5rem;
}

.form-child-chapters .form-chapter:last-child {
    margin-bottom: 0;
}

.form-category-context {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.375rem;
    border: 1px dashed color-mix(in oklab, oklch(var(--bc)) 16%, transparent);
    border-radius: 0.375rem;
    padding: 0.4rem 0.5rem;
    color: color-mix(in oklab, oklch(var(--bc)) 52%, transparent);
    font-size: 0.75rem;
    line-height: 1.3;
}

.assessment-category {
    min-width: 0;
    overflow: visible;
    border: 1px solid color-mix(in oklab, oklch(var(--bc)) 16%, transparent);
    border-radius: 0.375rem;
    background: oklch(var(--b1));
}

@media (max-width: 480px) {
    .form-toolbar-main .badge {
        order: 3;
    }

    .form-component-header {
        display: block;
        padding: 0.65rem;
    }

    .form-component-count {
        display: inline-block;
        margin-top: 0.5rem;
    }

    .form-component-body {
        padding: 0.35rem;
    }

    .category-layout {
        padding: 0.55rem;
    }

    .qualifier-matrix {
        padding: 0.35rem;
    }

    .form-chapter > .chapter-content {
        padding-right: 0;
        padding-left: 0;
    }

    .form-chapter-categories,
    .form-category-children,
    .form-child-chapters {
        margin-left: 0.25rem;
        padding-left: 0.25rem;
    }
}

.catalog-category-row {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 0.125rem;
    border-bottom: 1px solid color-mix(in oklab, var(--bc) 7%, transparent);
    padding: 0.125rem 0;
}

.catalog-toggle,
.catalog-toggle-spacer {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
}

.catalog-toggle {
    display: inline-flex;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    color: color-mix(in oklab, var(--bc) 60%, transparent);
}

.catalog-toggle:hover {
    background: color-mix(in oklab, var(--bc) 7%, transparent);
    color: var(--bc);
}

.catalog-toggle:focus-visible {
    outline: 2px solid var(--p);
    outline-offset: -1px;
}

.catalog-chevron {
    width: 0.875rem;
    height: 0.875rem;
    transform: rotate(-90deg);
    transition: transform 120ms ease;
}

.catalog-toggle[aria-expanded="true"] .catalog-chevron {
    transform: rotate(0);
}

.catalog-category-label {
    display: flex;
    min-width: 0;
    flex: 1;
    cursor: pointer;
    align-items: flex-start;
    gap: 0.375rem;
    border-radius: 0.25rem;
    padding: 0.375rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1.25;
}

.catalog-category-label:hover {
    background: color-mix(in oklab, var(--bc) 5%, transparent);
}

.catalog-category-label:has(input:checked) {
    background: color-mix(in oklab, var(--p) 7%, transparent);
}

.catalog-category-label:has(input:disabled) {
    cursor: default;
    color: color-mix(in oklab, var(--bc) 55%, transparent);
}

.catalog-category-label:has(input:focus-visible) {
    outline: 2px solid var(--p);
    outline-offset: -1px;
}

.catalog-category-label .checkbox {
    margin-top: 0.0625rem;
    flex-shrink: 0;
}

#category-picker:not([open]),
#assessment-loader:not([open]) {
    display: none;
}

#category-picker[open],
#assessment-loader[open] {
    padding: 0;
}

#category-picker .modal-box,
#assessment-loader .modal-box {
    border-radius: 0.75rem;
}

.catalog-item[hidden],
[data-catalog-branch][hidden],
[data-catalog-children][hidden] {
    display: none;
}

@media (max-width: 480px) {
    #category-picker .modal-box {
        max-height: 94dvh;
        height: 94dvh;
    }

    .catalog-category-label {
        gap: 0.3rem;
        padding-right: 0.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-chevron {
        transition: none;
    }
}

/* Assessment builder: one focused workspace with a persistent review action. */
.builder-page {
    --builder-ink: #173d38;
    --builder-body: #526a64;
    --builder-green: #176b5b;
    --builder-green-dark: #105247;
    --builder-mint: #e8f2ed;
    --builder-line: #cfddd6;
    background: #f7faf8;
    color: var(--builder-ink);
    font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
}

.builder-page nav {
    min-height: 4.25rem;
    border-color: var(--builder-line);
    background: rgba(255, 255, 255, 0.96);
}

.builder-page nav > div:first-child > a {
    color: var(--builder-ink);
}

.builder-page nav .btn-primary,
.builder-page .btn-primary {
    border-color: var(--builder-green);
    background: var(--builder-green);
    color: #fff;
}

.builder-page nav .btn-primary:hover,
.builder-page .btn-primary:hover {
    border-color: var(--builder-green-dark);
    background: var(--builder-green-dark);
}

.builder-page footer {
    border-color: var(--builder-line);
    background: #fff;
    color: var(--builder-body);
}

.site-footer p {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.6rem;
}

.site-footer a {
    color: var(--site-ink, var(--builder-ink, currentColor));
    text-decoration: underline;
    text-decoration-color: #b6cbc0;
    text-underline-offset: 0.2em;
}

.site-footer a:hover {
    color: var(--site-green, var(--builder-green, currentColor));
}

.builder-main {
    padding-bottom: 9rem;
}

.builder-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.builder-heading {
    max-width: 42rem;
}

.builder-heading h1 {
    font-size: clamp(1.75rem, 3vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.2;
}

.builder-heading p {
    margin-top: 0.55rem;
    color: var(--builder-body);
    font-size: 0.9rem;
    line-height: 1.65;
}

.builder-workflow-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: -0.25rem 0 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--builder-line);
}

.builder-workflow-copy strong {
    font-size: 0.82rem;
    font-weight: 800;
}

.builder-workflow-copy p {
    margin-top: 0.2rem;
    color: var(--builder-body);
    font-size: 0.78rem;
    line-height: 1.5;
}

.builder-workflow-choice .result-view-switch {
    flex-shrink: 0;
    border-color: var(--builder-line);
    background: var(--builder-mint);
}

.builder-workflow-choice .result-view-switch .btn.is-active {
    color: var(--builder-green-dark);
}

.builder-workflow-current {
    flex-shrink: 0;
    border-left: 3px solid var(--builder-green);
    padding-left: 0.65rem;
    color: var(--builder-green-dark);
    font-size: 0.82rem;
    font-weight: 800;
}

@media (max-width: 640px) {
    .builder-workflow-choice {
        align-items: flex-start;
        flex-direction: column;
    }
}

.builder-selection-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.builder-action.btn {
    min-height: 2.75rem;
    gap: 0.5rem;
    border-color: #9eb9ae;
    border-radius: 0.6rem;
    background: #fff;
    padding-inline: 0.9rem;
    color: var(--builder-ink);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: normal;
}

.builder-action.btn:hover {
    border-color: var(--builder-green);
    background: var(--builder-mint);
    color: var(--builder-green-dark);
}

.builder-action-optional,
.builder-muted {
    color: var(--builder-body);
    font-weight: 500;
}

.builder-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}

.builder-core-sets {
    overflow: hidden;
    border: 1px solid var(--builder-line);
    border-radius: 0.75rem;
    background: #fff;
}

.builder-core-set-summary.chapter-summary {
    min-height: 3.4rem;
    border-radius: 0;
    padding: 0.8rem 1rem;
    font-size: 0.88rem;
    font-weight: 750;
}

.builder-core-set-summary:hover {
    background: var(--builder-mint);
}

.builder-core-set-summary-state {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--builder-body);
    font-size: 0.72rem;
    font-weight: 500;
}

.builder-pending-label {
    border-radius: 999px;
    background: #fff3d6;
    padding: 0.2rem 0.5rem;
    color: #795b14;
    font-size: 0.68rem;
    font-weight: 700;
}

.builder-applied {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
    border: 1px solid var(--builder-line);
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.75rem 0.9rem;
}

.builder-applied-label {
    flex-shrink: 0;
    padding-top: 0.3rem;
    color: var(--builder-body);
    font-size: 0.72rem;
    font-weight: 700;
}

.builder-applied-list {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.builder-applied-chip {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid color-mix(in srgb, var(--core-set-color) 28%, white);
    border-radius: 999px;
    background: color-mix(in srgb, var(--core-set-color) 5%, white);
    padding: 0.28rem 0.6rem;
}

.builder-applied-dot {
    width: 0.5rem;
    height: 0.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--core-set-color);
}

.builder-applied-name {
    color: var(--builder-ink);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.builder-applied-count {
    color: var(--builder-body);
    font-size: 0.66rem;
    white-space: nowrap;
}

.builder-core-set-content {
    border-top: 1px solid var(--builder-line);
    padding: 1rem;
}

.builder-core-set-help {
    margin-bottom: 0.85rem;
    color: var(--builder-body);
    font-size: 0.78rem;
    line-height: 1.55;
}

.builder-core-set-tools {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.builder-filter-meta {
    display: flex;
    min-height: 1.75rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--builder-body);
    font-size: 0.7rem;
}

.builder-core-set-catalog {
    max-height: 24rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
}

.builder-core-set-catalog > section + section {
    margin-top: 1rem;
}

.builder-core-set-catalog h2 {
    margin-bottom: 0.35rem;
    color: var(--builder-body);
    font-size: 0.72rem;
    font-weight: 750;
}

.builder-core-set-grid {
    display: grid;
    gap: 0 1.25rem;
    border-top: 1px solid var(--builder-line);
}

.core-set-option {
    display: flex;
    min-width: 0;
    min-height: 3.1rem;
    cursor: pointer;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid var(--builder-line);
    padding: 0.55rem 0.35rem;
}

.core-set-option:hover,
.core-set-option:has(input:checked) {
    background: var(--builder-mint);
}

.core-set-option-name {
    min-width: 0;
    flex: 1;
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.4;
}

.core-set-option-meta {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    gap: 0.1rem;
    color: var(--builder-body);
    font-size: 0.66rem;
    text-align: right;
}

.builder-core-set-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--builder-line);
    padding-top: 0.85rem;
}

.builder-core-set-state {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    color: var(--builder-body);
    font-size: 0.72rem;
}

.builder-core-set-state strong {
    color: var(--builder-green);
}

.builder-workspace {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.builder-selected,
.builder-suggestions {
    border: 1px solid var(--builder-line);
    border-radius: 0.75rem;
    background: #fff;
    padding: 1rem;
}

.builder-suggestions {
    border-color: #b9d2df;
    background: #f3f8fb;
}

.builder-suggestions-heading,
.builder-selected-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.builder-selected h2,
.builder-suggestions h2 {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.builder-selected-heading p,
.builder-suggestions-heading p {
    margin-top: 0.25rem;
    color: var(--builder-body);
    font-size: 0.72rem;
    line-height: 1.5;
}

.builder-selected-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.builder-selected-total,
.builder-component-count {
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
    white-space: nowrap;
}

.builder-selected-total {
    background: var(--builder-mint);
    color: var(--builder-green-dark);
    font-weight: 700;
}

.builder-component-count {
    border: 1px solid var(--builder-line);
    background: #fff;
    color: var(--builder-body);
    font-variant-numeric: tabular-nums;
}

.builder-component-count > span {
    color: var(--builder-green);
    font-weight: 800;
}

.builder-suggestion-list {
    margin-top: 0.45rem;
}

.builder-suggestion-list > summary {
    cursor: pointer;
    color: var(--builder-green-dark);
    font-size: 0.72rem;
    font-weight: 700;
}

.builder-suggestion-list > div {
    max-height: 20rem;
    margin-top: 0.65rem;
    overflow-y: auto;
    border-top: 1px solid #cfdee6;
    background: #fff;
}

.builder-suggestion-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid #e2eaee;
    padding: 0.55rem 0.65rem;
    font-size: 0.75rem;
}

.builder-suggestion-row > div > span:last-child {
    display: block;
    margin-top: 0.15rem;
    color: var(--builder-body);
    font-size: 0.66rem;
}

.builder-selected-tools {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 16rem) auto;
    gap: 0.65rem;
    margin-top: 1rem;
}

.builder-source-filter .select {
    width: 100%;
}

.builder-tree-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.builder-selected-filter-meta {
    min-height: 2rem;
    border-bottom: 1px solid var(--builder-line);
}

.builder-selected-tree {
    padding-top: 0.85rem;
}

.builder-selected-tree > div + div {
    margin-top: 1rem;
}

.builder-selected-tree h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
    color: var(--builder-green);
    font-size: 0.82rem;
    font-weight: 800;
}

.builder-selected-tree h3 span {
    display: inline-grid;
    min-width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    border-radius: 999px;
    background: var(--builder-mint);
    font-size: 0.65rem;
}

.builder-selected-tree .chapter-summary {
    min-height: 2.4rem;
    padding-block: 0.5rem;
    font-size: 0.78rem;
}

.category-record {
    min-height: 2.65rem;
    font-size: 0.8rem;
}

.category-remove.btn {
    width: 2rem;
    min-height: 2rem;
    height: 2rem;
    flex-shrink: 0;
    padding: 0.4rem;
    color: #a24242;
}

.category-remove:hover {
    background: #fff0f0;
}

.builder-empty-state,
.builder-empty-filter {
    border: 1px dashed #b8ccc2;
    border-radius: 0.6rem;
    padding: 1.5rem 1rem;
    color: var(--builder-body);
    text-align: center;
}

.builder-empty-state p,
.builder-empty-filter p {
    color: var(--builder-ink);
    font-size: 0.82rem;
    font-weight: 700;
}

.builder-empty-state span {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
}

.builder-selected-empty {
    margin-top: 1rem;
}

.builder-empty-filter {
    margin-top: 0.75rem;
}

.builder-empty-filter .btn {
    margin-top: 0.75rem;
}

.builder-sticky-bar {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    border-top: 1px solid #b9cec3;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -0.5rem 1.5rem rgba(23, 61, 56, 0.06);
    padding-bottom: env(safe-area-inset-bottom);
}

.builder-sticky-inner {
    display: flex;
    width: min(100%, 80rem);
    min-height: 4.75rem;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-inline: auto;
    padding: 0.75rem 2rem;
}

.builder-sticky-summary {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 0.15rem;
}

.builder-sticky-summary strong {
    font-size: 0.85rem;
}

.builder-sticky-summary span {
    color: var(--builder-body);
    font-size: 0.7rem;
}

.builder-continue.btn {
    min-height: 2.75rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    font-weight: 750;
}

.builder-page :is(a, button, input, select, summary):focus-visible {
    outline: 3px solid #238d78;
    outline-offset: 3px;
}

.category-picker-header {
    border-bottom: 1px solid var(--builder-line);
    padding: 1rem 3rem 1rem 1rem;
}

.category-picker-header h2 {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.category-picker-header p {
    margin-top: 0.3rem;
    color: var(--builder-body);
    font-size: 0.75rem;
    line-height: 1.5;
}

.category-picker-close.btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.category-picker-tools {
    display: grid;
    gap: 0.55rem;
    border-bottom: 1px solid var(--builder-line);
    padding: 0.75rem;
}

.category-picker-mode-row,
.category-picker-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.category-picker-mode-row > div {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.6rem;
}

.category-picker-mode-row strong {
    font-size: 0.75rem;
}

#category-picker-search-status,
#category-picker-selection-count {
    color: var(--builder-body);
    font-size: 0.68rem;
}

.category-picker-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.15rem;
}

.category-picker-selected-tray {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border-top: 1px solid var(--builder-line);
    padding-top: 0.55rem;
}

.category-picker-selected-tray > span {
    flex-shrink: 0;
    padding-top: 0.25rem;
    color: var(--builder-body);
    font-size: 0.68rem;
    font-weight: 700;
}

.category-picker-selected-tray ul {
    display: flex;
    max-height: 5.5rem;
    flex-wrap: wrap;
    gap: 0.35rem;
    overflow-y: auto;
}

.category-picker-selected-tray li {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    background: var(--builder-mint);
    padding: 0.2rem 0.25rem 0.2rem 0.55rem;
    color: var(--builder-green-dark);
    font-size: 0.68rem;
}

.category-picker-selected-tray li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-picker-selected-tray button {
    display: inline-grid;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    place-items: center;
    border-radius: 50%;
    font-size: 1rem;
}

.category-picker-selected-tray button:hover {
    background: #d4e9df;
}

.category-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--builder-line);
    background: #fff;
    padding: 0.75rem;
}

#catalog-tree {
    background: #f7faf8;
    padding: 0.65rem;
}

#category-picker .catalog-component {
    --catalog-accent: #176b5b;
    --catalog-soft: #e8f2ed;
    overflow: hidden;
    margin-bottom: 0.4rem;
    border: 1px solid color-mix(in srgb, var(--catalog-accent) 22%, white);
    border-radius: 0.5rem;
    background: #fff;
}

#category-picker .catalog-component-b {
    --catalog-accent: #316f8e;
    --catalog-soft: #edf5f8;
}

#category-picker .catalog-component-s {
    --catalog-accent: #765f91;
    --catalog-soft: #f3f0f7;
}

#category-picker .catalog-component-d {
    --catalog-accent: #176b5b;
    --catalog-soft: #e8f2ed;
}

#category-picker .catalog-component-e {
    --catalog-accent: #91672c;
    --catalog-soft: #faf3e8;
}

#category-picker .catalog-component-summary.chapter-summary {
    min-height: 2.3rem;
    border-left: 3px solid var(--catalog-accent);
    border-radius: 0;
    background: var(--catalog-soft);
    padding: 0.4rem 0.6rem;
    color: var(--catalog-accent);
    font-size: 0.78rem;
    font-weight: 800;
}

#category-picker .catalog-component-content.chapter-content {
    padding: 0.15rem 0.4rem 0.3rem;
}

#category-picker .catalog-chapter-summary.chapter-summary {
    min-height: 1.9rem;
    padding: 0.25rem 0.3rem;
    color: #36564d;
    font-size: 0.73rem;
    font-weight: 700;
}

#category-picker .catalog-chapter-summary:hover {
    background: var(--catalog-soft);
}

#category-picker .catalog-chapter .chapter-content {
    padding: 0 0 0.15rem;
}

#category-picker .catalog-category-row {
    border-color: #e7eeea;
    padding: 0;
}

#category-picker .catalog-category-label {
    min-height: 2rem;
    align-items: center;
    border-radius: 0.3rem;
    padding: 0.2rem 0.25rem;
    color: #263f39;
    font-size: 0.76rem;
    line-height: 1.3;
}

#category-picker .catalog-category-label:hover {
    background: color-mix(in srgb, var(--catalog-soft) 65%, white);
}

#category-picker .catalog-category-label:has(input:checked) {
    background: var(--catalog-soft);
}

#category-picker .catalog-category-code {
    color: var(--catalog-accent);
}

#category-picker .catalog-toggle {
    color: var(--catalog-accent);
}

#category-picker .catalog-toggle:hover {
    background: var(--catalog-soft);
}

#category-picker .checkbox:checked {
    border-color: var(--catalog-accent);
    background-color: var(--catalog-accent);
}

#category-picker .catalog-toggle,
#category-picker .catalog-toggle-spacer {
    width: 2rem;
    height: 2rem;
}

@media (min-width: 768px) {
    .builder-core-set-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .builder-header {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .builder-selection-actions {
        align-self: flex-start;
    }
}

@media (max-width: 640px) {
    .category-manager-modal {
        padding: 0;
    }

    .category-manager-modal .category-manager-box {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }

    .category-manager-scroll {
        padding: 1rem 0.75rem 0;
    }

    .category-manager-heading {
        padding-right: 2.5rem;
    }

    .category-manager-actions {
        margin: 1rem -0.75rem 0;
    }

    .assessment-workspace-header .form-header-actions {
        flex-wrap: wrap;
    }

    .builder-main {
        padding-bottom: 11rem;
    }

    .builder-selection-actions {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
    }

    .builder-action.btn {
        width: 100%;
        justify-content: flex-start;
    }

    .builder-applied,
    .builder-core-set-footer,
    .builder-suggestions-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .builder-applied {
        gap: 0.5rem;
    }

    .builder-applied-label {
        padding-top: 0;
    }

    .builder-applied-chip {
        border-radius: 0.55rem;
    }

    .builder-core-set-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .builder-core-set-footer .btn {
        width: 100%;
    }

    .builder-selected-heading {
        flex-direction: column;
        gap: 0.65rem;
    }

    .builder-selected-summary {
        justify-content: flex-start;
    }

    .builder-selected-tools {
        grid-template-columns: minmax(0, 1fr);
    }

    .builder-tree-actions {
        justify-content: flex-start;
    }

    .builder-selected,
    .builder-suggestions,
    .builder-core-set-content {
        padding: 0.8rem;
    }

    .category-record {
        min-height: 3rem;
    }

    .category-remove.btn {
        width: 2.5rem;
        min-height: 2.5rem;
        height: 2.5rem;
    }

    .builder-sticky-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.55rem;
        padding: 0.65rem 1rem;
    }

    .builder-sticky-summary {
        grid-column: 1;
        grid-row: 1;
    }

    .builder-continue {
        grid-column: 2;
        grid-row: 1;
    }

    .builder-sticky-apply {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }

    .category-picker-mode-row,
    .category-picker-control-row,
    .category-picker-selected-tray {
        align-items: flex-start;
        flex-direction: column;
    }

    .category-picker-controls {
        justify-content: flex-start;
    }

    .category-picker-tools .btn,
    .category-picker-selected-tray button {
        min-height: 2.5rem;
    }

    .category-picker-selected-tray button {
        width: 2.5rem;
        height: 2.5rem;
    }

    #category-picker .catalog-category-label {
        min-height: 2.5rem;
    }

    #category-picker .catalog-toggle,
    #category-picker .catalog-toggle-spacer {
        width: 2.5rem;
        height: 2.5rem;
    }
}

.load-assessment-form {
    margin: 0;
}

.load-assessment-label {
    display: block;
    color: #334d59;
    font-size: 0.78rem;
    font-weight: 650;
}

.load-assessment-form .file-input {
    width: 100%;
    min-width: 0;
    border-color: #b8c7cf;
    font-size: 0.78rem;
}

.load-assessment-help {
    display: block;
    margin-top: 0.45rem;
    color: #7a8b94;
    font-size: 0.72rem;
}

.load-assessment-actions {
    margin-top: 0;
}

#assessment-loader :is(button, input):focus-visible {
    outline: 2px solid var(--form-primary);
    outline-offset: 2px;
}

/* Shared workflow navigation keeps wayfinding consistent across form and results. */
.workflow-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.workflow-back.btn {
    min-height: 2rem;
    height: 2rem;
    margin-left: -0.5rem;
    padding: 0.25rem 0.55rem;
    gap: 0.3rem;
    color: #526b77;
    font-weight: 650;
}

.workflow-back.btn:hover {
    background: var(--form-primary-soft);
    color: var(--form-primary);
}

.workflow-download {
    gap: 0.4rem;
}

.workflow-back:focus-visible,
.workflow-download:focus-visible,
.result-view-switch a:focus-visible {
    outline: 2px solid var(--form-primary);
    outline-offset: 2px;
}

.rehab-phase-stepper {
    --phase-ink: #173d38;
    --phase-muted: #526a64;
    --phase-green: #176b5b;
    --phase-mint: #e8f2ed;
    --phase-line: #cfddd6;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--phase-line);
    padding: 0.1rem 0.1rem 1.15rem;
    scrollbar-width: thin;
}

.rehab-phase-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(7rem, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.rehab-phase-item {
    position: relative;
    min-width: 0;
}

.rehab-phase-item:not(:last-child)::after {
    position: absolute;
    z-index: 0;
    top: 0.9rem;
    right: calc(-50% + 1.3rem);
    left: calc(50% + 1.3rem);
    height: 1px;
    background: var(--phase-line);
    content: "";
}

.rehab-phase-item.is-complete:not(:last-child)::after {
    background: var(--phase-green);
}

.rehab-phase-link,
.rehab-phase-terminal {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    color: var(--phase-muted);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
}

.rehab-phase-marker {
    display: grid;
    width: 1.85rem;
    height: 1.85rem;
    place-items: center;
    border: 1px solid var(--phase-line);
    border-radius: 50%;
    background: #f7faf8;
    color: var(--phase-muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.rehab-phase-marker svg {
    width: 1rem;
    height: 1rem;
}

.rehab-phase-item.is-complete .rehab-phase-marker {
    border-color: var(--phase-green);
    background: var(--phase-mint);
    color: var(--phase-green);
}

.rehab-phase-item.is-current .rehab-phase-marker {
    border-color: var(--phase-green);
    background: var(--phase-green);
    color: #fff;
}

.rehab-phase-item.is-current .rehab-phase-label {
    color: var(--phase-ink);
    font-weight: 800;
}

.rehab-phase-link:hover .rehab-phase-label {
    color: var(--phase-green);
}

.rehab-phase-link:focus-visible {
    border-radius: 0.35rem;
    outline: 2px solid var(--phase-green);
    outline-offset: 0.25rem;
}

@media (max-width: 640px) {
    .rehab-phase-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-width: 0;
    }

    .rehab-phase-link,
    .rehab-phase-terminal {
        gap: 0.35rem;
        font-size: 0.68rem;
    }

    .rehab-phase-label {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .rehab-phase-marker {
        width: 1.7rem;
        height: 1.7rem;
    }

    .rehab-phase-item:not(:last-child)::after {
        top: 0.825rem;
        right: calc(-50% + 1.15rem);
        left: calc(50% + 1.15rem);
    }
}

.result-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.result-page-heading {
    min-width: 0;
}

.result-page-heading h1 {
    color: #172832;
    font-size: clamp(1.4rem, 3vw, 1.7rem);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.result-page-heading p {
    max-width: 42rem;
    margin-top: 0.4rem;
    color: #5b6c77;
    font-size: 0.9rem;
    line-height: 1.5;
}

.result-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    padding-top: 2rem;
}

.result-view-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    border: 1px solid #c8d4db;
    border-radius: 0.5rem;
    background: #edf2f4;
    padding: 0.2rem;
}

.result-view-switch .btn {
    min-height: 1.9rem;
    height: 1.9rem;
    border: 0;
    border-radius: 0.3rem;
    padding: 0.3rem 0.65rem;
    background: transparent;
    color: #526b77;
    font-size: 0.75rem;
    font-weight: 650;
    white-space: nowrap;
}

.result-view-switch .btn:hover {
    background: rgba(255, 255, 255, 0.65);
    color: #213944;
}

.result-view-switch .btn.is-active {
    background: #fff;
    box-shadow: 0 1px 3px rgba(23, 40, 50, 0.12);
    color: var(--form-primary);
}

.framework-figure {
    margin: 0;
    overflow-x: auto;
    border: 1px solid color-mix(in oklab, oklch(var(--bc)) 14%, transparent);
    border-radius: 0.5rem;
    background: oklch(var(--b1));
}

.framework-svg {
    display: block;
    width: 100%;
    height: auto;
}

.framework-node rect {
    fill: oklch(var(--b1));
    stroke: color-mix(in oklab, oklch(var(--bc)) 85%, transparent);
    stroke-width: 1.5;
}

.framework-node-title {
    fill: oklch(var(--bc));
    font-size: 14px;
    font-weight: 700;
}

.framework-section-title {
    fill: oklch(var(--bc));
    font-size: 12px;
    font-weight: 700;
}

.framework-entry {
    fill: color-mix(in oklab, oklch(var(--bc)) 85%, transparent);
    font-size: 12px;
}

.framework-empty {
    fill: color-mix(in oklab, oklch(var(--bc)) 45%, transparent);
    font-size: 12px;
    font-style: italic;
}

.framework-arrow {
    fill: none;
    stroke: color-mix(in oklab, oklch(var(--bc)) 80%, transparent);
    stroke-width: 1.5;
}

.framework-arrowhead {
    fill: color-mix(in oklab, oklch(var(--bc)) 80%, transparent);
}

.framework-figure figcaption {
    border-top: 1px solid color-mix(in oklab, oklch(var(--bc)) 10%, transparent);
    padding: 0.5rem 0.75rem;
    color: color-mix(in oklab, oklch(var(--bc)) 60%, transparent);
    font-size: 0.75rem;
}

@media (max-width: 960px) {
    .result-page-header {
        display: block;
    }

    .result-page-actions {
        justify-content: flex-start;
        margin-top: 0.85rem;
        padding-top: 0;
    }
}

@media (max-width: 639px) {
    .result-page-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .result-view-switch {
        display: flex;
        width: 100%;
    }

    .result-view-switch .btn {
        flex: 1;
        padding-right: 0.35rem;
        padding-left: 0.35rem;
    }

    .result-page-actions .workflow-download {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .framework-svg {
        min-width: 1000px;
    }
}

.profile-scroll {
    contain: layout inline-size;
    overflow-x: auto;
    background: #fff;
}

.functioning-profile {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    color: #173d38;
}

.functioning-profile .profile-code-column {
    width: 4rem;
}

.functioning-profile .profile-scale-column {
    width: 12rem;
}

.functioning-profile th,
.functioning-profile td {
    border: 1px solid #9eb9ae;
    padding: 0.25rem 0.35rem;
    text-align: left;
    vertical-align: middle;
    font-size: 0.78rem;
    line-height: 1.3;
}

.profile-section-header > th {
    background: #e7f1f8;
    font-size: 1rem;
    font-weight: 700;
}

.profile-section-header > td {
    padding: 0;
    background: #e7f1f8;
}

.profile-scale-title {
    display: flex;
    min-height: 1.25rem;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-left: 1.5rem;
    border-bottom: 1px solid #9eb9ae;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.profile-scale-labels,
.profile-bar {
    display: grid;
    grid-template-columns: repeat(var(--profile-columns), minmax(0, 1fr));
}

.profile-scale-labels {
    margin-left: 1.5rem;
}

.profile-scale-labels > span {
    border-left: 1px solid #9eb9ae;
    padding: 0.1rem 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.profile-scale-labels > span:last-child,
.profile-segment:last-child {
    border-right: 1px solid #9eb9ae;
}

.profile-code {
    font-weight: 400;
}

.profile-category {
    overflow-wrap: anywhere;
}

.profile-page .profile-code {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
}

.profile-page .profile-category {
    position: sticky;
    left: 4rem;
    z-index: 3;
    background: #fff;
    box-shadow: 1px 0 #9eb9ae;
}

.profile-page .functioning-profile > thead th:first-child,
.profile-page .functioning-profile > thead th:nth-child(2) {
    position: sticky;
    z-index: 6;
    background: #f4f6f7;
}

.profile-page .functioning-profile > thead th:first-child {
    left: 0;
}

.profile-page .functioning-profile > thead th:nth-child(2) {
    left: 4rem;
    box-shadow: 1px 0 #9eb9ae;
}

.profile-page .profile-section-header > th {
    position: sticky;
    left: 0;
    z-index: 4;
}

.profile-special {
    display: block;
    margin-top: 0.15rem;
    color: #3f675b;
    font-size: 0.7rem;
}

.profile-rating-cell {
    padding: 0 !important;
}

.profile-rating {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    align-items: center;
}

.profile-qualifier-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.profile-segment {
    height: 1.1rem;
    border-left: 1px solid #9eb9ae;
    background: #fff;
}

.profile-segment.is-active.tone-dark {
    background: #3f675b;
}

.profile-segment.is-active.tone-light {
    background: #a8c8b9;
}

.profile-empty-row > td {
    padding: 0.65rem;
    color: #666;
    text-align: center;
    font-style: italic;
}

.functioning-profile > thead {
    background: #f4f6f7;
    color: #42535c;
    font-size: 0.72rem;
}

.functioning-profile > thead .profile-goal-heading,
.functioning-profile > thead .profile-evaluation-heading {
    text-align: center;
}

.profile-evaluation-heading small {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
}

.profile-column-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.profile-column-edit {
    color: #176b5b;
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

.profile-column-edit:hover {
    color: #105247;
}

.functioning-profile:not(.functioning-profile-editing) .profile-evaluation-value-cell {
    padding: 0 !important;
}

.profile-evaluation-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #cfddd6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.75rem;
}

.profile-evaluation-picker {
    min-width: 0;
    margin: 0;
}

.profile-evaluation-picker > label {
    display: block;
    margin-bottom: 0.3rem;
    color: #36564d;
    font-weight: 700;
}

.profile-evaluation-picker-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.profile-evaluation-picker-controls .select {
    min-width: 11rem;
}

.profile-evaluation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.profile-evaluation-actions .btn {
    gap: 0.4rem;
}

.profile-evaluation-actions svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.profile-evaluation-empty {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.profile-evaluation-empty strong {
    color: #36564d;
    font-size: 0.8rem;
}

.profile-evaluation-empty span,
.profile-evaluation-help {
    color: #526a64;
    font-size: 0.72rem;
}

.profile-evaluation-help {
    width: 100%;
    margin: 0;
}

.profile-evaluation-picker label,
.profile-evaluation-date {
    font-size: 0.8rem;
    font-weight: 600;
}

.profile-evaluation-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.functioning-profile-editing {
    min-width: 1280px;
}

.functioning-profile .profile-relation-column {
    width: 5rem;
}

.functioning-profile .profile-goal-column {
    width: 5rem;
}

.functioning-profile-editing .profile-relation-column {
    width: 10rem;
}

.functioning-profile-editing .profile-goal-column {
    width: 18rem;
}

.functioning-profile .profile-evaluation-column {
    width: 12rem;
}

.functioning-profile-editing .profile-evaluation-column {
    width: 18rem;
}

.profile-goal-relation-cell,
.profile-goal-value-cell,
.profile-evaluation-value-cell {
    text-align: center;
}

.profile-goal-relations {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.55rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.profile-goal-relations label {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
}

.profile-target-control,
.personal-influence-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.2rem;
    border: 0;
}

.profile-target-scale,
.personal-influence-bar {
    display: flex;
    align-items: stretch;
}

.profile-target-scale label,
.personal-influence-bar label {
    position: relative;
    cursor: pointer;
}

.profile-target-scale input,
.personal-influence-bar input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.profile-target-segment {
    display: grid;
    width: 1.3rem;
    height: 1.3rem;
    place-items: center;
    border-top: 1px solid #7a858a;
    border-bottom: 1px solid #7a858a;
    border-left: 1px solid #7a858a;
    background: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.profile-target-scale label:last-child .profile-target-segment {
    border-right: 1px solid #7a858a;
}

.profile-target-clear,
.personal-influence-clear {
    position: relative;
    display: inline-grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    color: #5b6c77;
    font-size: 1rem;
    line-height: 1;
}

.profile-target-clear:hover,
.personal-influence-clear:hover {
    border-color: #cbd8de;
    background: #f4f6f7;
    color: #171717;
}

.profile-target-clear input,
.personal-influence-clear input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.profile-target-clear:focus-within,
.personal-influence-clear:focus-within {
    outline: 2px solid #23617a;
    outline-offset: 1px;
}

.profile-target-scale input:checked + .profile-target-segment.tone-dark,
.personal-influence-bar input:checked + .personal-influence-segment.tone-dark {
    background: #3f675b;
    color: #fff;
}

.profile-target-scale input:checked + .profile-target-segment.tone-light,
.personal-influence-bar input:checked + .personal-influence-segment.tone-light {
    background: #a8c8b9;
    color: #171717;
}

.profile-target-scale label:hover .profile-target-segment,
.personal-influence-bar label:hover .personal-influence-segment {
    border-color: #23617a;
}

.profile-target-scale input:focus-visible + span,
.personal-influence-bar input:focus-visible + span {
    position: relative;
    z-index: 1;
    outline: 2px solid #23617a;
    outline-offset: 2px;
}

.personal-influence-segment {
    display: grid;
    width: 1.3rem;
    height: 1.3rem;
    place-items: center;
    border-top: 1px solid #9eb9ae;
    border-bottom: 1px solid #9eb9ae;
    border-left: 1px solid #9eb9ae;
    background: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.personal-influence-bar label:last-child .personal-influence-segment {
    border-right: 1px solid #9eb9ae;
}

.profile-view-help {
    margin: -0.35rem 0 1rem;
    color: #5b6c77;
    font-size: 0.78rem;
}

.result-view-switch .btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.profile-goal-editor {
    margin-bottom: 1rem;
    border: 1px solid #cbd8de;
    background: #f7fafb;
}

.profile-assessment-heading {
    font-size: 0.9rem;
    text-align: center !important;
}

.profile-assessment-goal-statement strong {
    font-weight: 700;
}

.profile-assessment-goal-value {
    font-weight: 700;
    text-align: center !important;
}

.profile-assessment-goals .profile-special {
    margin: 0;
    padding: 0.25rem 0.35rem;
}

.profile-assessment-goal-row {
    break-inside: avoid;
}

.profile-goal-editor {
    width: 100%;
    padding: 0.4rem 0.55rem;
}

.profile-goal-editor-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.2rem 1rem;
    margin-bottom: 0.25rem;
}

.profile-goal-editor-heading h2 {
    font-size: 0.9rem;
    font-weight: 750;
}

.profile-goal-editor-heading p,
.profile-edit-help {
    color: #5b6c77;
    font-size: 0.78rem;
}

.profile-goal-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
    max-width: 68rem;
}

.profile-goal-field {
    display: grid;
    grid-template-columns: 10rem minmax(12rem, 1fr) auto;
    align-items: center;
    gap: 0.4rem;
}

.profile-goal-field > span {
    display: block;
    margin-bottom: 0;
    color: #42535c;
    font-size: 0.74rem;
}

.profile-goal-field > span strong {
    display: inline-block;
    min-width: 1.8rem;
    color: #23617a;
}

.profile-goal-field input {
    width: 100%;
    height: 1.75rem;
    min-height: 1.75rem;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    font-size: 0.82rem;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.profile-goal-field input:hover {
    background: #fff;
}

.profile-goal-field input:focus {
    border-color: #86a9b9;
    background: #fff;
    outline: 2px solid #23617a;
    outline-offset: 1px;
}

.profile-cycle-goals {
    max-width: 68rem;
    margin-top: 0.3rem;
    padding-top: 0.25rem;
    border-top: 1px solid #dbe4e8;
}

.profile-cycle-goals-label {
    display: block;
    margin-bottom: 0.15rem;
    color: #42535c;
    font-size: 0.74rem;
    font-weight: 700;
}

.narrative-entry.profile-cycle-goal-row {
    display: grid;
    grid-template-columns: 2.5rem minmax(12rem, 1fr) auto 2rem;
    align-items: center;
    gap: 0.3rem;
    border-bottom: 1px solid #e5eaec;
    padding: 0.1rem 0;
}

.profile-cycle-goal-key {
    display: block;
    width: 2.5rem;
    color: #23617a;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    text-align: left;
}

.profile-cycle-goal-row input {
    width: 100%;
    height: 1.75rem;
    min-height: 1.75rem;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    font-size: 0.82rem;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.profile-cycle-goal-row input:hover,
.profile-cycle-goal-row input:focus {
    background: #fff;
}

.profile-cycle-goal-row input:focus {
    border-color: #86a9b9;
    outline: 2px solid #23617a;
    outline-offset: 1px;
}

.profile-cycle-composer {
    gap: 0.35rem;
}

.profile-cycle-composer input {
    height: 1.75rem;
    min-height: 1.75rem;
    font-size: 0.82rem;
}

.profile-edit-help {
    max-width: 70ch;
    margin-top: 0.85rem;
    line-height: 1.5;
}

.profile-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dbe4e8;
}

.goal-extent-select {
    width: 100%;
    min-width: 0;
    border-color: #cfddd6;
    background: #fff;
    color: #294d43;
}

.goal-extent-control {
    display: flex;
    width: max-content;
    max-width: 100%;
    align-items: center;
    gap: 0.35rem;
}

.goal-extent-control .qualifier-control {
    flex: 0 1 auto;
}

.profile-goal-editor .qualifier-control,
.evaluation-goal-table .qualifier-control {
    --qualifier-option-width: 1.65rem;
    gap: 0.3rem;
}

.profile-goal-editor .qualifier-options,
.profile-goal-editor .qualifier-special-options,
.evaluation-goal-table .qualifier-options,
.evaluation-goal-table .qualifier-special-options {
    gap: 0.15rem;
}

.profile-goal-editor .qualifier-special-options,
.evaluation-goal-table .qualifier-special-options {
    padding-left: 0.3rem;
}

.profile-goal-editor .qualifier-option,
.profile-goal-editor .qualifier-special-options .qualifier-option,
.evaluation-goal-table .qualifier-option,
.evaluation-goal-table .qualifier-special-options .qualifier-option {
    min-width: 1.65rem;
    min-height: 1.65rem;
}

.profile-goal-editor .qualifier-clear,
.evaluation-goal-table .qualifier-clear {
    width: 1.35rem;
    height: 1.35rem;
    min-height: 1.35rem;
}

.profile-goal-target {
    display: block;
    margin-top: 0.25rem;
    color: #526a64;
    font-size: 0.72rem;
}

.evaluation-goal-section {
    margin-bottom: 1rem;
    border: 1px solid #cfddd6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.85rem;
}

.evaluation-section-heading {
    margin-bottom: 0.65rem;
}

.evaluation-section-heading h2 {
    color: #173d38;
    font-size: 0.95rem;
    font-weight: 750;
}

.evaluation-section-heading p,
.evaluation-goal-empty {
    margin-top: 0.25rem;
    color: #526a64;
    font-size: 0.76rem;
}

.evaluation-goal-table-scroll {
    overflow-x: auto;
}

.evaluation-goal-table {
    width: 100%;
    min-width: 48rem;
    border-collapse: collapse;
    color: #294d43;
    font-size: 0.78rem;
}

.evaluation-goal-table th,
.evaluation-goal-table td {
    border-top: 1px solid #dbe7e0;
    padding: 0.5rem;
    text-align: left;
    vertical-align: middle;
}

.evaluation-goal-table thead th {
    border-top: 0;
    background: #f0f6f2;
    color: #36564d;
    font-size: 0.7rem;
}

.evaluation-goal-table tbody th {
    width: 3rem;
    color: #176b5b;
}

.evaluation-goal-value {
    width: 7rem;
    text-align: center !important;
}

.evaluation-goal-input {
    width: 14rem;
    text-align: center !important;
}

.evaluation-goal-input .goal-extent-control {
    margin: 0 auto;
}

.profile-achievement-cell {
    min-width: 10rem;
    color: #526a64;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center !important;
    vertical-align: middle !important;
}

.profile-achievement-cell[data-achievement-code="achieved"] {
    color: #176b5b;
}

.profile-achievement-cell[data-achievement-code="not-achieved"] {
    color: #9a4c3d;
}

.profile-achievement-cell[data-achievement-code="not-auto"] {
    color: #8a5a20;
}

@media (max-width: 640px) {
    .profile-goal-field {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.2rem;
        border-bottom: 1px solid #e5ece8;
        padding: 0.35rem 0;
    }

    .narrative-entry.profile-cycle-goal-row {
        grid-template-columns: 2.5rem minmax(0, 1fr) 2rem;
        padding: 0.2rem 0;
    }

    .profile-cycle-goal-row [data-goal-extent] {
        grid-column: 2;
        width: 100%;
    }

    .profile-cycle-goal-row .narrative-entry-actions {
        grid-column: 3;
        grid-row: 1;
    }

    .profile-goal-editor .qualifier-control,
    .evaluation-goal-table .qualifier-control {
        --qualifier-option-width: 1.75rem;
    }

    .profile-goal-editor .qualifier-option,
    .profile-goal-editor .qualifier-special-options .qualifier-option,
    .evaluation-goal-table .qualifier-option,
    .evaluation-goal-table .qualifier-special-options .qualifier-option {
        min-width: 1.75rem;
        min-height: 2.25rem;
    }

    .profile-edit-actions {
        flex-wrap: wrap;
    }
}

/* Categorical Profile uses the same quiet clinical palette as the builder. */
.profile-page {
    --form-primary: #176b5b;
    --form-primary-content: #fff;
    --form-primary-soft: #e8f2ed;
    --form-primary-hover: #105247;
}

.profile-page .result-page-heading h1 {
    color: #173d38;
}

.profile-page .result-page-heading p,
.profile-page .profile-legend,
.profile-page .profile-edit-help {
    color: #526a64;
}

.profile-page .result-view-switch {
    border-color: #cfddd6;
    background: #e8f2ed;
}

.profile-page .result-view-switch .btn {
    color: #526a64;
}

.profile-page .result-view-switch .btn.is-active {
    color: #105247;
}

.profile-page .result-page-actions .btn-outline,
.profile-page .profile-evaluation-picker .btn-outline {
    border-color: #9eb9ae;
    background: #fff;
    color: #294d43;
}

.profile-page .result-page-actions .btn-outline:hover,
.profile-page .profile-evaluation-picker .btn-outline:hover {
    border-color: #176b5b;
    background: #e8f2ed;
    color: #105247;
}

.profile-page .profile-scroll {
    border: 1px solid #cfddd6;
    border-radius: 0.5rem;
    background: #fff;
}

.profile-page .functioning-profile > thead {
    background: #f0f6f2;
    color: #36564d;
}

.profile-page .profile-section-header > th,
.profile-page .profile-section-header > td {
    background: #e8f2ed;
    color: #173d38;
}

.profile-page .profile-code {
    color: #176b5b;
    font-weight: 700;
}

.profile-page .profile-special,
.profile-page .profile-empty-row > td {
    color: #526a64;
}

.profile-page .profile-evaluation-picker .select,
.profile-page .profile-evaluation-date .input {
    border-color: #b8ccc2;
    background: #fff;
}

.profile-page .profile-goal-editor {
    border-color: #cfddd6;
    background: #fff;
}

.profile-page .profile-cycle-goal-key {
    background: #e8f2ed;
    color: #105247;
}

.profile-page .profile-edit-actions {
    border-color: #cfddd6;
}

@media (max-width: 639px) {
    .profile-goal-fields {
        grid-template-columns: 1fr;
    }

    .profile-edit-actions .btn {
        flex: 1;
    }

    .profile-evaluation-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-evaluation-picker-controls .select {
        min-width: 0;
        flex: 1;
    }

    .profile-evaluation-actions {
        display: grid;
        grid-auto-columns: minmax(0, 1fr);
        grid-auto-flow: column;
    }

    .profile-evaluation-actions .btn {
        width: 100%;
    }
}

@media print {
    .profile-scroll {
        overflow: visible;
    }

    .functioning-profile {
        min-width: 0;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .profile-category-row,
    .profile-section-header {
        break-inside: avoid;
    }
}

/* Integrated category editor: the builder becomes a focused modal workspace. */
.assessment-workspace-header .form-header-actions {
    padding-top: 0;
}

.category-manager-modal {
    padding: 1rem;
}

.category-manager-modal .category-manager-box {
    position: relative;
    width: min(80rem, calc(100vw - 2rem));
    max-width: none;
    height: min(56rem, calc(100dvh - 2rem));
    max-height: none;
    overflow: hidden;
    background: #f7faf8;
    padding: 0;
    color: var(--builder-ink);
}

.category-manager-scroll {
    height: 100%;
    overflow-y: auto;
    overscroll-contain: contain;
    padding: 1.5rem 1.5rem 0;
}

.category-manager-close.btn {
    position: absolute;
    z-index: 20;
    top: 0.75rem;
    right: 0.75rem;
}

.category-manager-heading {
    padding-right: 3rem;
}

.category-manager-heading .builder-heading {
    max-width: 48rem;
}

.category-manager-heading .builder-heading h2 {
    font-size: clamp(1.75rem, 3vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.2;
}

.category-manager-actions {
    position: sticky;
    z-index: 10;
    right: auto;
    bottom: 0;
    left: auto;
    margin: 1.5rem -1.5rem 0;
}

.category-manager-actions .builder-sticky-inner {
    width: 100%;
}

/* Assessment form: a clinical worksheet with a persistent reading outline. */
.form-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 0.85rem;
}

.form-page-header h1 {
    color: #172832;
    font-size: clamp(1.4rem, 3vw, 1.7rem);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.form-page-header p {
    max-width: 42rem;
    margin-top: 0.4rem;
    color: #5b6c77;
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-header-actions {
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.4rem;
    padding-top: 2rem;
}

.form-outputs {
    position: relative;
    flex-shrink: 0;
}

.form-outputs > summary {
    list-style: none;
}

.form-outputs > summary::-webkit-details-marker {
    display: none;
}

.form-outputs > summary::after {
    content: "▾";
    margin-left: 0.35rem;
    font-size: 0.75rem;
}

.form-outputs[open] > summary::after {
    content: "▴";
}

.form-output-actions {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.25rem);
    right: 0;
    display: grid;
    width: 15rem;
    gap: 0.25rem;
    border: 1px solid #b8ccc2;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.45rem;
    box-shadow: 0 0.65rem 1.5rem rgba(23, 61, 56, 0.14);
}

.form-output-actions .btn {
    width: 100%;
    justify-content: flex-start;
}

.form-output-actions .btn,
#assessment-form .btn {
    border-radius: 0.375rem;
    font-weight: 650;
}

.form-output-actions .btn-outline,
#assessment-form .btn-outline {
    border-color: #aebfc9;
    background: #fff;
    color: #29434f;
}

.form-output-actions .btn-outline:hover,
#assessment-form .btn-outline:hover {
    border-color: var(--form-primary);
    background: var(--form-primary-soft);
    color: var(--form-primary);
}

#assessment-form .btn-primary {
    border-color: var(--form-primary);
    background: var(--form-primary);
    color: var(--form-primary-content);
}

#assessment-form .btn-primary:hover {
    border-color: var(--form-primary-hover);
    background: var(--form-primary-hover);
}

#assessment-form :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--form-primary);
    outline-offset: 2px;
}

.category-brief-note,
.category-detailed-note {
    display: grid;
    align-content: start;
    gap: 0.35rem;
    min-width: 0;
}

.category-brief-note > label,
.category-detailed-note > label {
    color: #334d59;
    font-size: 0.78rem;
    font-weight: 700;
}

.category-note-grid :is(.input, .textarea) {
    width: 100%;
    border-color: #b8c7cf;
    background: #fff;
    color: #172832;
    font-size: 0.85rem;
}

.category-note-grid :is(.input, .textarea)::placeholder {
    color: #82919a;
}

.form-workspace {
    display: grid;
    grid-template-columns: 14.5rem minmax(0, 1fr);
    align-items: start;
    gap: 0.9rem;
}

.form-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #c8d4db;
    border-radius: 0.5rem;
    background: #fff;
    scrollbar-width: thin;
}

.form-sidebar-progress {
    padding: 0.75rem;
    background: var(--form-primary-soft);
}

.form-sidebar-progress > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.form-sidebar-progress strong {
    color: oklch(var(--bc));
    font-size: 1rem;
}

.form-sidebar-progress span {
    color: #526b77;
    font-size: 0.75rem;
}

.form-sidebar-progress .progress {
    height: 0.4rem;
    margin-top: 0.65rem;
    background: #cfdee5;
    color: var(--form-primary);
}

.form-sidebar-progress .progress::-webkit-progress-value {
    background: var(--form-primary);
}

.form-sidebar-progress .progress::-moz-progress-bar {
    background: var(--form-primary);
}

.form-filters {
    display: grid;
    gap: 0.5rem;
    padding: 0.65rem 0.65rem 0;
}

.form-filters :is(.input, .select) {
    width: 100%;
    min-width: 0;
    border-color: #b8c7cf;
    background: #fff;
    font-size: 0.82rem;
}

.form-section-controls {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    color: #627681;
    font-size: 0.7rem;
}

.form-section-controls > span {
    margin-right: auto;
}

.form-filter-status {
    min-height: 1rem;
    padding: 0 0.9rem;
    color: #627681;
    font-size: 0.72rem;
    line-height: 1.4;
}

.next-unanswered {
    height: auto;
    min-height: 2rem;
    white-space: nowrap;
}

#assessment-form .next-unanswered:disabled {
    border-color: #c4d1d8;
    background: #e6edef;
    color: #6d7f88;
}

.form-sidebar .component-nav {
    display: block;
    margin: 0;
    overflow: visible;
    border-top: 1px solid #dce4e9;
    padding: 0.65rem 0;
}

.form-sidebar .component-nav > h2 {
    padding: 0 0.9rem 0.45rem;
    color: #536a76;
    font-size: 0.75rem;
    font-weight: 700;
}

.component-nav-group {
    padding: 0.15rem 0;
}

.form-sidebar .component-nav-group > a {
    display: grid;
    min-width: 0;
    grid-template-columns: 1.6rem minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 0;
    padding: 0.4rem 0.6rem;
    color: #2b424e;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.3;
}

.form-sidebar .component-nav-group > a:hover {
    border-left-color: #8cb2c1;
    background: #f0f6f8;
}

.form-sidebar .component-nav-group > a[aria-current="location"] {
    border-left-color: var(--form-primary);
    background: var(--form-primary-soft);
    color: var(--form-primary);
}

.form-sidebar .component-nav-group > a:focus-visible {
    outline-offset: -2px;
}

.component-nav-code {
    display: inline-grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    border: 1px solid #bccdd5;
    border-radius: 0.25rem;
    color: var(--form-primary);
    font-size: 0.72rem;
    font-weight: 800;
}

.form-sidebar .component-nav-count {
    color: #6c7f89;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.chapter-nav,
.chapter-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.chapter-nav {
    padding: 0.1rem 0.45rem 0.35rem 1.05rem;
}

.chapter-nav ul {
    margin-left: 0.6rem;
    border-left: 1px solid #d9e3e8;
    padding-left: 0.35rem;
}

.form-sidebar .component-nav .chapter-nav-link {
    display: flex;
    width: 100%;
    min-width: 0;
    flex: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
    border: 0;
    border-radius: 0.25rem;
    padding: 0.25rem 0.35rem;
    color: #607580;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
}

.form-sidebar .component-nav .chapter-nav-link:hover {
    background: #f1f5f7;
    color: var(--form-primary);
}

.chapter-nav-link strong {
    color: #3b5966;
    font-weight: 700;
}

.chapter-nav-link > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.chapter-nav-link > span:last-child:not(:first-child) {
    flex-shrink: 0;
    color: #83949d;
    font-size: 0.68rem;
}

.form-main {
    min-width: 0;
}

.form-toolbar {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    border: 1px solid #c4d1d8;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.96);
    padding: 0.4rem 0.55rem 0.4rem 0.7rem;
    box-shadow: 0 3px 12px rgba(30, 55, 67, 0.07);
    backdrop-filter: blur(10px);
}

.form-toolbar-progress {
    min-width: 12rem;
    flex: 1;
    max-width: 25rem;
}

.form-toolbar-progress-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.form-toolbar-progress-copy strong {
    color: #243d49;
    font-size: 0.82rem;
}

.form-toolbar-progress .progress {
    display: block;
    width: 100%;
    height: 0.35rem;
    margin-top: 0.4rem;
    background: #dce4e9;
    color: var(--form-primary);
}

.form-toolbar-progress .progress::-webkit-progress-value {
    background: var(--form-primary);
}

.form-toolbar-progress .progress::-moz-progress-bar {
    background: var(--form-primary);
}

.form-toolbar-progress-copy span,
.form-bottom-actions > span {
    color: #6c7e87;
    font-size: 0.72rem;
}

.form-toolbar-progress-copy span.is-dirty,
.form-bottom-actions > span.is-dirty {
    color: #9a5b13;
    font-weight: 650;
}

.form-toolbar-progress-copy span.is-saved,
.form-bottom-actions > span.is-saved {
    color: #176b5b;
    font-weight: 700;
}

.form-toolbar-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

#assessment-form .form-toolbar-actions .btn-ghost {
    color: #526a76;
}

.form-components {
    display: grid;
    gap: 0.9rem;
}

.component-nav-symbol .form-icon,
.form-component-code .form-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.health-condition-area {
    margin-bottom: 0.9rem;
}

.health-condition-body label {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    color: #173d38;
    font-size: 0.75rem;
    font-weight: 700;
}

.health-condition-body label span {
    color: #526a64;
    font-weight: 500;
}

.health-condition-body .textarea {
    width: 100%;
}

.patient-perspective-area {
    margin-bottom: 0.9rem;
}

.patient-perspective-heading {
    margin: 0 0 0.45rem;
    color: #173d38;
    font-size: 0.95rem;
    font-weight: 750;
}

.patient-perspective-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.patient-perspective-panel {
    min-width: 0;
}

.narrative-header {
    display: block;
    padding: 0.6rem 0.75rem;
}

.narrative-header .form-component-heading {
    align-items: center;
}

.narrative-body {
    padding: 0.55rem 0.75rem 0.65rem;
}

.narrative-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
}

.narrative-composer label,
.narrative-composer .input {
    width: 100%;
    min-width: 0;
}

.narrative-entry-list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.narrative-entry-list:not(:empty) + .narrative-composer {
    margin-top: 0.35rem;
}

.narrative-entry-list:empty {
    display: none;
}

.narrative-entry {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.25rem;
    border-bottom: 1px solid #e2e9ed;
    padding: 0.2rem 0;
}

.narrative-entry:last-child {
    border-bottom: 0;
}

.narrative-entry.is-dragging {
    opacity: 0.5;
}

.narrative-entry-drag {
    display: inline-grid;
    width: 1.5rem;
    height: 1.5rem;
    cursor: grab;
    place-items: center;
    border: 1px solid #cfddd6;
    border-radius: 0.25rem;
    background: #f7faf8;
    padding: 0;
    color: #627b71;
    font-size: 1rem;
    line-height: 1;
    user-select: none;
}

.narrative-entry-drag:active {
    cursor: grabbing;
}

.narrative-entry-content,
.narrative-entry-editor {
    min-width: 0;
}

.personal-factor-entry {
    grid-template-areas:
        "description drag actions"
        "qualifier qualifier qualifier";
    align-items: start;
}

.personal-factor-entry > .narrative-entry-content {
    grid-area: description;
}

.personal-factor-entry > .narrative-entry-drag {
    grid-area: drag;
}

.personal-factor-entry > .narrative-entry-actions {
    grid-area: actions;
}

.personal-factor-entry > .narrative-entry-qualifier {
    grid-area: qualifier;
}

.personal-factor-entry .narrative-entry-content {
    display: grid;
    gap: 0.3rem;
}

.narrative-entry-qualifier {
    min-width: 0;
    max-width: 38rem;
    border: 1px solid #dce8e1;
    border-radius: 0.35rem;
    background: #f7faf8;
    padding: 0.35rem 0.4rem;
}

.narrative-entry-editor,
.narrative-entry-editor .input {
    width: 100%;
}

.narrative-entry-editor .input {
    font-size: 0.8rem;
}

.narrative-entry-view {
    width: 100%;
    min-height: 1.75rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    background: transparent;
    padding: 0.3rem 0.25rem 0.3rem 0;
    color: #172832;
    font-size: 0.8rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-align: left;
}

.narrative-entry-view:hover {
    color: var(--form-primary);
}

.narrative-entry-actions {
    display: flex;
    align-items: center;
    gap: 0.05rem;
    border-left: 1px solid #dce8e1;
    padding-left: 0.25rem;
}

.narrative-entry-actions .btn {
    min-height: 1.5rem;
    padding-inline: 0.35rem;
}

@media (hover: hover) and (pointer: fine) {
    .narrative-entry-drag,
    .narrative-entry-actions {
        opacity: 0;
    }

    .narrative-entry:hover .narrative-entry-drag,
    .narrative-entry:hover .narrative-entry-actions,
    .narrative-entry:focus-within .narrative-entry-drag,
    .narrative-entry:focus-within .narrative-entry-actions {
        opacity: 1;
    }
}

.narrative-entry-remove {
    color: #6c5555;
}

.narrative-entry-remove:hover {
    background: #f7efef;
    color: #8a3d3d;
}

.narrative-undo {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.5rem;
    color: #496672;
    font-size: 0.75rem;
}

.narrative-entry[hidden],
.narrative-entry-view[hidden],
.narrative-entry-editor[hidden],
.narrative-undo[hidden] {
    display: none;
}

.narrative-field {
    display: grid;
    min-width: 0;
    color: #334d59;
}

.narrative-field .input,
.narrative-field .textarea {
    width: 100%;
    min-width: 0;
    border-color: #c4d1d8;
    background: #fff;
    color: #172832;
    font-size: 0.8rem;
    font-weight: 400;
}

.narrative-field .input::placeholder,
.narrative-field .textarea::placeholder {
    color: #82919a;
}

.narrative-noscript {
    margin-top: 0.75rem;
}

.form-component {
    overflow: hidden;
    scroll-margin-top: 6rem;
    border: 1px solid #bccbd3;
    border-radius: 0.5rem;
    background: #fff;
}

.form-component-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem 1rem;
    border-bottom: 1px solid #b9cbd4;
    background: var(--form-primary-soft);
    padding: 0.75rem;
    color: #173b49;
}

.form-component-heading {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 0.75rem;
}

.form-component-code {
    display: inline-grid;
    width: 1.9rem;
    height: 1.9rem;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid #9cb8c5;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.65);
    color: var(--form-primary);
    font-size: 1rem;
    font-weight: 800;
}

.form-component-header h2 {
    color: oklch(var(--bc));
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.3;
}

.form-component-guidance {
    margin-top: 0.2rem;
    color: #3f606e;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
}

.form-component-description {
    grid-column: 1 / -1;
    margin: 0;
    color: #496672;
    font-size: 0.8rem;
    line-height: 1.5;
}

.form-component-count {
    align-self: start;
    border: 1px solid #aac0cb;
    border-radius: 999px;
    background: #fff;
    padding: 0.25rem 0.6rem;
    color: #315664;
    font-size: 0.72rem;
    font-weight: 650;
    white-space: nowrap;
}

.scale-guide {
    grid-column: 1 / -1;
}

.scale-guide > summary {
    display: inline-flex;
    cursor: pointer;
    align-items: center;
    gap: 0.3rem;
    border-radius: 0.25rem;
    color: #315d6e;
    font-size: 0.75rem;
    font-weight: 700;
    list-style: none;
}

.scale-guide > summary::-webkit-details-marker {
    display: none;
}

.scale-guide > summary::before {
    content: "+";
    width: 0.9rem;
    font-size: 0.95rem;
    text-align: center;
}

.scale-guide[open] > summary::before {
    content: "−";
}

.scale-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.35rem;
    margin-top: 0.65rem;
}

.scale-guide-grid > div {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    border-top: 1px solid #c4d6de;
    padding-top: 0.35rem;
    color: #476571;
    font-size: 0.72rem;
    line-height: 1.35;
}

.scale-guide-grid strong {
    display: inline-grid;
    min-width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
    place-items: center;
    border-radius: 0.2rem;
    background: #fff;
    color: var(--form-primary);
}

.form-component-body {
    padding: 0 0.6rem 0.6rem;
}

.form-chapter {
    min-width: 0;
    scroll-margin-top: 6rem;
    margin: 0;
    border: 0;
    background: transparent;
}

.form-chapter > .chapter-summary {
    min-height: 2.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid #d7e0e5;
    border-radius: 0;
    padding: 0.45rem 0.15rem;
    background: #fff;
    color: #2a434f;
    font-size: 0.82rem;
}

.form-chapter > .chapter-summary:hover {
    color: var(--form-primary);
}

.form-chapter:not([open]) > .chapter-summary {
    border-bottom: 0;
}

.chapter-title {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 0.5rem;
}

.chapter-code {
    flex-shrink: 0;
    color: var(--form-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    font-weight: 750;
}

.chapter-meta {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.65rem;
    color: #73858e;
    font-size: 0.7rem;
    font-weight: 500;
}

.form-chapter > .chapter-content {
    padding: 0.5rem 0 0.2rem;
}

.form-chapter-categories,
.form-category-children {
    display: grid;
    min-width: 0;
    gap: 0.5rem;
    margin-left: 0;
    border-left: 0;
    padding-left: 0;
}

.form-child-chapters {
    margin: 0.75rem 0 0;
    border-left: 0;
    padding-left: 0;
}

.form-category-children,
.form-child-chapters {
    margin-left: 0.85rem;
    border-left: 2px solid #dbe5ea;
    padding-left: 0.85rem;
}

.form-category-context {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 0;
    padding: 0.15rem 0.2rem;
    color: #75868f;
    font-size: 0.75rem;
    line-height: 1.35;
}

.context-code {
    color: #536d79;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
}

.context-label {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.68rem;
}

.assessment-category {
    min-width: 0;
    overflow: visible;
    scroll-margin-top: 6rem;
    border: 1px solid #c8d4db;
    border-radius: 0.45rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(33, 57, 68, 0.04);
}

.assessment-category.is-answered {
    border-color: var(--form-success-border);
    border-left: 3px solid var(--form-success);
}

.is-answered > .category-heading {
    background: var(--form-success-soft);
}

.category-heading {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid #dce4e9;
    border-radius: 0.4rem 0.4rem 0 0;
    background: #f8fafb;
    padding: 0.5rem 0.7rem;
}

.category-title-group {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 0.65rem;
}

.category-code {
    flex-shrink: 0;
    padding: 0;
    color: var(--form-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    font-weight: 750;
    line-height: 1.4;
}

.category-heading h3 {
    min-width: 0;
    color: #1c333e;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
}

.category-status {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid #ccd6dc;
    border-radius: 999px;
    background: #fff;
    padding: 0.15rem 0.45rem;
    color: #6c7e87;
    font-size: 0.67rem;
    font-weight: 650;
    line-height: 1.4;
}

.category-status::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #a5b2b8;
}

.is-answered .category-status::before {
    width: auto;
    height: auto;
    background: transparent;
    content: "✓";
    font-size: 0.65rem;
    line-height: 1;
}

.is-answered .category-status {
    border-color: #afd0c7;
    background: #eaf5f1;
    color: #216858;
}

.category-layout {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0;
}

.category-reference {
    position: relative;
    min-width: 0;
    margin: 0;
    border: 0;
    padding: 0.55rem 0.7rem;
    color: #435a65;
    font-size: 0.8rem;
    line-height: 1.45;
}

.category-reference-empty {
    color: #7a8b94;
    font-size: 0.78rem;
    font-style: italic;
}

.category-description,
.category-reference-empty {
    margin: 0;
    padding-right: 1.75rem;
    padding-left: 1.5rem;
}

.form-icon {
    display: block;
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}

.category-reference-title {
    position: absolute;
    top: 0.55rem;
    left: 0.7rem;
    margin: 0;
    color: #617680;
    line-height: 1;
}

.category-reference-details {
    margin-top: 0;
}

.category-reference-details > summary {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    display: inline-flex;
    width: 1.65rem;
    height: 1.65rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    color: var(--form-primary);
    list-style: none;
}

.category-reference-details > summary:hover,
.category-reference-details[open] > summary {
    background: var(--form-primary-soft);
}

.category-reference-details > summary.icon-disclosure::before,
.category-reference-details[open] > summary.icon-disclosure::before {
    content: none;
}

.category-reference-content {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.65rem;
    border-top: 1px solid #dce4e9;
    padding-top: 0.65rem;
}

.reference-row h4 {
    margin-bottom: 0.2rem;
    color: #304b58;
    font-size: 0.75rem;
    font-weight: 750;
}

.reference-link {
    color: var(--form-primary);
    font-size: 0.75rem;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

.qualifier-matrix {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-column: auto;
    grid-row: auto;
    gap: 0.3rem;
    align-content: start;
    border: 0;
    border-top: 1px solid #dce4e9;
    border-radius: 0;
    background: #f7fafb;
    padding: 0.55rem 0.7rem;
}

.qualifier-row {
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr) 1.5rem;
    align-items: center;
    gap: 0.35rem;
}

.qualifier-control-group {
    display: contents;
}

.qualifier-label {
    color: #314d5a;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: right;
}

.qualifier-control {
    --qualifier-option-width: 1.85rem;
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.4rem;
}

.qualifier-options-scroll {
    min-width: 0;
}

.qualifier-special-options {
    display: grid;
    grid-template-columns: repeat(2, var(--qualifier-option-width));
    gap: 0.2rem;
    border-left: 1px solid #ccd8de;
    padding-left: 0.4rem;
}

.qualifier-special-options .qualifier-option {
    min-width: 1.85rem;
}


.qualifier-options {
    display: grid;
    width: max-content;
    margin-left: auto;
    grid-template-columns: repeat(var(--option-count), var(--qualifier-option-width));
    gap: 0.2rem;
}

.qualifier-option {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 1.85rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border: 1px solid #b7c6ce;
    border-radius: 0.3rem;
    background: #fff;
    padding: 0;
    color: #38545f;
}

.qualifier-option:hover {
    border-color: #4b8296;
    background: var(--form-primary-soft);
}

.qualifier-option .radio {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
}

.qualifier-option-value {
    pointer-events: none;
    font-size: 0.77rem;
    font-weight: 700;
    line-height: 1;
}

.qualifier-option:has(input:checked) {
    border-color: var(--form-primary);
    background: var(--form-primary);
    color: var(--form-primary-content);
    box-shadow: inset 0 0 0 1px var(--form-primary);
}

.qualifier-option:has(input:focus-visible) {
    outline: 2px solid var(--form-primary);
    outline-offset: 2px;
}

.qualifier-option:has(input:disabled) {
    cursor: not-allowed;
    border-color: #d8e0e4;
    background: #edf1f3;
    color: #93a1a8;
    opacity: 1;
}

.qualifier-option:has(input:disabled) .radio {
    cursor: not-allowed;
}

.qualifier-option.tooltip::before {
    z-index: 50;
    width: max-content;
    max-width: 16rem;
    white-space: normal;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
}

.qualifier-option:focus-within::before,
.qualifier-option:focus-within::after {
    opacity: 1;
}

.qualifier-clear {
    display: inline-grid;
    width: 1.5rem;
    min-height: 1.5rem;
    height: 1.5rem;
    cursor: pointer;
    place-items: center;
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    padding: 0;
    color: #6c7e87;
    font-size: 1rem;
}

.qualifier-clear:hover:not(:disabled) {
    background: #e5ecef;
    color: #254b5a;
}

.qualifier-clear:disabled {
    cursor: default;
    opacity: 0.3;
}

.qualifier-help {
    margin: 0;
    color: #70828b;
    font-size: 0.69rem;
    line-height: 1.4;
}

.category-details {
    border-top: 1px solid #dce4e9;
}

.category-details > summary {
    display: flex;
    min-height: 1.8rem;
    cursor: pointer;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    color: var(--form-primary);
    list-style: none;
}

.category-details > summary::-webkit-details-marker {
    display: none;
}

.category-details > summary.icon-disclosure::before,
.category-details[open] > summary.icon-disclosure::before {
    content: none;
}

.category-details > summary:hover,
.category-details[open] > summary {
    background: var(--form-primary-soft);
}

.category-details-hint {
    margin-left: auto;
    color: #7a8a93;
    font-size: 0.7rem;
    font-weight: 400;
}

.category-details-content {
    padding: 0.15rem 0.9rem 0.9rem;
}

.source-bar {
    display: block;
    min-width: 0;
    margin: 0;
    border: 0;
    padding: 0 0 0.8rem;
}

.source-bar legend {
    margin-bottom: 0.4rem;
    padding: 0;
    color: #425e6a;
    font-size: 0.74rem;
    font-weight: 700;
}

.source-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

.source-option {
    display: flex;
    min-height: 1.8rem;
    cursor: pointer;
    align-items: center;
    gap: 0.35rem;
    border-radius: 0.25rem;
    padding: 0.15rem 0.25rem;
    color: #4c626c;
    font-size: 0.74rem;
    line-height: 1.3;
}

.source-option:hover,
.source-option:has(input:checked) {
    background: var(--form-primary-soft);
    color: #254d5d;
}

.source-option .checkbox {
    border-color: #9fb2bc;
}

.category-note-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    border-top: 1px solid #e2e8ec;
    padding-top: 0.75rem;
}

.category-brief-note {
    border: 0;
    padding: 0;
}

.category-brief-note label span,
.category-detailed-note label span {
    display: block;
    margin-top: 0.1rem;
    color: #7a8b93;
    font-size: 0.67rem;
    font-weight: 400;
}

.category-detailed-note .textarea {
    min-height: 2.4rem;
    resize: vertical;
}

.category-note-grid .detailed-notes {
    margin: 0;
}

.form-no-results {
    border: 1px dashed #b8c8d0;
    border-radius: 0.5rem;
    background: #fff;
    padding: 3rem 1rem;
    text-align: center;
}

.form-no-results h2 {
    color: #2a4653;
    font-size: 1rem;
    font-weight: 700;
}

.form-no-results p {
    margin: 0.35rem 0 1rem;
    color: #6b7f89;
    font-size: 0.82rem;
}

.form-bottom-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #ccd8de;
    padding: 1rem 0;
}

@media (min-width: 1280px) {
    .category-layout {
        grid-template-columns: minmax(0, 1fr) minmax(23rem, 25rem);
    }

    .category-reference {
        grid-column: 1;
        grid-row: 1;
    }

    .qualifier-matrix {
        grid-column: 2;
        grid-row: 1;
        border-top: 0;
        border-left: 1px solid #dce4e9;
    }
}

@media (max-width: 1023px) {
    .form-page-header {
        display: block;
    }

    .form-header-actions {
        justify-content: flex-start;
        margin-top: 0.85rem;
        padding-top: 0;
    }

    .form-output-actions {
        top: calc(100% + 0.25rem);
        right: auto;
        left: 0;
    }

    .form-workspace {
        display: block;
    }

    body.form-navigation-open {
        overflow: hidden;
    }

    .form-sidebar {
        position: fixed;
        z-index: 90;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(22rem, calc(100vw - 3rem));
        max-height: none;
        margin: 0;
        overflow-y: auto;
        border-radius: 0 0.75rem 0.75rem 0;
        box-shadow: 0 0 2rem rgba(23, 61, 56, 0.2);
    }

    .form-sidebar .form-sidebar-mobile-header {
        position: sticky;
        z-index: 2;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #dce4e9;
        background: #fff;
        padding: 0.55rem 0.65rem 0.55rem 0.9rem;
        color: #2b424e;
        font-size: 0.82rem;
    }

    .form-navigation-backdrop {
        position: fixed;
        z-index: 80;
        inset: 0;
        cursor: pointer;
        border: 0;
        background: rgba(23, 61, 56, 0.38);
        padding: 0;
    }

    .form-sidebar-progress {
        display: none;
    }

    .form-filters {
        grid-template-columns: minmax(0, 1fr) 11rem;
        padding: 0.75rem;
    }

    .form-section-controls {
        grid-column: 1 / -1;
    }

    .form-filter-status {
        display: inline-block;
        padding: 0 0.8rem;
    }

    .form-sidebar .component-nav {
        display: block;
        padding: 0.65rem;
    }

    .form-sidebar .component-nav > h2 {
        padding: 0 0.2rem 0.25rem;
    }

    .component-nav-group {
        padding: 0;
    }

    .form-sidebar .component-nav-group > a {
        height: 100%;
        border: 1px solid #d2dde2;
        border-radius: 0.35rem;
        padding: 0.5rem;
    }

    .form-sidebar .component-nav-group > a[aria-current="location"] {
        border-color: #7ca6b7;
    }

    .chapter-nav {
        display: block;
    }
}

@media (max-width: 639px) {
    .form-page-header h1 {
        font-size: 1.5rem;
    }

    .form-output-actions {
        width: min(15rem, calc(100vw - 2rem));
    }

    .category-note-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-toolbar {
        top: 0.35rem;
        flex-wrap: wrap;
        padding: 0.5rem;
    }

    .form-toolbar-progress {
        width: 100%;
        max-width: none;
        padding: 0 0.2rem;
    }

    .form-toolbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .form-toolbar-actions .next-unanswered {
        flex: 1 0 100%;
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .form-toolbar-actions .btn {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .form-toolbar-actions .btn-primary {
        flex: 1;
    }

    .form-component {
        scroll-margin-top: 8rem;
    }

    .form-component-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        padding: 0.85rem;
    }

    .form-component-count {
        justify-self: start;
        margin-left: 3rem;
    }

    .form-component-body {
        padding: 0 0.45rem 0.45rem;
    }

    .narrative-body {
        padding: 0.45rem;
    }

    .form-chapter,
    .assessment-category {
        scroll-margin-top: 8rem;
    }

    .chapter-meta > span {
        display: none;
    }

    .form-category-children,
    .form-child-chapters {
        margin-left: 0.25rem;
        padding-left: 0.3rem;
    }

    .category-heading {
        gap: 0.5rem;
        padding: 0.65rem;
    }

    .category-title-group {
        display: grid;
        gap: 0.2rem;
    }

    .category-reference,
    .qualifier-matrix {
        padding: 0.75rem 0.65rem;
    }

    .qualifier-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem;
    }

    .qualifier-label {
        flex: 0 0 auto;
    }

    .qualifier-clear {
        flex: 0 0 1.5rem;
    }

    .qualifier-control-group {
        display: flex;
        min-width: 0;
        flex: 1 1 16rem;
        align-items: center;
        gap: 0.35rem;
    }

    .qualifier-control {
        --qualifier-option-width: 1.75rem;
        min-width: 0;
        flex: 1 1 auto;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .qualifier-options-scroll {
        overflow-x: auto;
        padding: 2px;
    }

    .qualifier-special-options {
        width: auto;
        justify-self: auto;
        border-left: 1px solid #ccd8de;
        padding-left: 0.4rem;
    }

    .qualifier-special-options .qualifier-option {
        min-width: 1.75rem;
    }

    .qualifier-option {
        min-height: 2.25rem;
    }

    .personal-factor-entry .narrative-entry-qualifier {
        max-width: none;
        padding: 0.45rem 0.5rem;
    }

    .personal-factor-entry .qualifier-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 1.75rem;
        gap: 0.35rem;
    }

    .personal-factor-entry .qualifier-label {
        display: none;
    }

    .personal-factor-entry .qualifier-control-group {
        display: contents;
    }

    .personal-factor-entry .qualifier-control {
        grid-column: 1;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.4rem;
    }

    .personal-factor-entry .qualifier-options-scroll {
        overflow: visible;
        padding: 0;
    }

    .personal-factor-entry .qualifier-options {
        width: 100%;
        grid-template-columns: repeat(9, minmax(0, 1fr));
        gap: 0;
        margin: 0;
    }

    .personal-factor-entry .qualifier-option {
        min-width: 0;
        min-height: 2.25rem;
        border-right: 0;
        border-radius: 0;
    }

    .personal-factor-entry .qualifier-option:first-child {
        border-radius: 0.25rem 0 0 0.25rem;
    }

    .personal-factor-entry .qualifier-option:last-child {
        border-right: 1px solid #b7c6ce;
        border-radius: 0 0.25rem 0.25rem 0;
    }

    .personal-factor-entry .qualifier-special-options {
        grid-template-columns: repeat(2, 1.75rem);
        gap: 0;
    }

    .personal-factor-entry .qualifier-special-options .qualifier-option {
        min-width: 0;
    }

    .personal-factor-entry .qualifier-clear {
        grid-column: 2;
        width: 1.75rem;
        min-height: 2.25rem;
        height: 2.25rem;
    }

    .category-details > summary {
        padding: 0.35rem 0.65rem;
    }

    .category-details-hint {
        display: none;
    }

    .category-details-content {
        padding: 0.15rem 0.65rem 0.75rem;
    }

    .source-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.25rem;
    }

    .source-option {
        min-height: 2rem;
    }

    .form-bottom-actions {
        justify-content: space-between;
    }
}

/* Shared builder palette, with muted accents for ICF component wayfinding. */
.form-page {
    --form-primary: #176b5b;
    --form-primary-content: #fff;
    --form-primary-soft: #e8f2ed;
    --form-primary-hover: #105247;
    --component-accent: #176b5b;
    --component-soft: #e8f2ed;
}

.form-page .form-component[data-component-code="b"],
.form-page .component-nav-group > a[data-component-nav="b"] {
    --component-accent: #316f8e;
    --component-soft: #edf5f8;
}

.form-page .form-component[data-component-code="s"],
.form-page .component-nav-group > a[data-component-nav="s"] {
    --component-accent: #765f91;
    --component-soft: #f3f0f7;
}

.form-page .form-component[data-component-code="d"],
.form-page .component-nav-group > a[data-component-nav="d"] {
    --component-accent: #176b5b;
    --component-soft: #e8f2ed;
}

.form-page .form-component[data-component-code="e"],
.form-page .component-nav-group > a[data-component-nav="e"] {
    --component-accent: #91672c;
    --component-soft: #faf3e8;
}

.form-page .form-page-header h1,
.form-page .form-component-header h2,
.form-page .category-heading h3 {
    color: #173d38;
}

.form-page .form-page-header p,
.form-page .form-component-description,
.form-page .form-component-guidance {
    color: #526a64;
}

.form-page .form-output-actions .btn-outline,
.form-page #assessment-form .btn-outline {
    border-color: #9eb9ae;
    color: #294d43;
}

.form-page .form-output-actions .btn-outline:hover,
.form-page #assessment-form .btn-outline:hover {
    border-color: #176b5b;
    background: #e8f2ed;
    color: #105247;
}

.form-page .form-sidebar,
.form-page .form-toolbar,
.form-page .form-component,
.form-page .assessment-category {
    border-color: #cfddd6;
}

.form-page .form-sidebar,
.form-page .form-toolbar {
    background: rgba(255, 255, 255, 0.97);
}

.form-page .form-filters :is(.input, .select),
.form-page .category-note-grid :is(.input, .textarea) {
    border-color: #b8ccc2;
}

.form-page .form-sidebar .component-nav,
.form-page .form-component-header,
.form-page .category-heading,
.form-page .qualifier-matrix,
.form-page .form-chapter > .chapter-summary {
    border-color: #dce8e1;
}

.form-page .form-component-header {
    background: var(--component-soft);
    color: var(--component-accent);
}

.form-page .form-component-code {
    border-color: color-mix(in srgb, var(--component-accent) 42%, white);
    background: rgba(255, 255, 255, 0.72);
    color: var(--component-accent);
}

.form-page .form-component-count {
    border-color: color-mix(in srgb, var(--component-accent) 30%, white);
    color: var(--component-accent);
}

.form-page .chapter-code,
.form-page .category-code,
.form-page .scale-guide > summary,
.form-page .scale-guide-grid strong {
    color: var(--component-accent);
}

.form-page .form-sidebar .component-nav-group > a:hover {
    border-left-color: var(--component-accent);
    background: var(--component-soft);
    color: var(--component-accent);
}

.form-page .form-sidebar .component-nav-group > a[aria-current="location"] {
    border-left-color: var(--component-accent);
    background: var(--component-soft);
    color: var(--component-accent);
}

.form-page .component-nav-code {
    border-color: color-mix(in srgb, var(--component-accent) 35%, white);
    color: var(--component-accent);
}

.form-page .form-sidebar .component-nav > h2,
.form-page .form-section-controls,
.form-page .form-filter-status,
.form-page .chapter-nav-link,
.form-page .chapter-meta {
    color: #526a64;
}

.form-page .form-sidebar .component-nav .chapter-nav-link:hover {
    background: #e8f2ed;
    color: #105247;
}

.form-page .category-heading {
    background: #f7faf8;
}

.form-page .qualifier-matrix {
    background: #f7faf8;
}

.form-page .qualifier-option:hover {
    border-color: #176b5b;
    background: #e8f2ed;
}

.form-page #assessment-form .checkbox:checked {
    border-color: #176b5b;
    background-color: #176b5b;
}

.form-page .scale-guide-grid > div,
.form-page .form-bottom-actions,
.form-page .category-reference-content {
    border-color: #cfddd6;
}

.builder-form-mode {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.45rem;
    color: #36564d;
    font-size: 0.72rem;
    font-weight: 700;
}

.builder-form-mode .select {
    min-width: 7rem;
}

.patient-perspective-disclosure > .patient-perspective-summary {
    display: flex;
    min-height: 3rem;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--form-primary-soft);
    padding: 0.65rem 0.8rem;
    color: #173d38;
    list-style: none;
}

.patient-perspective-disclosure > .patient-perspective-summary::-webkit-details-marker {
    display: none;
}

.patient-perspective-title {
    font-size: 0.9rem;
    font-weight: 750;
}

.patient-perspective-title::before {
    content: "+";
    display: inline-block;
    width: 1.1rem;
    color: #176b5b;
}

.patient-perspective-disclosure[open] .patient-perspective-title::before {
    content: "−";
}

.patient-perspective-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #526a64;
    font-size: 0.7rem;
}

.patient-perspective-action {
    color: #176b5b;
    font-weight: 700;
}

.patient-perspective-disclosure[open] > .patient-perspective-summary {
    border-bottom: 1px solid #dce8e1;
}

.form-title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.9rem;
}

.form-layout-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    border: 1px solid #b8ccc2;
    border-radius: 0.45rem;
    background: #edf5f0;
    padding: 0.18rem;
}

.form-layout-option {
    cursor: pointer;
    border: 0;
    border-radius: 0.3rem;
    background: transparent;
    padding: 0.28rem 0.6rem;
    color: #526a64;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
}

.form-layout-option:hover {
    color: #176b5b;
}

.form-layout-option.is-active {
    background: #176b5b;
    color: #fff;
}

.form-layout-option:focus-visible {
    outline: 2px solid #176b5b;
    outline-offset: 2px;
}

.form-workspace.is-sidebar-hidden {
    grid-template-columns: minmax(0, 1fr);
}

.form-sidebar[hidden],
.form-navigation-backdrop[hidden] {
    display: none;
}

.form-sidebar-mobile-header {
    display: none;
}

.assessment-navigation-toggle {
    flex-shrink: 0;
    gap: 0.4rem;
    border-right: 1px solid #dbe4e8;
    border-radius: 0;
    padding-right: 0.75rem;
    white-space: nowrap;
}

.assessment-navigation-toggle svg,
.category-selection-edit svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.category-selection-edit {
    gap: 0.4rem;
    margin-top: 0.45rem;
    padding-right: 0.4rem;
    padding-left: 0;
    color: #36564d;
}

.category-selection-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: var(--form-primary-soft);
    padding: 0 0.35rem;
    color: var(--form-primary);
    font-size: 0.7rem;
    font-weight: 750;
}

.concise-components {
    gap: 0;
}

.concise-components > .form-component {
    border-bottom: 0;
    border-radius: 0;
}

.concise-components > .form-component:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.concise-components > .form-component:last-child {
    border-bottom: 1px solid #bccbd3;
    border-radius: 0 0 0.5rem 0.5rem;
}

.concise-profile-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.concise-component-count {
    color: #526a64;
    font-size: 0.68rem;
    font-weight: 650;
    white-space: nowrap;
}

.concise-table-scroll {
    overflow-x: auto;
}

.concise-assessment-table {
    min-width: 49.5rem;
}

.functioning-profile .concise-assessment-scale-column {
    width: 19rem;
}

.functioning-profile-editing.concise-evaluation-table {
    min-width: 48rem;
}

.functioning-profile-editing.concise-evaluation-table .profile-goal-column,
.functioning-profile-editing.concise-evaluation-table .profile-evaluation-column {
    width: 17rem;
}

@media (max-width: 639px) {
    .functioning-profile-editing.concise-evaluation-table {
        min-width: 80rem;
    }
}

.concise-evaluation-table .profile-evaluation-value-cell {
    padding: 0 !important;
}

.concise-evaluation-table .profile-target-control,
.concise-evaluation-table .personal-influence-control {
    padding: 0;
}

.concise-evaluation-table .concise-rating .profile-target-segment,
.concise-evaluation-table .concise-rating .personal-influence-segment {
    height: 1.5rem;
}

.concise-evaluation-table .concise-rating-clear {
    width: 1.5rem;
    height: 1.5rem;
}

.concise-assessment-table > thead th:last-child {
    text-align: center;
}

.concise-scale-heading {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr) 1.4rem;
    align-items: end;
    gap: 0.2rem;
}

.concise-scale-heading-control {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 5fr) minmax(0, 2fr);
    align-items: end;
    gap: 0.3rem;
}

.concise-scale-heading-environmental .concise-scale-heading-control {
    grid-template-columns: minmax(0, 9fr) minmax(0, 2fr);
}

.concise-scale-heading-main {
    min-width: 0;
}

.concise-assessment-table .concise-scale-heading .profile-scale-title,
.concise-assessment-table .concise-scale-heading .profile-scale-labels {
    margin-right: 0;
    margin-left: 0;
}

.concise-assessment-table .concise-scale-heading .profile-scale-title {
    justify-content: space-between;
    gap: 0.35rem;
}

.concise-assessment-table .concise-scale-special-labels {
    align-self: end;
    border-left: 1px solid #cfddd6;
    padding-left: 0.3rem;
}

.concise-category-title {
    font-size: 0.78rem;
    font-weight: 400;
}

.concise-category.is-answered .profile-code {
    box-shadow: inset 3px 0 #4b8d78;
}

.concise-rating-cell {
    padding: 0 !important;
}

.concise-rating {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr) 1.4rem;
    align-items: center;
    gap: 0.2rem;
}

.concise-rating-control {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 5fr) minmax(0, 2fr);
    align-items: center;
    gap: 0.3rem;
}

.concise-rating[data-qualifier="environmental"] .concise-rating-control {
    grid-template-columns: minmax(0, 9fr) minmax(0, 2fr);
}

.concise-rating:is([data-qualifier="nature"], [data-qualifier="location"]) .concise-rating-control {
    grid-template-columns: minmax(0, 8fr) minmax(0, 2fr);
}

.concise-rating-options {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.concise-rating-options .profile-target-segment,
.concise-rating-options .personal-influence-segment,
.concise-special-options .profile-target-segment {
    width: auto;
}

.concise-special-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 1px solid #cfddd6;
    padding-left: 0.3rem;
}

.concise-rating .profile-target-segment {
    height: 1.3rem;
    border-color: #9eb9ae;
}

.concise-rating-clear {
    width: 1.4rem;
    min-height: 1.4rem;
    height: 1.4rem;
}

.concise-rating.is-disabled .concise-rating-control {
    opacity: 0.45;
}

.concise-rating.is-disabled .concise-rating-control label {
    cursor: not-allowed;
}

.concise-category-tools > td {
    padding: 0;
}

.concise-category-toggle {
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font: inherit;
    text-align: left;
}

.concise-category-toggle:hover {
    color: #176b5b;
}

.concise-title-toggle {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 0.25rem;
}

.concise-title-toggle:hover > span {
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

.concise-category-chevron {
    width: 0.75rem;
    height: 0.75rem;
    flex: 0 0 auto;
    color: #6c847b;
    transition: transform 120ms ease;
}

.concise-category-toggle[aria-expanded="true"] .concise-category-chevron {
    transform: rotate(180deg);
}

.concise-category-details > summary.concise-category-details-summary {
    display: none;
}

.concise-category-detail-content {
    display: grid;
    gap: 0.75rem;
    background: #fff;
    padding: 0.75rem;
}

.concise-reference-panel {
    color: #435a65;
    font-size: 0.76rem;
    line-height: 1.45;
}

.concise-reference-panel > p {
    margin: 0;
}

.concise-reference-row {
    margin-top: 0.45rem;
}

.concise-reference-row p {
    margin: 0.1rem 0 0;
}

.concise-additional-qualifiers {
    display: grid;
    width: 14.5rem;
    max-width: 100%;
    margin-left: auto;
    gap: 0.35rem;
    border-top: 1px solid #dce8e1;
    padding-top: 0.6rem;
}

.concise-additional-qualifiers .concise-rating {
    grid-template-columns: 4rem minmax(0, 1fr) 1.4rem;
}

.concise-additional-qualifiers .profile-qualifier-label {
    grid-column: 1;
    text-align: right;
    white-space: nowrap;
}

.concise-additional-qualifiers .concise-rating-control {
    grid-column: 2;
}

.concise-additional-qualifiers .concise-rating-clear {
    grid-column: 3;
}

.concise-personal-cell {
    padding: 0 !important;
}

.concise-personal-body {
    padding: 0;
}

.concise-personal-table-head,
.concise-personal-entry,
.concise-personal-composer {
    display: grid;
    min-width: 0;
    grid-template-columns: 3.25rem minmax(8rem, 1fr) 19rem auto auto;
    align-items: center;
}

.concise-personal-table-head {
    min-height: 1.7rem;
    border-bottom: 1px solid #dce8e1;
    background: #f7faf8;
    color: #526a64;
    font-size: 0.68rem;
    font-weight: 700;
}

.concise-personal-table-head > span {
    padding: 0.25rem 0.5rem;
}

.concise-personal-table-head > span:last-child {
    grid-column: 4 / -1;
    padding-right: 4.5rem;
    text-align: right;
}

.concise-personal-entry {
    gap: 0;
    border-bottom: 1px solid #dce8e1;
    background: #fff;
    padding: 0;
}

.concise-personal-entry:last-child {
    border-bottom: 1px solid #dce8e1;
}

.concise-personal-code {
    display: flex;
    min-height: 1.95rem;
    align-items: center;
    align-self: stretch;
    border-right: 1px solid #dce8e1;
    padding: 0.25rem 0.5rem;
    color: #435a65;
    font-size: 0.72rem;
    font-weight: 650;
}

.concise-personal-entry .narrative-entry-content {
    min-width: 0;
    padding: 0.1rem 0.5rem;
}

.concise-personal-qualifier {
    min-width: 0;
    align-self: stretch;
    border-left: 1px solid #dce8e1;
    padding: 0.3rem 0.35rem;
}

.concise-personal-qualifier .concise-rating {
    height: 100%;
}

.concise-personal-qualifier .concise-rating:has(.profile-qualifier-label:empty) {
    grid-template-columns: minmax(0, 1fr) 1.4rem;
}

.concise-personal-qualifier .profile-qualifier-label:empty {
    display: none;
}

.concise-personal-entry .narrative-entry-view {
    min-height: 1.65rem;
    padding: 0.15rem 0;
}

.concise-personal-entry .narrative-entry-editor .input {
    min-height: 1.65rem;
    height: 1.65rem;
    padding-inline: 0;
}

.concise-personal-entry .narrative-entry-actions {
    padding-right: 0.35rem;
}

.concise-personal-composer {
    background: #f7faf8;
}

.concise-personal-composer .concise-personal-code {
    color: #84968e;
}

.concise-personal-composer label {
    grid-column: 2;
    padding: 0.15rem 0.5rem;
}

.concise-personal-composer .input {
    min-height: 1.65rem;
    height: 1.65rem;
    padding-inline: 0;
}

.concise-personal-composer .btn {
    grid-column: 5;
    min-height: 1.55rem;
    height: 1.55rem;
    margin-right: 0.4rem;
    padding: 0;
}

.concise-personal-list:not(:empty) + .concise-personal-composer {
    margin-top: 0;
}

.concise-personal-body .narrative-undo {
    margin: 0;
    padding: 0.4rem 0.65rem;
}

@media (max-width: 639px) {
    .patient-perspective-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .builder-form-mode {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-content: space-between;
    }

    .builder-sticky-summary {
        grid-row: 2;
    }

    .builder-continue {
        grid-row: 2;
    }

    .builder-sticky-apply {
        grid-row: 3;
    }

    .patient-perspective-meta {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.1rem;
    }

    .concise-personal-table-head {
        grid-template-columns: 3.25rem minmax(0, 1fr);
    }

    .concise-personal-table-head > span:nth-child(3),
    .concise-personal-table-head > span:last-child {
        display: none;
    }

    .concise-personal-entry {
        grid-template-columns: 3.25rem minmax(0, 1fr) auto auto;
        grid-template-areas:
            "code description drag actions"
            "qualifier qualifier qualifier qualifier";
    }

    .concise-personal-entry > .concise-personal-code {
        grid-area: code;
    }

    .concise-personal-entry > .narrative-entry-content {
        grid-area: description;
    }

    .concise-personal-entry > .concise-personal-qualifier {
        grid-area: qualifier;
        border-top: 1px solid #dce8e1;
        border-left: 0;
        padding: 0.45rem 0.5rem;
    }

    .concise-personal-entry > .narrative-entry-drag {
        grid-area: drag;
    }

    .concise-personal-entry > .narrative-entry-actions {
        grid-area: actions;
    }

    .concise-personal-qualifier .concise-rating:has(.profile-qualifier-label:empty) {
        grid-template-columns: minmax(0, 1fr) 1.75rem;
    }

    .concise-personal-composer {
        grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    }

    .concise-personal-composer .btn {
        grid-column: 3;
    }

    .concise-table-scroll {
        overflow: visible;
    }

    .functioning-profile.concise-assessment-table {
        display: block;
        min-width: 0;
        table-layout: auto;
    }

    .concise-assessment-table > colgroup,
    .concise-assessment-table > thead {
        display: none;
    }

    .concise-assessment-table [hidden] {
        display: none !important;
    }

    .concise-assessment-table > tbody,
    .concise-assessment-table .profile-section-header,
    .concise-assessment-table .profile-section-header > th,
    .concise-assessment-table .concise-personal > tr,
    .concise-assessment-table .concise-personal-cell {
        display: block;
    }

    .concise-assessment-table .profile-section-header > th {
        width: auto;
        padding: 0.55rem 0.65rem;
    }

    .concise-assessment-table .profile-section-header > td {
        display: none;
    }

    .concise-assessment-table .concise-category {
        display: grid;
        grid-template-columns: 4rem minmax(0, 1fr);
        border-bottom: 2px solid #cfddd6;
    }

    .concise-assessment-table .concise-category-row,
    .concise-assessment-table .concise-category-tools {
        display: contents;
    }

    .concise-assessment-table .concise-category .profile-code,
    .concise-assessment-table .concise-category .profile-category {
        display: block;
        grid-row: 1;
        background: #f7faf8;
    }

    .concise-assessment-table .concise-category .profile-code {
        grid-column: 1;
    }

    .concise-assessment-table .concise-category .profile-category {
        grid-column: 2;
    }

    .concise-assessment-table .concise-rating-cell {
        display: block;
        grid-column: 1 / -1;
        padding: 0.5rem !important;
    }

    .concise-assessment-table .concise-category-tools > td {
        display: block;
        grid-column: 1 / -1;
    }

    .concise-rating {
        grid-template-columns: 1.5rem minmax(0, 1fr) 1.75rem;
        gap: 0.35rem;
    }

    .concise-rating:has(.profile-qualifier-label:empty) {
        grid-template-columns: minmax(0, 1fr) 1.75rem;
    }

    .concise-rating .profile-qualifier-label:empty {
        display: none;
    }

    .concise-rating-control,
    .concise-rating[data-qualifier="environmental"] .concise-rating-control,
    .concise-rating:is([data-qualifier="nature"], [data-qualifier="location"]) .concise-rating-control {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.4rem;
    }

    .concise-rating-options {
        display: flex;
        overflow-x: auto;
        padding: 2px;
    }

    .concise-rating-options > label {
        min-width: 0;
        flex: 1 0 1.5rem;
    }

    .concise-special-options {
        padding-left: 0.3rem;
    }

    .concise-special-options > label {
        width: 1.75rem;
        flex: 0 0 1.75rem;
    }

    .concise-rating .profile-target-segment {
        height: 2.25rem;
        font-size: 0.75rem;
    }

    .concise-rating-clear {
        width: 1.75rem;
        min-height: 2.25rem;
        height: 2.25rem;
    }

    .concise-rating .concise-rating-clear {
        grid-column: auto;
        grid-row: auto;
    }

    .concise-additional-qualifiers {
        width: 100%;
    }

    .concise-additional-qualifiers .concise-rating {
        grid-template-columns: minmax(0, 1fr) 1.75rem;
    }

    .concise-additional-qualifiers .profile-qualifier-label {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: left;
    }

    .concise-additional-qualifiers .concise-rating-control {
        grid-column: 1;
        grid-row: 2;
    }

    .concise-additional-qualifiers .concise-rating-clear {
        grid-column: 2;
        grid-row: 2;
    }
}

/* Keep the concise table in the same clinical palette as the guided form. */
.concise-form-page {
    --concise-table-surface: #fff;
    --concise-table-subtle: #f7faf8;
    --concise-table-heading: #f0f6f2;
    --concise-table-grid: #9eb9ae;
    --concise-table-divider: #cfddd6;
    --concise-table-ink: #173d38;
    --concise-table-muted: #526a64;
}

.concise-form-page :is(.concise-component[data-component-code="b"], .concise-category[data-component="b"]) {
    --component-accent: #316f8e;
    --component-soft: #edf5f8;
}

.concise-form-page :is(.concise-component[data-component-code="s"], .concise-category[data-component="s"]) {
    --component-accent: #765f91;
    --component-soft: #f3f0f7;
}

.concise-form-page :is(.concise-component[data-component-code="d"], .concise-category[data-component="d"]) {
    --component-accent: #176b5b;
    --component-soft: #e8f2ed;
}

.concise-form-page :is(.concise-component[data-component-code="e"], .concise-category[data-component="e"]) {
    --component-accent: #91672c;
    --component-soft: #faf3e8;
}

.concise-form-page .concise-components > .form-component:last-child {
    border-bottom-color: var(--concise-table-divider);
}

.concise-form-page .concise-assessment-table {
    background: var(--concise-table-surface);
    color: var(--concise-table-ink);
}

.concise-form-page .concise-assessment-table th,
.concise-form-page .concise-assessment-table td {
    border-color: var(--concise-table-grid);
}

.concise-form-page .concise-assessment-table > thead {
    background: var(--concise-table-heading);
    color: var(--concise-table-muted);
}

.concise-form-page .concise-assessment-table .profile-section-header > th,
.concise-form-page .concise-assessment-table .profile-section-header > td {
    background: var(--component-soft);
    color: var(--component-accent);
}

.concise-form-page .concise-assessment-table .profile-scale-title,
.concise-form-page .concise-assessment-table .profile-scale-labels > span,
.concise-form-page .concise-assessment-table .profile-scale-labels > span:last-child {
    border-color: var(--concise-table-grid);
}

.concise-form-page .concise-assessment-table .profile-code {
    color: var(--component-accent);
    font-weight: 700;
}

.concise-form-page .concise-component-count,
.concise-form-page .concise-reference-panel,
.concise-form-page .concise-personal-code,
.concise-form-page .concise-category-chevron,
.concise-form-page .concise-rating-clear {
    color: var(--concise-table-muted);
}

.concise-form-page .concise-category.is-answered .profile-code {
    box-shadow: inset 3px 0 var(--component-accent);
}

.concise-form-page .concise-category-toggle:hover {
    color: var(--component-accent);
}

.concise-form-page .concise-category-toggle:focus-visible {
    border-radius: 0.2rem;
    outline: 2px solid var(--component-accent);
    outline-offset: 2px;
}

.concise-form-page .concise-special-options {
    border-left-color: var(--concise-table-divider);
}

.concise-form-page .concise-rating .profile-target-segment {
    border-color: var(--concise-table-grid);
    background: var(--concise-table-surface);
}

.concise-form-page .profile-target-scale label:hover .profile-target-segment {
    border-color: var(--form-primary);
}

.concise-form-page .profile-target-scale input:focus-visible + span {
    outline-color: var(--form-primary);
}

.concise-form-page .concise-rating-clear:hover:not(:disabled) {
    background: var(--form-primary-soft);
    color: var(--form-primary-hover);
}

.concise-form-page .concise-category-detail-content,
.concise-form-page .concise-personal-entry {
    background: var(--concise-table-surface);
}

.concise-form-page .concise-additional-qualifiers,
.concise-form-page .concise-personal-table-head,
.concise-form-page .concise-personal-entry,
.concise-form-page .concise-personal-entry:last-child,
.concise-form-page .concise-personal-code {
    border-color: var(--concise-table-divider);
}

.concise-form-page .concise-personal-table-head,
.concise-form-page .concise-personal-composer {
    background: var(--concise-table-subtle);
}

.concise-form-page .concise-personal-table-head,
.concise-form-page .concise-personal-composer .concise-personal-code {
    color: var(--concise-table-muted);
}

@media (max-width: 639px) {
    .concise-form-page .concise-assessment-table .concise-category {
        border-bottom-color: var(--concise-table-divider);
    }

    .concise-form-page .concise-assessment-table .concise-category .profile-code,
    .concise-form-page .concise-assessment-table .concise-category .profile-category {
        background: var(--concise-table-subtle);
    }
}

@media (prefers-reduced-motion: reduce) {
    .form-sidebar,
    .form-main,
    .assessment-category {
        scroll-behavior: auto;
    }
}

.sheet-page {
    --form-primary: #176b5b;
    --form-primary-content: #fff;
    --form-primary-soft: #e8f2ed;
    --form-primary-hover: #105247;
}

.sheet-page .result-page-heading h1 {
    color: #173d38;
}

.sheet-page .result-page-heading p {
    color: #526a64;
}

.assessment-sheet {
    display: grid;
    gap: 0.9rem;
    border: 1px solid #cfddd6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 1rem;
    color: #173d38;
}

.sheet-section {
    min-width: 0;
    border: 1px solid #cfddd6;
}

.sheet-section > h2,
.sheet-perspective-grid h3 {
    margin: 0;
    background: var(--form-primary-soft);
    padding: 0.55rem 0.7rem;
    color: #173d38;
    font-size: 0.9rem;
    font-weight: 700;
}

.sheet-patient,
.sheet-professional {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
}

.sheet-patient > h2,
.sheet-professional > h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #cfddd6;
    padding: 0.55rem 0.25rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

.sheet-patient > .sheet-perspective-grid,
.sheet-professional > .sheet-perspective-grid {
    grid-column: 2;
}

.sheet-perspective-grid,
.sheet-context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sheet-perspective-grid > section + section {
    border-left: 1px solid #cfddd6;
}

.sheet-perspective-grid h3 {
    border-top: 1px solid #cfddd6;
    font-size: 0.8rem;
}

.sheet-context-grid {
    margin-left: 2.25rem;
}

.sheet-entry-list {
    display: grid;
    gap: 0.45rem;
    padding: 0.7rem;
}

.sheet-entry-list p {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 0.8rem;
    line-height: 1.45;
}

.sheet-entry-list .sheet-empty {
    color: #6c847b;
    font-style: italic;
}

@media (max-width: 639px) {
    .sheet-perspective-grid,
    .sheet-context-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sheet-perspective-grid > section + section {
        border-top: 1px solid #cfddd6;
        border-left: 0;
    }
}

.intervention-plan-toolbar,
.intervention-plan-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.intervention-plan-toolbar {
    margin: 1rem 0 0.65rem;
}

.intervention-plan-actions {
    margin-top: 0.9rem;
}

.intervention-plan-toolbar > span,
.intervention-plan-actions > span {
    color: #627681;
    font-size: 0.75rem;
}

.intervention-plan-toolbar > span.is-dirty,
.intervention-plan-actions > span.is-dirty {
    color: #8a5a20;
}

.intervention-plan-toolbar h2 {
    margin: 0;
    color: #213944;
    font-size: 1rem;
}

.intervention-plan-empty {
    border: 1px dashed #b8c8d0;
    border-radius: 0.45rem;
    background: #fff;
    padding: 1rem;
    color: #627681;
    text-align: center;
}

.intervention-plan-empty[hidden] {
    display: none;
}

#intervention-plan-form {
    min-width: 0;
}

.intervention-target-catalog {
    margin-bottom: 0.75rem;
    border: 1px solid #bccbd3;
    border-radius: 0.4rem;
    background: #fff;
    padding: 0.7rem;
}

.intervention-target-picker-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.intervention-target-picker-heading h2 {
    margin: 0;
    font-size: 0.95rem;
}

.intervention-target-picker-heading label,
.intervention-target-picker-heading .input {
    width: min(22rem, 100%);
}

.intervention-target-picker-help {
    margin: 0.25rem 0 0.5rem;
    color: #627681;
    font-size: 0.72rem;
}

.intervention-target-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-y: auto;
    max-height: 17rem;
    column-gap: 1.25rem;
}

.intervention-target-group > h3 {
    margin: 0;
    border-bottom: 1px solid #c8d4db;
    padding: 0.3rem 0.2rem;
    color: #496672;
    font-size: 0.72rem;
}

.intervention-target-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    border-bottom: 1px solid #e2e9ed;
    padding: 0.45rem 0.2rem;
}

.intervention-target-category[hidden],
.intervention-target-group[hidden] {
    display: none;
}

.intervention-target-category-title {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 0.4rem;
    color: #213944;
    font-size: 0.76rem;
}

.intervention-target-category-title strong,
.intervention-target-code {
    color: #9a4c3d;
}

.intervention-target-ratings {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.3rem;
}

.intervention-target-rating {
    border: 1px solid #b8c8d0;
    border-radius: 0.25rem;
    background: #fff;
    padding: 0.2rem 0.4rem;
    color: #315664;
    font-size: 0.7rem;
    white-space: nowrap;
}

.intervention-target-rating:hover:not(:disabled) {
    border-color: #7396a5;
    background: var(--form-primary-soft);
}

.intervention-target-rating:disabled {
    cursor: default;
    opacity: 0.55;
}

.intervention-target-rating.is-added {
    border-color: transparent;
    color: #527066;
    opacity: 1;
}

.intervention-target-not-rated,
.intervention-target-picker-empty {
    color: #7a8b94;
    font-size: 0.7rem;
}

.intervention-table-scroll {
    overflow-x: auto;
    border: 1px solid #b8c8d0;
    background: #fff;
}

.intervention-table {
    width: 100%;
    border-collapse: collapse;
    color: #213944;
    font-size: 0.76rem;
}

.intervention-table caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.intervention-table th,
.intervention-table td {
    border: 1px solid #c8d4db;
    padding: 0.35rem 0.45rem;
    vertical-align: top;
    text-align: left;
}

.intervention-table thead th {
    background: #dce8ed;
    color: #213944;
    text-align: center;
}

.intervention-table-component th {
    background: var(--form-primary-soft);
    font-size: 0.8rem;
}

.intervention-table:not(.intervention-edit-table) tbody th[scope="row"] {
    font-weight: 400;
}

.intervention-table:not(.intervention-edit-table) tbody th[scope="row"] > span {
    display: inline;
    color: #9a4c3d;
}

.intervention-role-cell,
.intervention-value-cell {
    text-align: center !important;
    vertical-align: middle !important;
}

.intervention-table-value {
    display: block;
    white-space: nowrap;
}

.intervention-table-value + .intervention-table-value {
    margin-top: 0.25rem;
}

.intervention-role-cell > span[aria-hidden="true"] {
    font-size: 1rem;
    font-weight: 700;
}

.intervention-table-empty,
.intervention-table-no-targets {
    color: #627681;
    font-style: italic;
}

.intervention-table-no-targets {
    border: 1px dashed #b8c8d0;
    border-radius: 0.5rem;
    background: #fff;
    padding: 2rem;
    text-align: center;
}

.intervention-table-no-targets h2 {
    color: #213944;
    font-size: 1rem;
}

.intervention-edit-table {
    min-width: 72rem;
}

.intervention-edit-table thead th {
    padding: 0.4rem 0.3rem;
    font-size: 0.72rem;
    vertical-align: middle;
}

.intervention-edit-table [data-professional-group] {
    padding: 0.25rem 0.4rem;
}

.intervention-edit-table [data-professional-group] .btn {
    margin-left: 0.45rem;
    font-weight: 400;
}

.intervention-edit-table [data-professional-column] {
    width: 3.4rem;
    min-width: 3.4rem;
}

.intervention-plan-component th {
    background: #e7eff2;
    color: #496672;
    font-size: 0.74rem;
    font-weight: 600;
    text-align: left;
}

.intervention-unrated-note {
    color: #7a8b94;
    font-size: 0.72rem;
    font-style: italic;
    vertical-align: middle !important;
}

.intervention-target-cell {
    width: 14rem;
    min-width: 14rem;
    background: #fff;
    padding: 0.3rem !important;
}

.intervention-target-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.25rem;
    font-weight: 400;
}

.intervention-target-heading .btn {
    flex-shrink: 0;
    min-height: 1.35rem;
    opacity: 0.35;
}

.intervention-target:hover .intervention-target-heading .btn,
.intervention-target-heading .btn:focus-visible {
    opacity: 1;
}

.intervention-description-cell {
    min-width: 18rem;
    padding: 0 !important;
}

.intervention-description-editor {
    display: flex;
    min-height: 1.85rem;
    align-items: center;
    gap: 0.15rem;
    padding: 0.1rem 0.2rem;
}

.intervention-description-editor > label {
    min-width: 0;
    flex: 1;
}

.intervention-description {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 0.2rem;
    outline: 0;
    background: transparent;
    padding: 0.2rem 0.25rem;
    color: #213944;
    font: inherit;
}

.intervention-description:focus {
    border-color: #7396a5;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(75, 111, 127, 0.12);
}

.intervention-row-drag {
    cursor: grab;
    padding: 0.25rem 0.1rem;
    color: #728690;
    opacity: 0;
    user-select: none;
}

.intervention-row-actions {
    display: flex;
    flex-shrink: 0;
    opacity: 0;
}

.intervention-row-actions .btn {
    min-height: 1.4rem;
    padding-inline: 0.25rem;
}

.intervention-edit-table tr:hover .intervention-row-drag,
.intervention-edit-table tr:hover .intervention-row-actions,
.intervention-edit-table tr:focus-within .intervention-row-drag,
.intervention-edit-table tr:focus-within .intervention-row-actions {
    opacity: 1;
}

.intervention-edit-table tr.is-dragging {
    opacity: 0.5;
}

.intervention-edit-table .intervention-role-cell {
    width: 3.4rem;
    padding: 0.15rem !important;
}

.intervention-edit-table .intervention-role-cell .checkbox {
    margin: 0;
}

.intervention-add-cell {
    min-height: 1.75rem;
    padding: 0.05rem 0.2rem !important;
}

.intervention-inline-composer {
    min-width: 14rem;
    gap: 0.15rem;
}

.intervention-inline-composer > label {
    min-width: 0;
}

.intervention-inline-input {
    width: 100%;
    min-height: 1.6rem;
    border: 1px solid transparent;
    border-radius: 0.2rem;
    outline: 0;
    background: transparent;
    padding: 0.15rem 0.3rem;
    color: #213944;
    font: inherit;
}

.intervention-inline-input::placeholder {
    color: #627681;
    opacity: 1;
}

.intervention-inline-composer:focus-within .intervention-inline-input,
.intervention-inline-input:hover {
    border-color: #c8d4db;
    background: #fff;
}

.intervention-inline-input:focus {
    border-color: #7396a5;
    box-shadow: 0 0 0 2px rgba(75, 111, 127, 0.12);
}

.intervention-inline-composer .btn {
    min-height: 1.5rem;
    color: #315664;
    font-size: 1rem;
}

.intervention-role-placeholder {
    background: #fbfcfc;
}

.intervention-edit-table .intervention-value-cell {
    width: 5.5rem;
    padding: 0.25rem !important;
}

.intervention-rating {
    position: relative;
    display: block;
}

.intervention-rating + .intervention-rating,
.intervention-rating-value + .intervention-rating-value {
    margin-top: 0.2rem;
}

.intervention-rating-value {
    display: block;
    white-space: nowrap;
}

.intervention-rating .select {
    width: 4.8rem;
    max-width: 4.8rem;
    padding-right: 1.5rem;
    font-size: 0.68rem;
}

.intervention-undo[hidden] {
    display: none;
}

.intervention-undo td {
    padding: 0.2rem 0.5rem;
    background: #f7fafb;
    color: #627681;
    font-size: 0.72rem;
    text-align: right;
}

.intervention-undo .btn {
    margin-left: 0.4rem;
}

.intervention-add-box {
    width: min(40rem, calc(100vw - 2rem));
    max-width: none;
    overflow: visible;
    text-align: left;
}

.intervention-add-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.intervention-add-heading h3 {
    margin: 0;
    font-size: 1rem;
}

.intervention-add-context,
.intervention-add-help {
    color: #627681;
    font-size: 0.75rem;
}

.intervention-add-context {
    margin: 0.25rem 0 0.85rem;
}

.intervention-add-help {
    margin: 0.55rem 0 0;
}

.intervention-composer {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
}

.intervention-composer > label,
.intervention-composer .input {
    width: 100%;
    min-width: 0;
}

.intervention-suggestions {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    overflow-y: auto;
    max-height: 18rem;
    margin: 0;
    border: 1px solid #b8c8d0;
    border-radius: 0.4rem;
    background: #fff;
    padding: 0.25rem;
    box-shadow: 0 0.5rem 1.2rem rgba(28, 51, 62, 0.14);
    list-style: none;
}

.intervention-suggestions[hidden] {
    display: none;
}

.intervention-suggestions li {
    display: flex;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-radius: 0.25rem;
    padding: 0.5rem 0.6rem;
    color: #213944;
    font-size: 0.8rem;
}

.intervention-suggestions li:hover,
.intervention-suggestions li[aria-selected="true"] {
    background: var(--form-primary-soft);
}

.intervention-professional-box {
    width: min(28rem, calc(100vw - 2rem));
    text-align: left;
}

.intervention-professional-label {
    display: block;
    margin: 0.85rem 0 0.3rem;
    color: #496672;
    font-size: 0.78rem;
}

.intervention-professional-label + .input {
    width: 100%;
}

.intervention-professional-error {
    margin: 0.4rem 0 0;
    color: #a43b32;
    font-size: 0.75rem;
}

.intervention-professional-error[hidden] {
    display: none;
}

.intervention-professional-actions {
    margin-top: 0.85rem;
    text-align: right;
}

.intervention-page .intervention-plan-toolbar {
    border: 1px solid #cfddd6;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.97);
    padding: 0.65rem 0.75rem;
}

.intervention-page .intervention-plan-toolbar h2,
.intervention-page .intervention-plan-empty h2 {
    color: #173d38;
}

.intervention-page .intervention-plan-toolbar p {
    margin: 0.2rem 0 0;
    color: #526a64;
    font-size: 0.72rem;
}

.intervention-page .intervention-table-scroll {
    border-color: #cfddd6;
    border-radius: 0.5rem;
}

.intervention-page .intervention-table th,
.intervention-page .intervention-table td {
    border-color: #cfddd6;
}

.intervention-page .intervention-table thead th {
    background: #f0f6f2;
    color: #36564d;
}

.intervention-page .intervention-table {
    color: #173d38;
}

.intervention-page .intervention-plan-component th,
.intervention-page .intervention-table-component th {
    background: #e8f2ed;
    color: #173d38;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.intervention-page .intervention-target-code,
.intervention-page .intervention-table:not(.intervention-edit-table) tbody th[scope="row"] > span {
    color: #176b5b;
    font-weight: 700;
}

.intervention-page .intervention-plan-action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.intervention-page .intervention-plan-empty {
    display: grid;
    justify-items: start;
    gap: 0.45rem;
    border-color: #cfddd6;
    text-align: left;
}

.intervention-page .intervention-plan-empty p {
    margin: 0;
}

@media (max-width: 700px) {
    .intervention-page .intervention-plan-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .intervention-page .intervention-plan-action-buttons {
        justify-content: flex-start;
    }
}

@media (hover: none) {
    .intervention-row-drag,
    .intervention-row-actions,
    .intervention-target-heading .btn {
        opacity: 1;
    }
}

@media (max-width: 700px) {
    .intervention-target-picker-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 0.5rem;
    }

    .intervention-target-picker-heading label,
    .intervention-target-picker-heading .input {
        width: 100%;
    }

    .intervention-target-options {
        grid-template-columns: minmax(0, 1fr);
        max-height: 19rem;
    }

    .intervention-plan-toolbar,
    .intervention-plan-actions {
        align-items: flex-start;
    }

    .intervention-suggestions li {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.15rem;
    }
}

@media print {
    .intervention-page-header .result-page-actions {
        display: none;
    }

    .intervention-table-scroll {
        overflow: visible;
        border: 0;
    }

    .intervention-table {
        font-size: 0.66rem;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .intervention-table tr {
        break-inside: avoid;
    }
}

@media print {
    main {
        max-width: none;
        padding: 0;
    }

    .sheet-page-header {
        margin-bottom: 0.75rem;
    }

    .sheet-page-header .result-page-actions {
        display: none;
    }

    .assessment-sheet {
        border: 0;
        border-radius: 0;
        padding: 0;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .sheet-patient,
    .sheet-context-grid,
    .sheet-entry-list p {
        break-inside: avoid;
    }

    .sheet-section h2,
    .sheet-section h3 {
        break-after: avoid;
    }
}

@media print {
    nav,
    footer,
    .btn,
    #form-category-search {
        display: none !important;
    }

    body {
        background: white;
    }

    .assessment-category,
    details {
        break-inside: avoid;
    }
}
