.zpet-legacy-shell {
    margin: 0 auto;
    max-width: 100%;
}

.zpet-legacy-shell--standard {
    align-items: flex-start;
    display: flex;
    gap: 2%;
}

.zpet-legacy-shell--standard .zpet-legacy-shell__content {
    flex: 0 1 80%;
    order: 2;
    width: 80%;
}

.zpet-legacy-shell--standard .zpet-legacy-shell__side {
    flex: 0 0 18%;
    order: 1;
    width: 18%;
}

.zpet-legacy-shell--home {
    align-items: start;
    display: grid;
    grid-template-columns: 20% minmax(0, 60%) 19%;
    justify-content: start;
}

.zpet-legacy-shell--home .zpet-legacy-shell__side,
.zpet-legacy-shell--home .zpet-legacy-shell__content,
.zpet-legacy-shell--home .zpet-legacy-shell__right {
    float: none;
    min-width: 0;
    width: auto;
}

.zpet-legacy-shell--home .zpet-legacy-shell__side {
    box-sizing: border-box;
    padding-right: 40px;
}

.zpet-legacy-shell--home .zpet-legacy-shell__right {
    box-sizing: border-box;
    padding-left: 10px;
}

.zpet-legacy-shell--standard .zpet-legacy-shell__side,
.zpet-legacy-shell--standard .zpet-legacy-shell__content {
    float: none;
    min-width: 0;
}

.zpet-legacy-menu img {
    height: auto;
    margin-right: 5px;
    max-height: 20px;
    max-width: 22px;
    vertical-align: middle;
    width: auto;
}

.zpet-legacy-menu__encounter {
    margin: 0;
}

.zpet-legacy-menu__encounter button {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.zpet-legacy-menu__encounter button:hover {
    text-decoration: underline;
}

.zpet-legacy-menu__disabled {
    color: #777;
}

.zpet-legacy-shell .mainbox > p,
.zpet-legacy-shell .portalbox > p,
.zpet-legacy-shell .zpet-box-body {
    padding-left: 10px;
    padding-right: 10px;
}

.zpet-legacy-shell .zpet-read-only-notice {
    margin: 8px 10px;
}

.zpet-legacy-home-logo img,
.zpet-legacy-shell__right img,
.zpet-town-table img {
    height: auto;
    max-width: 100%;
    width: auto;
}

.zpet-legacy-home-logo img {
    max-width: none;
}

.zpet-legacy-home-logo {
    text-align: center;
}

.zpet-legacy-shell__right .mainbox p,
.zpet-legacy-shell__right .mainbox ol {
    margin: 8px 10px;
}

.zpet-town-table td {
    text-align: center;
    vertical-align: middle;
    width: 33.333%;
}

.zpet-legacy-shell .zpet-town-table {
    width: calc(100% + 2px);
}

.zpet-legacy-shell .zpet-pagination {
    padding: 8px 10px;
    text-align: right;
}

.zpet-legacy-shell form {
    margin: 4px 0;
}

.zpet-legacy-shell .zpet-page.formbox > form {
    margin: 0;
}

.zpet-trainer-avatar {
    padding: 0 10px 10px;
}

.zpet-trainer-avatar-list {
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(10, minmax(0, 1fr));
}

.zpet-trainer-avatar-list form {
    margin: 0;
    min-width: 0;
}

.zpet-trainer-avatar-list button {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    justify-content: center;
    min-height: 100%;
    padding: 2px;
    width: 100%;
}

.zpet-trainer-avatar-list button:hover,
.zpet-trainer-avatar-list button:focus-visible {
    border-color: #86b9d6;
}

.zpet-trainer-avatar-list img {
    height: auto;
    max-width: 100%;
    width: auto;
}

.zpet-appearance-controls {
    padding: 0 10px 10px;
}

.zpet-picture-mode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.zpet-picture-mode-actions form,
.zpet-background-list form {
    margin: 0;
}

.zpet-background-list {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.zpet-background-list form {
    align-items: center;
    border: 1px solid #d7e7ef;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 3px;
}

.zpet-background-list img {
    height: auto;
    max-width: 100%;
}

.zpet-legacy-map {
    text-align: center;
}

.zpet-legacy-map img {
    height: auto;
    max-width: 100%;
}

.zpet-capture-attacks,
.zpet-capture-balls {
    margin-top: 10px;
}

.zpet-capture-attacks form,
.zpet-capture-balls form {
    display: inline;
    margin: 0;
}

.zpet-capture-balls input[type="image"] {
    width: 22px;
    height: 22px;
}

.zpet-capture-balls input[type="image"]:hover,
.zpet-capture-balls input[type="image"]:focus {
    width: 26px;
    height: 26px;
}

#leftbar {
    float: left;
    width: 63%;
}

#rightbar {
    float: right;
    width: 33%;
}

@media (max-width: 900px) {
    .zpet-legacy-shell--home {
        grid-template-columns: 20% minmax(0, 78%);
    }

    .zpet-legacy-shell--home .zpet-legacy-shell__right {
        display: grid;
        gap: 10px;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 10px;
    }
}

@media (max-width: 680px) {
    #leftbar,
    #rightbar {
        float: none;
        width: auto;
    }
    .zpet-legacy-shell--standard,
    .zpet-legacy-shell--home {
        display: block;
    }

    .zpet-legacy-shell--standard .zpet-legacy-shell__content,
    .zpet-legacy-shell--standard .zpet-legacy-shell__side {
        width: auto;
    }

    .zpet-legacy-shell__side {
        margin-top: 10px;
    }

    .zpet-legacy-shell--home .zpet-legacy-shell__right {
        display: block;
    }

    .zpet-legacy-shell__content {
        overflow-x: auto;
    }

    .zpet-trainer-avatar-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .zpet-background-list {
        grid-template-columns: 1fr;
    }
}
