/* Match the compact deposit wallet used by the reference header only. */
ion-header .header .wallet,
ion-header .header .assets-box .deposit:has(.deposit-icon) {
    min-width: 30px;
    height: 26px;
    padding: 4px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
ion-header .header .wallet ion-icon,
ion-header .header .deposit-icon {
    width: 19px;
    height: 18px;
    font-size: 18px;
    flex-shrink: 0;
}

/* Keep the brand beside the menu stable on narrow toolbars. The original
 * toolbar utility classes allow the ion-img host to shrink with the auth
 * buttons, which makes the logo look clipped or vertically distorted. */
ion-toolbar.header ion-img,
ion-toolbar.header img {
    display: block;
    flex: 0 0 160px !important;
    width: 160px !important;
    min-width: 160px !important;
    max-width: 160px !important;
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    margin-inline-start: 8px !important;
    margin-inline-end: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
    overflow: hidden;
    background: transparent url("/assets/header-logo.webp?v=2") center / contain no-repeat;
}

ion-toolbar.header ion-img::part(image) {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
}

ion-toolbar.header img {
    content: url("/assets/header-logo.webp?v=2");
    object-fit: contain;
    object-position: center;
}

/* Actual home HeaderBar logo component used by Layout1/Layout2. */
html .logo-wrap.layout1 .logo.good-img,
html .logo-wrap.layout2 .logo.good-img {
    flex: 0 0 56px !important;
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    background: transparent url("/assets/header-logo.webp?v=2") center / contain no-repeat;
}

html .logo-wrap.layout1 .logo.good-img::part(image),
html .logo-wrap.layout2 .logo.good-img::part(image) {
    opacity: 0;
}

/* Larger brand mark inside the opened left drawer. */
html ion-toolbar.header-logo {
    --min-height: 156px;
    position: relative;
}

html ion-toolbar.header-logo ion-img.logo {
    flex: 0 0 144px !important;
    width: 144px !important;
    min-width: 144px !important;
    max-width: 144px !important;
    height: 144px !important;
    min-height: 144px !important;
    max-height: 144px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
    z-index: 2;
    background: transparent url("/assets/header-logo.webp?v=2") center / contain no-repeat;
}

html ion-toolbar.header-logo ion-img.logo::part(image) {
    object-fit: contain;
    opacity: 0;
}

@media (min-width: 520px) {
    ion-toolbar.header ion-img,
    ion-toolbar.header img {
        flex-basis: 176px !important;
        width: 176px !important;
        min-width: 176px !important;
        max-width: 176px !important;
        height: 88px !important;
        min-height: 88px !important;
        max-height: 88px !important;
    }

    html .logo-wrap.layout1 .logo.good-img,
    html .logo-wrap.layout2 .logo.good-img {
        flex-basis: 62px !important;
        width: 62px !important;
        min-width: 62px !important;
        max-width: 62px !important;
        height: 62px !important;
        min-height: 62px !important;
        max-height: 62px !important;
    }

    html ion-toolbar.header-logo {
        --min-height: 168px;
    }

    html ion-toolbar.header-logo ion-img.logo {
        flex-basis: 156px !important;
        width: 156px !important;
        min-width: 156px !important;
        max-width: 156px !important;
        height: 156px !important;
        min-height: 156px !important;
        max-height: 156px !important;
    }
}