: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;
}

.alert-close {
    width: 1.5rem;
    height: 1.5rem;
    min-height: 1.5rem;
    margin-left: auto;
    padding: 0;
    font-size: 1rem;
}

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

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

@media (prefers-reduced-motion: reduce) {
    .alert[data-auto-dismiss] {
        transition: 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;
    }
}

/* Builder tools prioritize category selection over importing and applied-set context. */
.builder-sidebar {
    overflow: hidden;
    border: 1px solid #c8d4db;
    border-radius: 0.6rem;
    background: #fff;
}

.builder-sidebar-primary,
.builder-sidebar-section {
    padding: 1rem;
}

.builder-sidebar-section {
    border-top: 1px solid #dce4e9;
}

.builder-sidebar h2 {
    color: #213944;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

.builder-sidebar p {
    margin-top: 0.35rem;
    color: #627681;
    font-size: 0.76rem;
    line-height: 1.45;
}

.builder-sidebar-primary > .btn,
.builder-sidebar-section > .btn {
    width: 100%;
    margin-top: 0.85rem;
    gap: 0.4rem;
}

.builder-sidebar .builder-sidebar-hint {
    margin-top: 0.5rem;
    color: #7a8b94;
    font-size: 0.68rem;
}

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

.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;
}

.builder-applied {
    background: #f7fafb;
}

.builder-applied-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.builder-applied-total {
    display: inline-grid;
    min-width: 1.4rem;
    height: 1.4rem;
    place-items: center;
    border-radius: 999px;
    background: var(--form-primary-soft);
    padding: 0 0.35rem;
    color: var(--form-primary);
    font-size: 0.68rem;
    font-weight: 700;
}

.builder-applied-list {
    display: grid;
    margin-top: 0.7rem;
    gap: 0.65rem;
}

.builder-applied-list > li {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    column-gap: 0.45rem;
}

.builder-applied-check {
    display: inline-flex;
    grid-row: 1 / span 2;
    align-items: center;
    justify-content: center;
    color: var(--core-set-color);
}

.builder-applied-check .builder-sidebar-icon {
    width: 0.9rem;
    height: 0.9rem;
}

.builder-applied-name {
    color: #334d59;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.builder-applied-count {
    margin-top: 0.1rem;
    color: #7a8b94;
    font-size: 0.68rem;
}

.builder-sidebar :is(a, 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;
}

.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 {
    overflow-x: auto;
    background: #fff;
}

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

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

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

.functioning-profile th,
.functioning-profile td {
    border: 1px solid #4b4b4b;
    padding: 0.35rem 0.45rem;
    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.5rem;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-left: 1.5rem;
    border-bottom: 1px solid #4b4b4b;
    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 #4b4b4b;
    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 #4b4b4b;
}

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

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

.profile-special {
    display: block;
    margin-top: 0.15rem;
    color: #525252;
    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.5rem;
    border-left: 1px solid #4b4b4b;
    background: #fff;
}

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

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

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

@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;
    }
}

/* 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-output-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
    padding-top: 2rem;
}

.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-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;
    text-transform: uppercase;
}

.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-status {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
}

.form-toolbar-status strong {
    color: #243d49;
    font-size: 0.85rem;
}

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

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

.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;
}

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

.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.35rem 0 0;
    padding: 0;
    list-style: none;
}

.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 {
    cursor: grab;
    padding: 0.25rem;
    color: #728690;
    font-size: 1.1rem;
    line-height: 1;
    user-select: none;
}

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

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

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

.narrative-entry-editor .input {
    border-color: #c4d1d8;
    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;
}

.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;
    text-transform: uppercase;
}

.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 {
    flex-shrink: 0;
    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;
}

.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-label {
    color: #314d5a;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
}

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

.qualifier-options {
    display: grid;
    grid-template-columns: repeat(var(--option-count), minmax(0, 1fr));
    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-output-actions {
        justify-content: flex-start;
        margin-top: 0.85rem;
        padding-top: 0;
    }

    .form-workspace {
        display: block;
    }

    .form-sidebar {
        position: static;
        max-height: none;
        margin-bottom: 0.85rem;
        overflow: visible;
    }

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

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

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

    .form-sidebar .component-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.25rem;
        padding: 0.65rem;
    }

    .form-sidebar .component-nav > h2 {
        grid-column: 1 / -1;
        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: none;
    }
}

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

    .form-output-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-output-actions .btn:last-child {
        grid-column: 1 / -1;
    }

    .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-status {
        width: 100%;
        justify-content: space-between;
        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 {
        grid-template-columns: minmax(0, 1fr) 1.5rem;
        gap: 0.35rem;
    }

    .qualifier-label {
        grid-column: 1;
        grid-row: 1;
    }

    .qualifier-clear {
        grid-column: 2;
        grid-row: 1;
    }

    .qualifier-options-scroll {
        grid-column: 1 / -1;
        grid-row: 2;
        overflow-x: auto;
        padding: 2px;
    }

    .qualifier-options {
        min-width: calc(var(--option-count) * 2.25rem);
    }

    .qualifier-option {
        min-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;
    }
}

@media (prefers-reduced-motion: reduce) {
    .form-sidebar,
    .form-main,
    .assessment-category {
        scroll-behavior: auto;
    }
}

.assessment-sheet {
    display: grid;
    gap: 0.9rem;
    border: 1px solid #c8d4db;
    border-radius: 0.5rem;
    background: #fff;
    padding: 1rem;
    color: #213944;
}

.sheet-section {
    min-width: 0;
    border: 1px solid #c8d4db;
}

.sheet-section > h2,
.sheet-professional-grid h3 {
    margin: 0;
    background: var(--form-primary-soft);
    padding: 0.55rem 0.7rem;
    color: #213944;
    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 #c8d4db;
    padding: 0.55rem 0.25rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

.sheet-patient > .sheet-entry-list,
.sheet-professional > .sheet-professional-grid {
    grid-column: 2;
}

.sheet-patient > .sheet-entry-list {
    display: block;
    column-count: 2;
    column-fill: auto;
    column-gap: 0.9rem;
    height: 10rem;
}

.sheet-patient .sheet-entry-list p {
    margin-bottom: 0.45rem;
    break-inside: avoid;
}

.sheet-patient .sheet-entry-list p:last-child {
    margin-bottom: 0;
}

.sheet-professional-grid,
.sheet-context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sheet-professional-grid > section + section {
    border-left: 1px solid #c8d4db;
}

.sheet-professional-grid h3 {
    border-top: 1px solid #c8d4db;
    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: #7a8b94;
    font-style: italic;
}

@media (max-width: 639px) {
    .sheet-professional-grid,
    .sheet-context-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sheet-professional-grid > section + section {
        border-top: 1px solid #c8d4db;
        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.5rem;
    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 tbody th[scope="row"] span {
    display: block;
    color: #9a4c3d;
}

.intervention-table tbody th small {
    display: block;
    margin-top: 0.25rem;
    color: #627681;
    font-weight: 400;
}

.intervention-role-cell,
.intervention-value-cell {
    text-align: center !important;
    vertical-align: middle !important;
}

.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.45rem !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-target-cell small {
    margin-top: 0.15rem !important;
}

.intervention-description-cell {
    min-width: 18rem;
    padding: 0 !important;
}

.intervention-description-editor {
    display: flex;
    min-height: 2.15rem;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem 0.25rem;
}

.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.3rem 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.25rem !important;
}

.intervention-edit-table .intervention-role-cell .checkbox {
    margin: 0;
}

.intervention-add-cell {
    min-height: 2rem;
    padding: 0.1rem 0.25rem !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.8rem;
    border: 1px solid transparent;
    border-radius: 0.2rem;
    outline: 0;
    background: transparent;
    padding: 0.25rem 0.35rem;
    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.35rem !important;
}

.intervention-rating {
    position: relative;
}

.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-suggestions small {
    flex-shrink: 0;
    color: #728690;
}

.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;
}

@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;
    }
}
