.ohd-portal.ohd-ui-v2,
.ohd-portal-empty.ohd-ui-v2 {
    margin: clamp(1rem, 4vw, 3rem) auto;
    max-width: 1120px;
    width: min(calc(100% - 2rem), 1120px);
}

.ohd-portal-empty.ohd-ui-v2 {
    background: var(--ohd-white);
    border: 1px solid var(--ohd-line);
    border-radius: var(--ohd-radius-lg);
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

.ohd-portal-header {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ohd-portal-title h1 {
    font-size: clamp(1.65rem, 4vw, 2.5rem);
    margin: 0;
}

.ohd-portal-title p {
    color: var(--ohd-muted);
    margin: .35rem 0 0;
}

.ohd-portal-logout {
    border: 1px solid var(--ohd-line);
    border-radius: var(--ohd-radius-sm);
    font-weight: 700;
    min-height: 44px;
    padding: .65rem .9rem;
    text-decoration: none;
}

.ohd-portal-nav {
    background: var(--ohd-white);
    border: 1px solid var(--ohd-line);
    border-radius: var(--ohd-radius);
    display: flex;
    gap: .25rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding: .35rem;
    scrollbar-width: thin;
}

.ohd-portal-nav a {
    align-items: center;
    border-radius: var(--ohd-radius-sm);
    color: var(--ohd-muted);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .91rem;
    font-weight: 720;
    gap: .45rem;
    min-height: 44px;
    padding: .65rem .9rem;
    text-decoration: none;
}

.ohd-portal-nav a:hover {
    background: var(--ohd-soft);
    color: var(--ohd-navy);
}

.ohd-portal-nav a.is-active {
    background: var(--ohd-navy);
    color: var(--ohd-white);
}

.ohd-portal-nav-badge {
    align-items: center;
    background: var(--ohd-danger);
    border-radius: 999px;
    color: var(--ohd-white);
    display: inline-flex;
    font-size: .7rem;
    font-weight: 800;
    justify-content: center;
    min-height: 1.3rem;
    min-width: 1.3rem;
    padding: 0 .3rem;
}

.ohd-portal-notice {
    border: 1px solid var(--ohd-blue);
    border-left-width: 4px;
    border-radius: var(--ohd-radius-sm);
    margin: 0 0 1rem;
    padding: .85rem 1rem;
}

.ohd-portal-notice.is-info {
    background: var(--ohd-info-soft);
}

.ohd-portal-notice.is-success {
    background: var(--ohd-success-soft);
    border-color: var(--ohd-success);
}

.ohd-portal-notice.is-warning {
    background: var(--ohd-warning-soft);
    border-color: var(--ohd-warning);
}

.ohd-portal-notice.is-error {
    background: var(--ohd-danger-soft);
    border-color: var(--ohd-danger);
}

.ohd-portal-case-switcher {
    align-items: center;
    background: var(--ohd-soft);
    border: 1px solid var(--ohd-line);
    border-radius: var(--ohd-radius-sm);
    display: flex;
    gap: .75rem;
    margin-bottom: 1rem;
    padding: .75rem;
}

.ohd-portal-case-switcher label {
    font-size: .88rem;
    font-weight: 720;
}

.ohd-portal-case-switcher select,
.ohd-portal-message-form textarea,
.ohd-portal-message-form input[type="file"],
.ohd-portal-client-action-answer textarea,
.ohd-portal-client-action-answer input[type="file"] {
    background: var(--ohd-white);
    border: 1px solid var(--ohd-line-strong);
    border-radius: var(--ohd-radius-sm);
    color: var(--ohd-ink);
    font: inherit;
    min-height: 46px;
    padding: .7rem .8rem;
    width: 100%;
}

.ohd-portal-case-switcher select {
    max-width: 360px;
}

.ohd-portal-main-action,
.ohd-portal-content,
.ohd-portal-case-summary,
.ohd-portal-client-action {
    background: var(--ohd-white);
    border: 1px solid var(--ohd-line);
    border-radius: var(--ohd-radius-lg);
    margin: 0 0 1rem;
    padding: clamp(1rem, 3vw, 1.75rem);
}

.ohd-portal-main-action {
    border-top: 4px solid var(--ohd-blue);
    box-shadow: 0 10px 28px rgba(23, 32, 42, .07);
}

.ohd-portal-client-action {
    border-left: 4px solid var(--ohd-warning);
}

.ohd-portal-kicker {
    color: var(--ohd-accent);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0 0 .35rem;
    text-transform: uppercase;
}

.ohd-portal-main-action h2,
.ohd-portal-content h2,
.ohd-portal-case-summary h2,
.ohd-portal-client-action h2 {
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    margin: 0 0 .7rem;
}

.ohd-portal-main-action > p:not(.ohd-portal-kicker),
.ohd-portal-intro {
    color: var(--ohd-muted);
    max-width: 68ch;
}

.ohd-portal-main-action .ohd-button {
    margin-top: .5rem;
}

.ohd-portal-case-summary dl,
.ohd-portal-profile dl {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 1rem 0 0;
}

.ohd-portal-case-summary dl > div,
.ohd-portal-profile dl > div {
    background: var(--ohd-soft);
    border-radius: var(--ohd-radius-sm);
    min-width: 0;
    padding: .8rem;
}

.ohd-portal-case-summary dt,
.ohd-portal-profile dt {
    color: var(--ohd-muted);
    font-size: .75rem;
    font-weight: 750;
    letter-spacing: .03em;
    margin-bottom: .25rem;
    text-transform: uppercase;
}

.ohd-portal-case-summary dd,
.ohd-portal-profile dd {
    font-weight: 720;
    margin: 0;
    overflow-wrap: anywhere;
}

.ohd-portal-profile dd.is-empty {
    color: var(--ohd-muted);
    font-style: italic;
    font-weight: 500;
}

.ohd-portal-document-list {
    list-style: none;
    margin: .75rem 0 0;
    padding: 0;
}

.ohd-portal-document {
    align-items: center;
    border-bottom: 1px solid var(--ohd-line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: .85rem 0;
}

.ohd-portal-document > div {
    display: grid;
    gap: .25rem;
    min-width: 0;
}

.ohd-portal-document span {
    color: var(--ohd-muted);
    font-size: .86rem;
}

.ohd-portal-document a:not(.ohd-button) {
    font-weight: 720;
}

.ohd-portal-logbook {
    list-style: none;
    margin: 1.25rem 0;
    padding: 0;
}

.ohd-portal-logbook li {
    border-left: 2px solid var(--ohd-line);
    margin-left: .35rem;
    padding: 0 0 1.25rem 1.15rem;
    position: relative;
}

.ohd-portal-logbook li::before {
    background: var(--ohd-blue);
    border: 3px solid var(--ohd-white);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--ohd-blue);
    content: "";
    height: .7rem;
    left: -.43rem;
    position: absolute;
    top: .2rem;
    width: .7rem;
}

.ohd-portal-logbook time {
    color: var(--ohd-muted);
    font-size: .79rem;
    font-weight: 650;
}

.ohd-portal-logbook p {
    margin: .25rem 0 0;
}

.ohd-portal-message-form,
.ohd-portal-client-action-answer form {
    background: var(--ohd-soft);
    border-radius: var(--ohd-radius);
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
}

.ohd-portal-message-form label,
.ohd-portal-client-action-answer label {
    display: grid;
    font-size: .9rem;
    font-weight: 720;
    gap: .4rem;
}

.ohd-portal-client-action-answer summary {
    color: var(--ohd-blue-dark);
    cursor: pointer;
    font-weight: 750;
    min-height: 44px;
    padding: .7rem 0;
}

.ohd-portal-profile-pending {
    background: var(--ohd-warning-soft);
    border-left: 4px solid var(--ohd-warning);
    border-radius: var(--ohd-radius-sm);
    margin-top: 1rem;
    padding: .85rem 1rem;
}

.ohd-portal-profile-pending p {
    margin: .35rem 0;
}

@media (max-width: 820px) {
    .ohd-portal-case-summary dl,
    .ohd-portal-profile dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .ohd-portal.ohd-ui-v2,
    .ohd-portal-empty.ohd-ui-v2 {
        width: min(calc(100% - 1rem), 1120px);
    }

    .ohd-portal-header {
        align-items: flex-start;
    }

    .ohd-portal-nav {
        display: grid;
        gap: .3rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .ohd-portal-nav a {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 0;
        padding: .6rem .45rem;
        text-align: center;
        white-space: normal;
    }

    .ohd-portal-nav a:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .ohd-portal-case-switcher,
    .ohd-portal-document {
        align-items: stretch;
        flex-direction: column;
    }

    .ohd-portal-case-summary dl,
    .ohd-portal-profile dl {
        grid-template-columns: 1fr;
    }

    .ohd-portal-main-action .ohd-button,
    .ohd-portal-content .ohd-button,
    .ohd-portal-message-form .ohd-button {
        width: 100%;
    }

    .ohd-portal-content {
        padding: .9rem;
    }
}

/* Compact account access pages use the same v2 portal language. */
.ohd-auth-container.ohd-ui-v2 {
    margin: clamp(1rem, 5vw, 3rem) auto;
    max-width: 500px;
    width: min(calc(100% - 2rem), 500px);
}

.ohd-auth-container .ohd-section-box {
    background: var(--ohd-white);
    border: 1px solid var(--ohd-line);
    border-top: 4px solid var(--ohd-blue);
    border-radius: var(--ohd-radius-lg);
    box-shadow: 0 12px 32px rgba(23, 32, 42, .08);
    padding: clamp(1.25rem, 4vw, 2rem);
}

.ohd-auth-container .ohd-section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: 0 0 1.25rem;
    text-align: center;
}

.ohd-auth-container .ohd-description {
    color: var(--ohd-muted);
    margin: 0 0 1.25rem;
    text-align: center;
}

.ohd-auth-container .ohd-section-form > .ohd-form-group:last-of-type .ohd-button {
    width: 100%;
}

.ohd-auth-footer-line {
    color: var(--ohd-muted);
    font-size: .9rem;
    margin: .9rem 0 0;
    text-align: center;
}

.ohd-auth-footer-link {
    color: var(--ohd-blue-dark) !important;
    font-weight: 720;
    text-decoration: underline;
    text-decoration-color: rgba(15, 79, 130, .42);
}

.ohd-auth-footer-link:hover,
.ohd-auth-footer-link:focus-visible {
    background: transparent !important;
    color: var(--ohd-navy) !important;
    text-decoration-color: currentColor;
}

.ohd-auth-register-cta {
    border-top: 1px solid var(--ohd-line);
    margin-top: 1rem;
    padding-top: 1rem;
    text-align: center;
}

.ohd-auth-register-cta p {
    color: var(--ohd-muted);
    margin: 0 0 .55rem;
}

.ohd-auth-register-cta .ohd-button {
    width: 100%;
}

/* The post-submit receipt renders before the normal portal wrapper. */
.ohd-intake-received-page.ohd-ui-v2 {
    margin: clamp(1rem, 4vw, 3rem) auto;
    max-width: 820px;
    width: min(calc(100% - 2rem), 820px);
}

.ohd-intake-received {
    background: var(--ohd-white);
    border: 1px solid var(--ohd-line);
    border-top: 4px solid var(--ohd-blue);
    border-radius: var(--ohd-radius-lg);
    box-shadow: 0 10px 28px rgba(23, 32, 42, .08);
    padding: clamp(1.25rem, 4vw, 2rem);
}

.ohd-intake-received-kicker {
    color: var(--ohd-accent);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0 0 .4rem;
    text-transform: uppercase;
}

.ohd-intake-received h1 {
    font-size: clamp(1.65rem, 4vw, 2.3rem);
    margin: 0 0 .5rem;
}

.ohd-intake-received-lead,
.ohd-intake-received-help {
    color: var(--ohd-muted);
}

.ohd-intake-received-lead {
    margin: 0 0 1.25rem;
}

.ohd-intake-received-case {
    align-items: center;
    background: var(--ohd-soft);
    border: 1px solid var(--ohd-line);
    border-radius: var(--ohd-radius-sm);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
}

.ohd-intake-received-case span,
.ohd-intake-received-status dt {
    color: var(--ohd-muted);
    font-size: .82rem;
}

.ohd-intake-received-status {
    display: grid;
    gap: .6rem;
    margin: 0 0 1.25rem;
}

.ohd-intake-received-status > div {
    display: grid;
    gap: .15rem;
    grid-template-columns: minmax(110px, .35fr) minmax(0, 1fr);
}

.ohd-intake-received-status dd {
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.ohd-intake-received-next {
    border-top: 1px solid var(--ohd-line);
    margin-bottom: 1.25rem;
    padding-top: 1.25rem;
}

.ohd-intake-received-next h2 {
    font-size: 1.25rem;
    margin: 0 0 .75rem;
}

.ohd-intake-received-next ol {
    line-height: 1.6;
    margin: 0;
    padding-left: 1.35rem;
}

.ohd-intake-received-next li + li {
    margin-top: .45rem;
}

.ohd-intake-received-notice {
    background: var(--ohd-warning-soft);
    border-left: 4px solid var(--ohd-warning);
    border-radius: var(--ohd-radius-sm);
    margin-bottom: 1.25rem;
    padding: .85rem 1rem;
}

.ohd-intake-received-actions {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin: 1.25rem 0;
}

.ohd-intake-received-actions form {
    margin: 0;
}

@media (max-width: 560px) {
    .ohd-auth-container.ohd-ui-v2,
    .ohd-intake-received-page.ohd-ui-v2 {
        width: min(calc(100% - 1rem), 820px);
    }

    .ohd-intake-received-case {
        align-items: flex-start;
        flex-direction: column;
        gap: .25rem;
    }

    .ohd-intake-received-status > div {
        grid-template-columns: 1fr;
    }

    .ohd-intake-received-actions,
    .ohd-intake-received-actions .ohd-button,
    .ohd-intake-received-actions form {
        width: 100%;
    }
}

/* Keep late Elementor page rules from recolouring portal and account actions. */
html body .ohd-portal.ohd-ui-v2 .ohd-button,
html body .ohd-auth-container.ohd-ui-v2 .ohd-button,
html body .ohd-login-required.ohd-ui-v2 .ohd-button {
    background: var(--ohd-blue) !important;
    border: 1px solid var(--ohd-blue) !important;
    color: var(--ohd-white) !important;
    -webkit-text-fill-color: var(--ohd-white) !important;
    text-transform: none !important;
}

html body .ohd-portal.ohd-ui-v2 .ohd-button:hover,
html body .ohd-portal.ohd-ui-v2 .ohd-button:focus-visible,
html body .ohd-auth-container.ohd-ui-v2 .ohd-button:hover,
html body .ohd-auth-container.ohd-ui-v2 .ohd-button:focus-visible,
html body .ohd-login-required.ohd-ui-v2 .ohd-button:hover,
html body .ohd-login-required.ohd-ui-v2 .ohd-button:focus-visible {
    background: var(--ohd-blue-dark) !important;
    border-color: var(--ohd-blue-dark) !important;
    color: var(--ohd-white) !important;
    -webkit-text-fill-color: var(--ohd-white) !important;
}

html body .ohd-portal.ohd-ui-v2 .ohd-button-secondary,
html body .ohd-auth-container.ohd-ui-v2 .ohd-button-secondary,
html body .ohd-login-required.ohd-ui-v2 .ohd-button-secondary {
    background: var(--ohd-white) !important;
    border-color: var(--ohd-blue) !important;
    color: var(--ohd-blue-dark) !important;
    -webkit-text-fill-color: var(--ohd-blue-dark) !important;
}

html body .ohd-portal.ohd-ui-v2 .ohd-button-secondary:hover,
html body .ohd-portal.ohd-ui-v2 .ohd-button-secondary:focus-visible,
html body .ohd-auth-container.ohd-ui-v2 .ohd-button-secondary:hover,
html body .ohd-auth-container.ohd-ui-v2 .ohd-button-secondary:focus-visible,
html body .ohd-login-required.ohd-ui-v2 .ohd-button-secondary:hover,
html body .ohd-login-required.ohd-ui-v2 .ohd-button-secondary:focus-visible {
    background: var(--ohd-info-soft) !important;
    border-color: var(--ohd-blue-dark) !important;
    color: var(--ohd-blue-dark) !important;
    -webkit-text-fill-color: var(--ohd-blue-dark) !important;
}

/* Elementor also sets a late white link colour on the dossier page. Keep every
 * inactive portal tab and the logout action readable on the white surfaces. */
html body .ohd-portal.ohd-ui-v2 .ohd-portal-nav a {
    background: transparent !important;
    color: var(--ohd-muted) !important;
    -webkit-text-fill-color: var(--ohd-muted) !important;
    text-decoration: none !important;
}

html body .ohd-portal.ohd-ui-v2 .ohd-portal-nav a:hover,
html body .ohd-portal.ohd-ui-v2 .ohd-portal-nav a:focus-visible {
    background: var(--ohd-soft) !important;
    color: var(--ohd-navy) !important;
    -webkit-text-fill-color: var(--ohd-navy) !important;
}

html body .ohd-portal.ohd-ui-v2 .ohd-portal-nav a.is-active,
html body .ohd-portal.ohd-ui-v2 .ohd-portal-nav a.is-active:hover,
html body .ohd-portal.ohd-ui-v2 .ohd-portal-nav a.is-active:focus-visible {
    background: var(--ohd-navy) !important;
    color: var(--ohd-white) !important;
    -webkit-text-fill-color: var(--ohd-white) !important;
}

html body .ohd-portal.ohd-ui-v2 .ohd-portal-logout {
    background: var(--ohd-white) !important;
    border-color: var(--ohd-line) !important;
    color: var(--ohd-navy) !important;
    -webkit-text-fill-color: var(--ohd-navy) !important;
}

html body .ohd-portal.ohd-ui-v2 .ohd-portal-logout:hover,
html body .ohd-portal.ohd-ui-v2 .ohd-portal-logout:focus-visible {
    background: var(--ohd-soft) !important;
    color: var(--ohd-navy) !important;
    -webkit-text-fill-color: var(--ohd-navy) !important;
}
