.header-logo { object-fit: contain; }
.header-title, .section-title { color: var(--cdc-blue); }
.sidebar { width: 100%; }
.nav-link[aria-current="page"] { background: var(--cdc-accent-bg); color: var(--cdc-blue); border-radius: .4rem; }
.field-caption { display: none; }
.record-table td > label { display: block; }
#saveStatus:empty { display: none; }
#saveStatus { margin: .5rem 0; color: var(--bs-danger-text-emphasis); }
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll:focus-visible { outline: 2px solid var(--cdc-blue); }
.mobile-section { font-weight: 600; color: var(--cdc-blue); }
.worksheet-shell { margin-top: 1.5rem; }
.worksheet-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.worksheet-heading .header { order: -1; margin-bottom: 0; }
.app-toolbar .container-fluid { gap: .25rem; padding-inline: 0; flex-wrap: nowrap; }
.toolbar-icon {
    display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0;
    --bs-btn-color: var(--cdc-blue); --bs-btn-hover-color: var(--cdc-blue); --bs-btn-active-color: var(--cdc-blue);
    --bs-btn-hover-bg: var(--cdc-accent-bg); --bs-btn-active-bg: var(--cdc-accent-bg);
}
.more-dots { width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 -7px currentColor, 0 7px currentColor; }
.theme-icon { display: grid; place-items: center; width: 22px; height: 22px; }
.theme-icon::before { content: ""; grid-area: 1 / 1; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 6px -4px currentColor; }
[data-bs-theme="dark"] .theme-icon::before { width: 11px; height: 11px; border: 2px solid currentColor; box-shadow: none; }
[data-bs-theme="dark"] .theme-icon::after {
    content: ""; grid-area: 1 / 1; width: 22px; height: 22px; border-radius: 50%;
    background: repeating-conic-gradient(from -5deg, currentColor 0deg 10deg, transparent 10deg 45deg);
    -webkit-mask-image: radial-gradient(circle, transparent 7px, black 7.5px);
    mask-image: radial-gradient(circle, transparent 7px, black 7.5px);
}
@media (forced-colors: active) {
    .theme-icon, .more-dots { forced-color-adjust: none; color: ButtonText; }
}
#moreMenu { min-width: 11rem; }
#moreMenu .dropdown-item { display: flex; align-items: center; min-height: 44px; }
#clearAssessment:enabled { color: var(--bs-danger-text-emphasis); }
#clearAssessment:enabled:active { color: white; background: var(--bs-danger); }
.btn-outline-danger { --bs-btn-color: var(--bs-danger-text-emphasis); --bs-btn-border-color: var(--bs-form-invalid-border-color); }
@media screen and (max-width: 991.98px) {
    .worksheet-shell { margin-top: 0; }
    .worksheet-heading { display: contents; }
    .worksheet-heading .header { margin-bottom: 1.25rem; }
    .app-toolbar {
        position: sticky; top: 0; z-index: 1010; margin: 0 calc(-.5 * var(--bs-gutter-x)) 1.5rem;
        background: var(--bs-tertiary-bg); border-bottom: 1px solid var(--bs-border-color);
    }
    .app-toolbar .container-fluid { justify-content: flex-start; padding-inline: .5rem; }
    .app-toolbar .navbar-toggler { flex: none; width: 44px; height: 44px; padding: 0; }
    .app-toolbar .save-button { min-height: 44px; margin-top: 0; white-space: nowrap; }
    .mobile-section {
        min-width: 0; line-height: 1.15; font-size: .95rem; overflow: hidden; overflow-wrap: anywhere;
        display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    }
    .section-title { scroll-margin-top: 4.5rem; }
    .offcanvas { max-width: 90vw; }
    .offcanvas .nav-link { padding: .7rem 1rem; }
}
@media screen and (max-width: 767.98px) {
    .record-table, .record-table tbody { display: block; width: 100%; }
    .record-table thead { display: none; }
    .record-table tr { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; border: 1px solid var(--cdc-divider); padding: .8rem; border-radius: .5rem; margin-bottom: .75rem; }
    .record-table td { min-width: 0; border: 0; padding: 0; }
    .record-table td:last-child { grid-column: 1/-1; text-align: right; }
    .field-caption { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .2rem; }
    .record-table label { min-height: 44px; }
    .record-table input, .record-table select { max-width: 100%; min-width: 0; }
    #contentSection :is(.form-control,.form-select) { font-size: 1rem; }
    #contentSection .card-body .row > .col { flex: 1 1 9rem; }
    #psych .row > :is(.col-4,.col-6,.col-2) { width: 100%; margin-bottom: .4rem; }
    #contentSection .container { padding-inline: 0; }
    #contentSection button { min-height: 44px; }
    .header-title { font-size: 1.45rem; }
    .header-logo { width: 3rem; height: 3rem; }
}

@media screen and (max-width: 575.98px) {
    #poc .input-group { display: block; height: auto !important; }
    #poc .input-group-text, #poc textarea { width: 100% !important; }
    #poc textarea { min-height: 6rem; }
}

@media screen and (max-width: 359.98px) {
    .app-toolbar .container-fluid { flex-wrap: wrap; row-gap: .2rem; }
    .app-toolbar .mobile-section { order: 1; flex: 0 0 100%; font-size: .875rem; }
    .section-title { scroll-margin-top: 6rem; }
}

#entryStatus:empty { display: none; }

@media print {
    body:has(#contentSection [aria-invalid="true"]) #app-container { display: none; }
    body:has(#contentSection [aria-invalid="true"])::before {
        content: "Review the highlighted entry before printing this assessment.";
        visibility: visible;
    }
}


.vital-trend-panel { margin: 1.5rem 0; padding-top: 1rem; border-top: 1px solid var(--cdc-divider); }
.vital-trend-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .55rem; }
.vital-trend-heading h2 { color: var(--cdc-blue); font-weight: 600; }
.vital-view { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.vital-view select { width: auto; max-width: 100%; font-weight: normal; }
.vital-trend-plot { position: relative; width: 100%; height: clamp(17rem, 32vw, 22rem); margin-top: .65rem; }
.vital-unit { margin-top: .25rem; }
#vitalSignsTable [name="glucoseUnit"] { min-width: 5.8rem; padding-right: 1.45rem; background-position: right .35rem center; }
.adl-clock { min-width: 7rem; }
.saved-timing { display: grid; gap: .2rem; margin: .25rem 0; font-size: .85rem; color: var(--bs-secondary-color); }
.coa-reference { container: coa / inline-size; overflow-x: auto; }
.coa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    font-size: clamp(1rem, .875rem + .3cqi, 1.125rem);
    line-height: 1.45;
}
.coa-table :is(th, td) {
    padding: .65rem .55rem;
    border: 1px solid var(--cdc-divider);
    vertical-align: top;
    text-align: start;
}
.coa-table thead th { color: var(--cdc-blue); background: var(--cdc-accent-bg); }
.coa-table tbody th { color: var(--cdc-blue); background: var(--cdc-reference-bg); }
.coa-table ul { margin: 0; padding-inline-start: 1.05em; }
.coa-table li + li { margin-top: .3em; }
.coa-category { display: none; }
@media screen {
    @container coa (max-width: 49rem) {
        .coa-table { display: block; }
        /* Keep column headers available to assistive technology in the stacked layout. */
        .coa-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
        .coa-table tbody { display: grid; gap: 1rem; }
        .coa-table tbody tr {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
            border: 1px solid var(--cdc-divider);
            border-radius: .5rem;
            overflow: hidden;
        }
        .coa-table tbody :is(th, td) { display: block; min-width: 0; border: 0; padding: .55rem .85rem; overflow-wrap: anywhere; }
        .coa-table tbody th { grid-column: 1 / -1; background: var(--cdc-accent-bg); font-size: 1.08em; }
        .coa-category { display: block; margin-bottom: .15em; font-weight: 600; color: var(--bs-secondary-color); }
        .coa-category:only-child::after { content: "—"; display: block; font-weight: 400; }
    }
}
@media print {
    .coa-table { font-size: 10pt; }
    .coa-table tr { break-inside: avoid; }
    .coa-table thead { display: table-header-group; }
}
@media screen and (min-width: 768px) {
    #vitalSignsTable :is(th, td) { padding: .4rem .22rem; }
    #vitalSignsTable .form-control { min-width: 2.8rem; padding-inline: .35rem; }
    #vitalSignsTable [name="bloodPressure"] { min-width: 4.3rem; }
    #vitalSignsTable .vital-unit { min-width: 5rem; }
    .record-table input[type="time"] { min-width: 7.4rem; }
    .record-table input[type="date"] { min-width: 8.8rem; }
}
@media screen and (max-width: 767.98px) {
    .vital-view select { min-height: 44px; min-width: 0; }
}
