*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --qmsg-navbar-height: 70px;
    --qmsg-footer-height: 96px;
}

body {
    margin: 0;
}

.qmsg-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: var(--qmsg-navbar-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 4px 18px rgba(31, 41, 55, 0.08);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.qmsg-navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 0 28px;
}

.qmsg-navbar__brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    color: #20242b;
    font-size: 21px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.qmsg-navbar__logo {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
}

.qmsg-navbar__version {
    display: inline-flex;
    min-height: 20px;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border: 1px solid rgba(230, 76, 114, 0.34);
    border-radius: 4px;
    background: rgba(230, 76, 114, 0.08);
    color: #d94066;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.qmsg-navbar__links {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 26px;
}

.qmsg-navbar__link,
.qmsg-navbar__user {
    color: #343942;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.qmsg-navbar__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 160ms ease;
}

.qmsg-navbar__link i {
    width: 16px;
    text-align: center;
}

.qmsg-navbar__link:hover,
.qmsg-navbar__link:focus-visible {
    color: #e64c72;
}

.qmsg-navbar__link:focus-visible,
.qmsg-navbar__brand:focus-visible {
    border-radius: 4px;
    outline: 2px solid #e64c72;
    outline-offset: 4px;
}

.qmsg-navbar__user {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    transition: color 160ms ease;
}

.qmsg-navbar__user:hover,
.qmsg-navbar__user:focus-visible {
    color: #e64c72;
}

.qmsg-navbar__user:focus-visible {
    border-radius: 4px;
    outline: 2px solid #e64c72;
    outline-offset: 4px;
}

.qmsg-navbar__name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qmsg-navbar__avatar {
    display: block;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(31, 41, 55, 0.16);
}

.qmsg-error {
    display: grid;
    min-height: calc(100vh - var(--qmsg-navbar-height) - var(--qmsg-footer-height));
    min-height: calc(100svh - var(--qmsg-navbar-height) - var(--qmsg-footer-height));
    place-items: center;
    padding: 32px 24px calc(32px + var(--qmsg-navbar-height));
    background: #f8f9fb;
    color: #20242b;
    text-align: center;
}

.qmsg-error__content {
    width: min(100%, 560px);
}

.qmsg-error__icon {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 12px 28px rgba(31, 41, 55, 0.14);
}

.qmsg-error__code {
    margin: 0 0 10px;
    color: #e64c72;
    font-size: 68px;
    font-weight: 800;
    line-height: 1;
}

.qmsg-error__title {
    margin: 0;
    font-size: 30px;
    line-height: 1.35;
}

.qmsg-error__message {
    margin: 14px auto 0;
    color: #6b7280;
    font-size: 16px;
    line-height: 1.75;
}

.qmsg-error__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.qmsg-button {
    display: inline-flex;
    min-width: 112px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.qmsg-button--primary {
    background: #e64c72;
    color: #fff;
}

.qmsg-button--primary:hover {
    background: #d94066;
}

.qmsg-button--secondary {
    border-color: #d8dce3;
    background: rgba(255, 255, 255, 0.76);
    color: #343942;
}

.qmsg-button--secondary:hover {
    border-color: #bbc1cb;
    background: #fff;
}

.qmsg-button:focus-visible {
    outline: 2px solid #e64c72;
    outline-offset: 3px;
}

.qmsg-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.qmsg-footer {
    width: 100%;
    color: #7a818d;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

.qmsg-footer__inner {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 24px 28px;
}

.qmsg-footer__service,
.qmsg-footer__copyright {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
}

.qmsg-footer__copyright {
    margin-top: 3px;
    color: #969ca6;
}

.qmsg-footer__link {
    color: #59616d;
    text-decoration: none;
    transition: color 160ms ease;
}

.qmsg-footer__link:hover,
.qmsg-footer__link:focus-visible {
    color: #e64c72;
}

.qmsg-footer__link:focus-visible {
    border-radius: 3px;
    outline: 2px solid #e64c72;
    outline-offset: 3px;
}

.qmsg-footer__provider {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.qmsg-footer__provider-icon {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.qmsg-footer__icon {
    margin-right: 5px;
    color: #8a919c;
}

@media (max-width: 640px) {
    :root {
        --qmsg-navbar-height: 60px;
        --qmsg-footer-height: 85px;
    }

    .qmsg-navbar__inner {
        padding: 0 16px;
    }

    .qmsg-navbar__logo {
        width: 38px;
        height: 38px;
        border-radius: 9px;
    }

    .qmsg-navbar__links {
        gap: 16px;
    }

    .qmsg-navbar__name {
        max-width: 92px;
    }

    .qmsg-footer__inner {
        padding: 20px 16px;
    }

}

@media (max-width: 420px) {
    :root {
        --qmsg-navbar-height: 54px;
    }

    .qmsg-navbar__brand-text {
        display: none;
    }

    .qmsg-navbar__inner {
        padding: 0 12px;
    }

    .qmsg-navbar__logo {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .qmsg-navbar__version {
        min-height: 18px;
        padding: 0 5px;
        font-size: 10px;
    }

    .qmsg-navbar__links {
        gap: 12px;
    }

    .qmsg-navbar__link,
    .qmsg-navbar__user {
        font-size: 14px;
    }

    .qmsg-navbar__user {
        gap: 6px;
    }

    .qmsg-navbar__name {
        max-width: 64px;
    }

    .qmsg-navbar__avatar {
        width: 32px;
        height: 32px;
    }

    .qmsg-error {
        padding: 24px 18px calc(24px + var(--qmsg-navbar-height));
    }

    .qmsg-error__icon {
        width: 62px;
        height: 62px;
    }

    .qmsg-error__code {
        font-size: 56px;
    }

    .qmsg-error__title {
        font-size: 25px;
    }

    .qmsg-error__actions {
        width: 100%;
    }

    .qmsg-button {
        min-width: 0;
        flex: 1 1 0;
        padding: 0 14px;
    }

    .qmsg-footer {
        font-size: 12px;
    }

    .qmsg-footer__service,
    .qmsg-footer__copyright {
        row-gap: 1px;
    }
}

@media (max-height: 620px) {
    .qmsg-error {
        padding-top: 20px;
        padding-bottom: calc(20px + var(--qmsg-navbar-height));
    }

    .qmsg-error__icon {
        width: 54px;
        height: 54px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    .qmsg-error__code {
        margin-bottom: 6px;
        font-size: 48px;
    }

    .qmsg-error__title {
        font-size: 24px;
    }

    .qmsg-error__message {
        margin-top: 8px;
        line-height: 1.5;
    }

    .qmsg-error__actions {
        margin-top: 18px;
    }
}
