/* Functional additions only. Visual design is defined by the supplied styles.css. */
:root { color-scheme: light; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 2000; background: white; padding: 12px; }
.skip-link:focus { top: 8px; }
/* U11_TOAST_STYLES: transient application feedback is top-center and severity-coded. */
#toast:not(:empty) {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    z-index: 4000;
    width: max-content;
    max-width: min(620px, calc(100vw - 32px));
    text-align: left;
    overflow-wrap: anywhere;
    padding: 14px 18px;
    background: #17324d;
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 12px;
    box-shadow: var(--portal-shadow);
    font-weight: 600;
    line-height: 1.4;
}
#toast[data-type="success"] { background: #146c43; border-color: #0f5132; }
#toast[data-type="error"] { background: #b02a37; border-color: #842029; }
#toast[data-type="warning"] { background: #997404; border-color: #664d03; }
#toast[data-type="info"] { background: #0c5460; border-color: #055160; }
#error:empty { display: none; }
#content:focus { outline: none; }
.loading { padding: 2rem; }
.muted { color: var(--portal-muted); }
.small { font-size: .875em; }
.required { color: #c43838; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.row-flex, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.btn-small { font-size: .875rem; padding: .375rem .75rem; }
.page-heading { margin-bottom: 1.25rem; }
.page-heading h1 { font-size: 1.5rem; font-weight: 700; }
.page-heading p { margin-bottom: 0; }
.field .hint { display: block; font-size: .8rem; color: var(--portal-muted); margin-top: .35rem; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.form-grid, .context-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.context-grid { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.context-grid strong, .context-grid span { display: block; }
.context-grid span { font-size: .8rem; margin-bottom: .25rem; }
.check-list { display: flex; flex-wrap: wrap; gap: .7rem 1rem; }
.check-list label, .check-label { display: flex; align-items: flex-start; gap: .5rem; }
.check-list input, .check-label input { margin-top: .3rem; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
fieldset legend { font-size: 1rem; font-weight: 600; }
.portal-content input[type=checkbox], .portal-content .form-check-input { min-height: 1em; border-radius: .25em; }
.portal-user > div:last-child { min-width: 0; }
.portal-user .fw-bold, .portal-user small { overflow-wrap: anywhere; }
.portal-user small { font-size: .8rem; color: rgba(255,255,255,.8); }
.portal-user .avatar { flex-shrink: 0; }
.scope-pill select { background: transparent; border: 0; color: inherit; max-width: 220px; font-weight: 600; cursor: pointer; }
.scope-pill select:focus-visible { outline: 2px solid var(--portal-accent); }
.scope-pill select option { color: #213547; background: white; }
.portal-nav .nav-link.disabled { opacity: .48; cursor: not-allowed; }
.portal-topbar .top-pill { white-space: nowrap; }
.portal-nav .nav-link { font-size: 1rem; }
.status-needs_more_information, .status-email_verified { background: #fff8e5; color: var(--portal-warning); }
.status-expired, .status-disabled, .status-inactive { background: #fff1f1; color: var(--portal-danger); }
.status-none { background: #eef2f6; color: #596d82; }
.impersonation-banner { padding: .85rem 1.5rem; background: #fff3cd; border-bottom: 1px solid #ffecb5; display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.signature-preview { overflow-wrap: anywhere; }
.agreement-body { max-height: 380px; overflow: auto; padding: 1.25rem; border: 1px solid #d8e5f2; border-radius: 16px; background: #fafcff; }
.agreement-body h1, .agreement-body h2 { font-size: 1.25rem; }
.total-bar { padding: 1rem 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.qty { width: 82px; min-width: 82px; }
.cell-treatment { width: 85px; }
.cell-wound { min-width: 130px; }
.steps { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.step { border: 1px solid var(--portal-border); background: white; padding: .8rem; border-radius: 12px; }
.step b { margin-right: .5rem; }
.step.active { background: #edf5ff; }
.audit-code { font-family: monospace; font-size: .8rem; }
.ad-card { background: #edf5ff; padding: 1rem; border: 1px solid var(--portal-border); border-radius: 16px; height: 100%; }
.ad-card img { max-width: 100%; height: auto; }
.admin-editor { margin-bottom: 1.5rem; }
.portal-panel h2 { font-size: 1.1rem; }
.form-section-card:has(>h2) { padding: 1.25rem; margin-bottom: 1rem; }
.form-section-card>h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.form-control[readonly] { background-color: #f8fafc; }
.search-input { max-width: 320px; }
.inline-note { color: var(--portal-muted); font-size: .8rem; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.auth-form-wrap .btn { display: inline-flex; align-items: center; justify-content: center; }
.auth-form-wrap form { margin: 0; }
.admin-only-note { font-size: .8rem; }
@media(max-width: 767.98px) {
    .auth-brand, .auth-form-wrap { padding: 2rem; }
    .two-columns, .form-grid { grid-template-columns: 1fr; }
    .scope-pill select { max-width: 190px; }
}

/* Static prototype dimensions expressed as classes for the CSP. */
.source-inline-1 {width: 220px;}
.source-inline-2 {width: 260px;}
.source-inline-3 {width: 260px;}
.source-inline-4 {width: 190px;}
.source-inline-5 {width: 220px;}
.source-inline-6 {width: 260px;}
.source-inline-7 {width: 220px;}
.source-inline-8 {width: 260px;}
.source-inline-9 {width: 260px;}
.source-inline-10 {width: 280px;}
.source-inline-11 {width: 180px;}

/* Registration and sales configuration 0.3.0: preserve the existing Nimble palette. */
.registration-wizard .auth-form-wrap { min-width: 0; }
/* 0.3.0 U1: one continuous track, accessible step markers and scoped lookup layout. */
.registration-meter { position: relative; margin: 1.4rem 0 1.8rem; }
.registration-meter-track { position: absolute; top: 20px; left: calc(100% / 12); right: calc(100% / 12); height: 6px; background: #d9e4f0; border-radius: 999px; }
.registration-meter-track > span { display: block; height: 100%; background: var(--portal-accent, #1f7ae0); border-radius: inherit; }
.registration-meter-track > .meter-position-0 { width: 0%; }
.registration-meter-track > .meter-position-1 { width: 20%; }
.registration-meter-track > .meter-position-2 { width: 40%; }
.registration-meter-track > .meter-position-3 { width: 60%; }
.registration-meter-track > .meter-position-4 { width: 80%; }
.registration-meter-track > .meter-position-5 { width: 100%; }
.registration-progress { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; gap: 0; }
.registration-progress-step { min-width: 0; text-align: center; }
.registration-step-link { display: flex; align-items: center; flex-direction: column; gap: .5rem; width: 100%; padding: 0 .15rem; border: 0; background: transparent; color: #506680; font: inherit; }
.registration-step-link:disabled { opacity: 1; cursor: default; }
.registration-step-link:not(:disabled) { cursor: pointer; }
.registration-step-marker { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border: 2px solid #bdcede; border-radius: 50%; background: #fff; color: #506680; font-weight: 700; }
.registration-progress-step.completed .registration-step-marker { background: var(--portal-accent, #1f7ae0); border-color: var(--portal-accent, #1f7ae0); color: white; }
.registration-progress-step.current .registration-step-marker { border-color: var(--portal-accent, #1f7ae0); background: #e8f2ff; color: #104d94; box-shadow: 0 0 0 4px rgba(31, 122, 224, .13); }
.registration-progress-step.current .registration-step-label { color: #102f53; font-weight: 700; }
.registration-step-label { font-size: .76rem; line-height: 1.35; overflow-wrap: normal; }
.registration-step-link:not(:disabled):hover .registration-step-label { text-decoration: underline; }
.registration-step-link:focus-visible { outline: 2px solid var(--portal-accent); outline-offset: 4px; border-radius: 8px; }
.step-label-short { display: none; }
.registration-step-help { margin: 1.75rem 0; padding: 1.1rem; border: 1px solid rgba(255, 255, 255, .25); border-radius: 14px; background: rgba(255, 255, 255, .06); }
.auth-brand .registration-step-help h2 { font-size: 1.05rem; color: #fff; margin: 0 0 .7rem; }
.registration-step-help ul { padding-left: 1.1rem; margin: 0; }
.registration-step-help li { font-size: .92rem; line-height: 1.6; color: rgba(255, 255, 255, .9); }
.registration-step-help li + li { margin-top: .6rem; }
.registration-lookup-control { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: stretch; gap: .5rem; }
.registration-search-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.registration-wizard .registration-lookup-control > .form-control, .registration-wizard .registration-lookup-control > .btn,
.registration-wizard .registration-search-control > .form-control, .registration-wizard .registration-search-control > .btn { min-width: 0; min-height: 48px; border-radius: 12px; margin: 0; }
.registration-lookup-control > .btn, .registration-search-control > .btn { white-space: nowrap; }
.registration-wizard .check-label { margin-top: 1rem; }
.auth-utility-actions.login-utility-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wizard-review-block { border: 1px solid #d7e2ef; border-radius: .6rem; padding: 1rem; margin-bottom: .8rem; background: #f8fbff; }
.wizard-review-block h3 { font-size: 1.05rem; }
.registration-lookup { width: min(42rem, 94vw); max-height: 85vh; overflow: auto; border: 1px solid #b8c9de; border-radius: .8rem; padding: 1.5rem; }
.registration-lookup::backdrop { background: rgba(15, 30, 52, .45); }
.sales-configuration-note { border-left: 4px solid #2466bd; padding: .9rem 1rem; background: #edf4ff; margin-bottom: 1rem; }
@media (max-width: 575.98px) {
    .registration-wizard .auth-form-wrap { padding: 1.4rem 1rem; }
    .registration-step-label { font-size: .66rem; }
    .step-label-full { display: none; }
    .step-label-short { display: inline; }
    .registration-step-marker { width: 34px; height: 34px; flex-basis: 34px; font-size: .85rem; }
    .registration-meter-track { top: 15px; height: 4px; }
    .registration-lookup-control { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .registration-lookup-control > .form-control { grid-column: 1 / -1; }
    .registration-step-help { margin: 1rem 0; }
}

/* 0.3.0 W1: application dialogs; never replace inline field validation. */
.nimble-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--portal-border, #d8e5f2); border-radius: 18px; color: var(--portal-text, #17324d); background: white; box-shadow: 0 18px 64px rgba(16, 42, 70, .28); }
.nimble-dialog::backdrop { background: rgba(10, 31, 52, .55); }
.nimble-dialog__header { padding: 1.2rem 1.4rem; background: #edf5ff; border-bottom: 1px solid var(--portal-border, #d8e5f2); }
.nimble-dialog__header h2 { font-size: 1.2rem; margin: 0; }
.nimble-dialog__body { padding: 1.3rem 1.4rem .4rem; }
.nimble-dialog__body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.nimble-dialog__footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; padding: 1rem 1.4rem 1.3rem; }
.management-resource-link { display: flex; align-items: center; gap: .65rem; }
.management-resource-link > .bi { flex: 0 0 1.25rem; }

/* Onboarding O2c/O2d visual additions live outside the preserved source theme. */
.status-signed,
.status-accepted {
    background: #e9f7f0;
    color: var(--portal-success);
}

@media (min-width: 1200px) {
    .agreement-box {
        height: clamp(520px, 62vh, 680px);
        min-height: 520px;
        max-height: none;
    }
}

.agreement-box .portal-contract-signature,
.agreement-box #Owner_Name__c,
.agreement-box #Owner_Name__c *,
.agreement-box #CRS_Services__c,
.agreement-box #CRS_Services__c *,
.agreement-box .typed-signature {
    font-family: "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive !important;
    font-size: 1.9rem !important;
    line-height: 1.15 !important;
    font-weight: 400 !important;
    font-style: normal !important;
}

.onboarding-thermometer .thermometer-percent {
    min-width: 4.5rem;
    text-align: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #eaf3ff;
    border: 1px solid #bfd8f5;
    color: #0b5fc6;
    font-weight: 700;
}

.thermometer-track {
    position: relative;
    height: 1.15rem;
    overflow: hidden;
    border: 1px solid #b9cfe8;
    border-radius: 999px;
    background: #eef5fc;
    box-shadow: inset 0 1px 2px rgba(20, 56, 94, 0.08);
}

.thermometer-fill {
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #79afea 0%, #2f80d9 55%, #0d6efd 100%);
    transition: width 180ms ease-out;
}

