
.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

/* The nubo health logo ahead of the app's name, in the sidebar or, without one, the top bar. */
.brand-logo {
    height: 1.4rem;
    width: auto;
    margin-right: 0.6rem;
    vertical-align: -0.2rem;
}

.notice {
    max-width: 48rem;
}

/* A chart from ReportChart. A chart of bars across is given the height of its rows by charts.js. */
.report-chart {
    max-width: 60rem;
    margin-bottom: 1rem;
}

app-chart {
    display: block;
    position: relative;
    height: 16rem;
}

/* A button at work, from BusyButton or js/progress.js. The wave takes the size of the button's text. */
.btn[aria-busy="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .btn[aria-busy="true"]:disabled {
        cursor: progress;
        opacity: 0.92;
    }

    .btn[aria-busy="true"] .nubo-wave {
        flex: none;
        width: 1.4em;
        height: 1.4em;
    }

.loading-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary-color);
}

/* While the browser waits for the next page. js/progress.js adds is-visible. It never takes a click:
   somebody who gives up waiting can still go somewhere else. */
.page-progress {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--bs-body-bg) 55%, transparent);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s;
}

    .page-progress.is-visible {
        opacity: 1;
        visibility: visible;
    }

.page-progress-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15);
}

.session-bar {
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 0.5rem;
}

.patient-banner {
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 0.75rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* The patient's form, and its previews. It measures its own width rather than the window's, so the
   preview's phone is really a phone: every rule below that changes with width is a container query. */
.pa-form {
    container-type: inline-size;
    --pa-accent: var(--app-accent);
    --pa-accent-contrast: var(--app-accent-contrast);
    max-width: 60rem;
}

/* The accessible presets: each accent carries white text at 4.5:1 or better, light and dark. */
.pa-theme-ocean { --pa-accent: #0b5c8a; --pa-accent-contrast: #ffffff; }
.pa-theme-forest { --pa-accent: #1c6b3c; --pa-accent-contrast: #ffffff; }
.pa-theme-plum { --pa-accent: #6a2c70; --pa-accent-contrast: #ffffff; }
.pa-theme-readable { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; line-height: 1.6; }

.pa-form .btn-primary {
    --bs-btn-bg: var(--pa-accent);
    --bs-btn-border-color: var(--pa-accent);
    --bs-btn-color: var(--pa-accent-contrast);
    --bs-btn-hover-bg: var(--pa-accent);
    --bs-btn-hover-border-color: var(--pa-accent);
    --bs-btn-hover-color: var(--pa-accent-contrast);
    --bs-btn-active-bg: var(--pa-accent);
    --bs-btn-active-border-color: var(--pa-accent);
    --bs-btn-disabled-bg: var(--pa-accent);
    --bs-btn-disabled-border-color: var(--pa-accent);
}

.pa-logo { max-height: 3rem; max-width: 12rem; display: block; margin-bottom: 0.75rem; }
.pa-title { margin-bottom: 0.75rem; }
.pa-language { max-width: 14rem; margin-bottom: 0.75rem; }

.pa-progress progress { width: 100%; height: 0.75rem; accent-color: var(--pa-accent); display: block; }
.pa-progress-text { font-size: 0.9rem; color: var(--bs-secondary-color); margin: 0.25rem 0 0.75rem; }

.pa-question { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.pa-question-text { font-weight: 600; display: block; margin-bottom: 0.5rem; float: none; font-size: 1.05rem; }
.pa-required { color: var(--bs-danger-text-emphasis); margin-left: 0.15rem; }
.pa-help { font-size: 0.9rem; color: var(--bs-secondary-color); margin-bottom: 0.5rem; }
.pa-problem { color: var(--bs-danger-text-emphasis); font-weight: 600; margin: 0.35rem 0 0; }
.pa-has-problem .pa-option, .pa-has-problem .form-control { border-color: var(--bs-danger); }

.pa-options { display: grid; gap: 0.4rem; }

/* 44px targets: the whole row is the label. */
.pa-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.4rem;
    cursor: pointer;
}

.pa-option input { width: 1.25rem; height: 1.25rem; flex: none; margin: 0; accent-color: var(--pa-accent); }
.pa-option-selected { border-color: var(--pa-accent); box-shadow: inset 0 0 0 1px var(--pa-accent); }
.pa-option:focus-within { outline: 3px solid var(--pa-accent); outline-offset: 1px; }

.pa-button { min-height: 44px; min-width: 7rem; }
.pa-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.pa-number { display: flex; align-items: center; gap: 0.5rem; max-width: 16rem; }
.pa-number .form-control, .pa-date { min-height: 44px; }
.pa-date { max-width: 14rem; }
.pa-question input[type="text"], .pa-question textarea { min-height: 44px; }
.pa-slider .form-range { height: 44px; accent-color: var(--pa-accent); }
.pa-slider-value { display: block; font-weight: 600; }
.pa-info { margin-bottom: 1rem; }
.pa-copyright { font-size: 0.8rem; color: var(--bs-secondary-color); margin-top: 1rem; }
.pa-saved { font-size: 0.85rem; color: var(--bs-secondary-color); margin: 0; }
.pa-safety-patient { font-size: 0.9rem; border-top: 1px solid var(--bs-border-color); padding-top: 0.75rem; margin-top: 1rem; }
.pa-proxy { margin-bottom: 1rem; }
.pa-edit { min-height: 44px; }
.pa-score { font-size: 1.1rem; }

.pa-review { margin: 0 0 1rem; }
.pa-review-row { padding: 0.5rem 0; border-bottom: 1px solid var(--bs-border-color); }
.pa-review-row dt { font-weight: 600; }
.pa-review-row dd { margin: 0; }

/* A matrix: on a wide form, the scale across the top, one row a question, and each radio under its heading,
   because two grids with the same tracks line up. On a narrow form each option is labelled in place. A row's
   option labels are hidden only under a heading that says the same, and stay for a screen reader. */
.pa-matrix-head { display: none; }
.pa-option { position: relative; }
.pa-problem { grid-column: 1 / -1; }

@container (min-width: 44rem) {
    .pa-matrix-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 0.75rem; align-items: center; border-bottom: 1px solid var(--bs-border-color); padding: 0.4rem 0; margin-bottom: 0; }
    .pa-matrix-row .pa-question-text { margin-bottom: 0; }

    .pa-matrix-shared .pa-matrix-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 0.75rem; align-items: end; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
    .pa-matrix-shared .pa-options { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
    .pa-matrix-column { text-align: center; padding-inline: 0.25rem; }
    .pa-matrix-shared .pa-option { justify-content: center; border-color: transparent; padding: 0.25rem; }

    .pa-matrix-shared .pa-option-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* Kiosk mode: large targets for a clinic tablet. */
.pa-kiosk { font-size: 1.25rem; }
.pa-kiosk .pa-option { min-height: 64px; }
.pa-kiosk .pa-button { min-height: 64px; min-width: 10rem; font-size: 1.25rem; }

/* High contrast, from the preview's theme switcher. */
.pa-contrast { --pa-accent: #000000; --pa-accent-contrast: #ffffff; background: #ffffff; color: #000000; --bs-border-color: #000000; --bs-secondary-color: #000000; }

/* The preview's device frame. */
.pa-stage-frame { overflow-x: auto; }
.pa-stage { padding: 1rem; border: 1px solid var(--bs-border-color); border-radius: 0.5rem; background: var(--bs-body-bg); color: var(--bs-body-color); margin-inline: auto; }
.pa-device-phone { width: 375px; }
.pa-device-tablet { width: 768px; }
.pa-device-desktop { width: 100%; }

/* The patient's frame: the logo and the form. */
.pa-patient-frame { min-height: 100vh; }
.pa-patient-header { display: flex; align-items: center; padding: 0.5rem 1rem; border-bottom: 1px solid var(--bs-border-color); }
.pa-patient-theme { margin-left: auto; }
.pa-patient-main { max-width: 60rem; margin-inline: auto; padding: 1rem; }
.pa-verify { max-width: 32rem; }
.pa-verify .form-control { min-height: 44px; }

/* The designer. */
.pa-tree { font-size: 0.9rem; }
.pa-tree-section { border: 1px solid var(--bs-border-color); border-radius: 0.4rem; padding: 0.4rem; margin-bottom: 0.4rem; }
.pa-tree-item { display: flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.25rem; border-radius: 0.25rem; cursor: grab; }
.pa-tree-selected { background: var(--bs-secondary-bg); }
.pa-dragging { opacity: 0.5; }
.pa-low-confidence { outline: 2px solid var(--bs-warning); }
.pa-tree-button { padding: 0 0.35rem; line-height: 1.4; }
.pa-score-input { width: 5rem; }
.pa-item-picks { max-height: 8rem; overflow-y: auto; border: 1px solid var(--bs-border-color); border-radius: 0.25rem; padding: 0.25rem 0.5rem; }
.pa-source-frame { width: 100%; height: 70vh; border: 1px solid var(--bs-border-color); border-radius: 0.25rem; }
.pa-source-text { white-space: pre-wrap; max-height: 16rem; overflow-y: auto; }
.pa-json { font-size: 0.85rem; }
.pa-link { word-break: break-all; }

/* Alerts, and how tests went. The words say it too, for anybody who cannot see the colour. */
.pa-alert { border-left: 4px solid var(--bs-border-color); padding-left: 0.5rem; margin-bottom: 0.5rem; }
.pa-alert-critical { border-left: 4px solid var(--bs-danger); }
.pa-alert-warning { border-left: 4px solid var(--bs-warning); }
.pa-trace { margin-bottom: 0.5rem; }
.pa-test-pass { color: var(--bs-success-text-emphasis); }
.pa-test-fail { color: var(--bs-danger-text-emphasis); }
.pa-tests li { margin-bottom: 0.25rem; }

/* The patient frame's own copy of the failure banner: MainLayout's scoped styles do not reach it. Blazor
   shows it by setting display on the element when a circuit fails. */
.pa-patient-frame ~ #blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.6rem 1.25rem;
    color: var(--bs-body-color);
    background: var(--bs-warning-bg-subtle);
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.pa-getting-ready { margin-bottom: 0.5rem; }

/* The preview's light and dark are its own, whatever the page around it is in: form controls included. */
.pa-stage[data-bs-theme="light"] { color-scheme: light; }
.pa-stage[data-bs-theme="dark"] { color-scheme: dark; }

/* This app's name is long for the sidebar's brand, so it wraps rather than running under the page. */
.sidebar .navbar-brand { white-space: normal; line-height: 1.15; font-size: 1rem; }

/* From js/connection-notice.js: the connection to the server dropped, so what was done last may be lost. */
.app-connection-notice {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1090;
    padding: 0.6rem 1rem;
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
    border-bottom: 2px solid var(--bs-danger);
    font-weight: 600;
}
