.knovilo-account-page {
    --knv-header-height: 64px;
    --knv-navigation-height: 24px;
}

.account-page {
    min-height: 60vh;
    width: min(100% - 40px, 1420px);
    padding-block: 12px 24px;
}

.account-mobile-brand {
    display: none;
}

.account-heading,
.account-heading a,
.account-sidebar a,
.account-password {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-heading {
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 28px;
}

.account-heading h1 {
    margin: 0;
    font-size: 26px;
}

.account-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 14px;
}

.account-sidebar {
    padding: 24px 16px;
    background: #fff;
    text-align: center;
    align-self: start;
    min-height: 798px;
}

.account-avatar {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin-inline: auto;
    border-radius: 50%;
    background: #dff2ff;
    color: #0074ed;
}

.account-avatar svg {
    width: 36px;
    height: 36px;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.account-sidebar h2 {
    margin: 16px 0 8px;
    font-size: 20px;
    overflow-wrap: anywhere;
}

.account-sidebar p {
    color: var(--knv-color-muted);
    font-size: 13px;
}

.account-sidebar a {
    min-height: 44px;
    margin-top: 12px;
}

.account-profile-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 12px;
}

.account-profile-actions a {
    min-height: 32px;
    margin: 0;
    font-size: 12px;
}

.account-profile-actions svg {
    width: 16px;
    height: 16px;
}

.account-content {
    min-width: 0;
}

.account-welcome {
    position: relative;
    min-height: 180px;
    overflow: hidden;
    background: #dff3ff;
}

.account-welcome > img {
    position: absolute;
    right: 0;
    width: 58%;
    height: 100%;
    object-fit: contain;
    object-position: right bottom;
    mask-image: linear-gradient(to right, transparent, #000 18%);
}

.account-welcome > div {
    position: relative;
    max-width: 56%;
    padding: 24px 32px;
}

.account-welcome h2 {
    margin: 0 0 10px;
    font-size: 28px;
    overflow-wrap: anywhere;
}

.account-welcome p {
    margin: 0 0 16px;
}

.account-welcome a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 2px 12px;
    border-radius: 8px;
    background: #fff;
}

.account-feed {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.account-feed > section {
    min-width: 0;
    min-height: 190px;
}

.account-feed p {
    color: var(--knv-color-muted);
    font-size: 14px;
}

.account-feed a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow-wrap: anywhere;
}

.account-recommendation-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.account-recommendation-list .home-resource-card {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 6px;
}

.account-recommendation-list .home-resource-card__media {
    display: block;
    min-height: 0;
    height: 110px;
}

.account-recommendation-list .home-resource-card__media img {
    object-fit: contain;
}

.account-recommendation-list .home-resource-card__body {
    padding: 8px;
}

.account-recommendation-list h3 {
    margin: 0 0 8px;
    font-size: 13px;
}

.account-recommendation-list .home-resource-card__meta,
.account-recommendation-list .home-resource-card__tags {
    font-size: 11px;
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-block: 14px;
}

.account-stats a {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 20px;
    background: #fff;
}

.account-stats a > span {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e5f3ff;
    color: #0074ed;
}

.account-stats a:nth-child(2) > span {
    background: #e1f7ee;
    color: #168465;
}

.account-stats a:nth-child(3) > span {
    background: #fff1e0;
    color: #bd6400;
}

.account-stats strong,
.account-stats small {
    display: block;
    overflow-wrap: anywhere;
}

.account-stats strong {
    color: #0074ed;
    font-size: 28px;
}

.account-membership {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    padding: 14px 28px;
    background: #fff0d7;
    color: #865014;
}

.account-membership > svg {
    width: 44px;
    height: 44px;
    color: #df9700;
}

.account-membership h2 {
    margin: 0;
    font-size: 20px;
}

.account-membership p {
    margin: 6px 0 0;
}

.account-side-menu {
    margin-top: 16px;
    text-align: left;
}

.account-side-menu a {
    padding: 10px;
    margin-top: 4px;
    font-size: 14px;
}

.account-side-menu a[aria-current] {
    border-left: 3px solid #0074ed;
    background: #eaf6ff;
    color: #0074ed;
}

.account-activity ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.account-activity li {
    display: flex;
    gap: 12px;
    padding-block: 12px;
    border-bottom: 1px solid #edf3f8;
}

.account-activity small {
    display: block;
    color: var(--knv-color-muted);
}

.account-section summary {
    padding-block: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.account-section {
    margin-bottom: 14px;
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid var(--knv-color-border);
    scroll-margin-top: 120px;
}

.account-section + .account-section {
    padding-top: 20px;
}

.account-section h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.account-shortcuts {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.account-shortcut {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 76px;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: #fff;
}

.account-shortcut span {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #e9f6ff;
    color: #0074ed;
}

.account-shortcut--favorites span {
    background: #fff0f3;
    color: #ca385a;
}

.account-shortcut--downloads span {
    background: #e8f8f1;
    color: #158267;
}

.account-shortcut strong {
    flex: 1;
    font-size: 14px;
}

.account-shortcut > svg {
    display: none;
}

.account-details {
    margin: 0 0 24px;
}

.account-details div {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 16px;
    padding-block: 10px;
}

.account-details dt {
    color: var(--knv-color-muted);
}

.account-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.account-profile-form label {
    display: block;
    margin-bottom: 8px;
}

.account-profile-form > div {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 560px;
}

.account-profile-form input[type="text"] {
    min-width: 0;
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--knv-color-border);
    border-radius: 6px;
    background: #fff;
    color: var(--knv-color-heading);
    font: inherit;
    font-size: 16px;
}

.account-profile-form .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 8px;
    min-height: 46px;
    border-radius: 6px;
}

.account-password {
    width: fit-content;
    min-height: 44px;
    margin-top: 16px;
}

.account-services {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.account-services a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
}

.account-services a > svg:last-child {
    margin-left: auto;
}

.account-message {
    padding: 12px 16px;
    border-left: 3px solid #18816a;
    background: #effaf6;
    color: #166751;
}

.account-message--error {
    border-color: #c83a47;
    background: #fff1f2;
    color: #84232d;
}

.account-guest {
    padding-block: 48px;
    text-align: center;
}

.account-guest > svg {
    width: 48px;
    height: 48px;
    color: var(--knv-color-primary);
}

.account-page a:focus-visible,
.account-page button:focus-visible,
.account-page input:focus-visible {
    outline: 2px solid var(--knv-color-primary);
    outline-offset: 3px;
}

@media (width <= 767px) {
    .account-page {
        width: calc(100% - 24px);
    }

    .account-feed {
        display: block;
        order: 3;
    }

    .knovilo-account-page .site-header,
    .account-heading {
        display: none;
    }

    .account-mobile-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        position: relative;
        min-height: 38px;
        margin-bottom: 12px;
    }

    .account-mobile-brand > strong {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 24px;
    }

    .account-mobile-brand .site-brand__symbol {
        width: 28px;
    }

    .account-mobile-brand .site-brand__wordmark strong {
        font-size: 16px;
    }

    .account-content {
        display: contents;
    }

    .account-membership {
        order: 1;
        padding: 16px;
    }

    .account-activity,
    .account-section[id="account-profile"],
    .account-section:has(.account-services) {
        order: 2;
    }

    .account-sidebar {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        column-gap: 12px;
        padding: 16px 16px 8px;
        min-height: 0;
        order: -2;
        border: 0;
        text-align: left;
    }

    .account-avatar {
        grid-row: span 3;
        align-self: center;
        width: 56px;
        height: 56px;
    }

    .account-sidebar h2 {
        margin: 0;
        font-size: 18px;
    }

    .account-sidebar p {
        margin: 4px 0;
    }

    .account-profile-actions {
        grid-column: 2;
        justify-content: flex-start;
        margin-top: 0;
        gap: 4px 10px;
    }

    .account-profile-actions a {
        min-height: 28px;
        font-size: 11px;
        gap: 4px;
    }

    .account-welcome,
    .account-side-menu {
        display: none;
    }

    .account-stats {
        gap: 0;
        order: -1;
        margin: 0 0 12px;
        padding: 4px 8px 12px;
        background: #fff;
    }

    .account-stats a {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 6px;
        padding: 8px 2px;
        text-align: left;
    }

    .account-stats a + a {
        border-left: 1px solid var(--knv-color-border);
    }

    .account-stats a > span {
        display: grid;
        width: 22px;
        height: 26px;
        border-radius: 0;
        background: transparent;
    }

    .account-stats a > span svg {
        width: 22px;
        height: 22px;
    }

    .account-stats a > div {
        display: flex;
        flex-direction: column-reverse;
    }

    .account-stats small {
        font-size: 11px;
    }

    .account-stats strong {
        font-size: 23px;
    }

    .account-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .account-sidebar a {
        display: inline-flex;
        margin-right: 0;
    }

    .account-shortcuts {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .account-shortcut {
        gap: 8px;
        padding: 10px 4px;
        min-height: 46px;
        border: 0;
        border-bottom: 1px solid var(--knv-color-border);
        border-radius: 0;
    }

    .account-shortcut span {
        width: 28px;
        height: 32px;
    }

    .account-shortcut--library { --account-shortcut-image: url("../images/account-icons/library-v1.png"); }

    .account-shortcut:not(.account-shortcut--reading) span {
        width: 32px;
        background: var(--account-shortcut-image) center / contain no-repeat;
        border-radius: 0;
        mix-blend-mode: multiply;
    }

    .account-shortcut:not(.account-shortcut--reading) span svg {
        visibility: hidden;
    }

    .account-shortcut strong {
        color: var(--knv-color-heading);
        font-size: 16px;
    }

    .account-shortcut > svg {
        display: block;
    }

    .account-services {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .account-profile-form > div {
        flex-wrap: wrap;
    }

    .account-section {
        padding: 8px 16px;
        margin-bottom: 12px;
    }

    .account-section:has(.account-shortcuts) > h2,
    .account-section:has(.account-services) > h2 {
        display: none;
    }

    .account-shortcut--history {
        --account-shortcut-image: url("../images/account-icons/history-v1.png");

        order: 1;
    }

    .account-shortcut--favorites {
        --account-shortcut-image: url("../images/account-icons/favorites-v1.png");

        order: 2;
    }

    .account-shortcut--downloads {
        --account-shortcut-image: url("../images/account-icons/downloads-v1.png");

        order: 3;
    }

    .account-shortcut--reading { order: 4; }

    .account-shortcut--orders {
        --account-shortcut-image: url("../images/account-icons/orders-v1.png");

        order: 5;
    }

    .account-section[id="account-profile"] {
        order: 4;
    }

    .account-services a {
        min-height: 48px;
        border-bottom: 1px solid var(--knv-color-border);
        color: var(--knv-color-heading);
    }
}

@media (768px <= width <= 1199px) {
    .account-shortcuts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .account-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-welcome > div {
        max-width: 68%;
        padding: 24px;
    }
}

.account-stats .account-stat-unavailable {
    padding-block: 8px;
    color: var(--knv-color-muted);
    font-size: 13px;
}
