body {
    display: flex;
    flex-direction: column;
    gap: var(--m);
}

.header,
.footer {
    background-color: var(--color-background-card);
    transition: 0.3s ease-out all;
}

.header {
    position: sticky;
    top: 0;
    border-bottom: 0.1rem solid rgba(255, 255, 255, 0.06);      
    box-shadow: 0 0 0.5rem 0.06rem rgba(255, 255, 255, 0.02);  
    z-index: 2;
}

.wrapper {
    flex: 1;
    display: flex;
    align-items: stretch;
}

.wrapper .blur {
    opacity: 0;
    transition: 0.3s ease all;
}

.header__content,
.wrapper__content,
.footer__content {
    width: var(--content-width);
    margin-inline: auto;
    display: flex;
    gap: var(--l);
}

.header__content,
.footer__content {
    height: var(--header-height);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--xxs);
    position: relative;
}

.logo {
    margin-right: auto;
    font-size: var(--font-l);
    font-weight: var(--semi-bold);
}

.header__institution {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--font-l);
    font-weight: var(--semi-bold);
}

.header__user {    
    font-size: var(--font-s);
    font-weight: var(--semi-bold);
    display: flex;
    align-items: center;
    gap: var(--xxxs);
}

.header__user-info {
    padding-inline: var(--xxs);
    cursor: default;
}

.header__user-info:has(.header__user-role) {
    padding-inline: var(--xxs) 0;
}

.header__user .logout {
    background-color: var(--color-logout);
}

.header__user .login {
    background-color: var(--color-login);
}

.menu {
    font-size: var(--font-s);
    font-weight: var(--lighter);
    display: flex;
    align-items: center;
    text-transform: uppercase;
    display: none;
}

.theme__button {
    font-size: var(--font-s);
    font-weight: var(--lighter);
    display: flex;
    align-items: center;
    text-transform: uppercase;
}

.theme {
    position: relative;
    z-index: 1;
}

.theme__options {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, var(--l));
    background-color: var(--color-background-card);
    display: flex;
    flex-wrap: wrap;
    gap: var(--xxxs);
    width: 9rem;
    padding: var(--xxs);
    border-radius: var(--radius-s);
    border: 0.1rem solid var(--color-input-border);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease-out all;
}

.theme__options.active {
    transform: translate(-50%, var(--xs));
    opacity: 1;
    pointer-events: all;
}

.theme__option {
    flex-basis: 30%;
    border: 0.1rem solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0.5rem 0.06rem rgba(255, 255, 255, 0.02);
}

#dark {
    background-color: #222222;
}

#light {
    background-color: #eff2f9;
}

#green {
    background-color: #023020;
}

.aside {
    min-width: 20rem;
    align-self: flex-start;
    position: sticky;
    top: calc(var(--header-height) + var(--m));
    transition: 0.65s cubic-bezier(0.68, 0.22, 0, 0.9) all;
}

.aside__content,
.main__content {
    padding: var(--xs);
    background-color: var(--color-background-card);
    border-radius: var(--radius-xs);
    border: 0.1rem solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0.5rem 0.06rem rgba(255, 255, 255, 0.02);
    transition: 0.3s ease-out all;
}

body[data-theme="light"] .wrapper__content > * > *,
body[data-theme="light"] .header,
body[data-theme="light"] .footer,
body[data-theme="light"] .theme__option {
    border: 0.1rem solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 0 0.5rem 0.06rem rgba(0, 0, 0, 0.02);
}

.aside__header {
    text-align: center;
    font-size: var(--font-m);
    font-weight: var(--semi-bold);
    border-bottom: 0.01rem solid rgba(255, 255, 255, 0.1);
    padding-block: var(--xxs);
}

body[data-theme="light"] .aside__header,
body[data-theme="light"] .main__header,
body[data-theme="light"] .note {
    border-bottom: 0.01rem solid rgba(0, 0, 0, 0.1);
}

.aside__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aside__title {
    text-align: start;
    padding-left: var(--s);
    font-size: var(--font-m);
    font-weight: var(--semi-bold);
}

.aside__button {
    display: none;
}

.aside__list {
    max-height: 34rem;
    overflow-y: auto;
    display: grid;
    gap: var(--xxxs);
    margin-top: var(--xs);
}

.aside__link {
    font-size: var(--font-s);
    border-radius: var(--radius-xs);
    display: flex;
    padding: var(--s);
    transition: 0.3s ease-out all;
}

.aside__link:hover {
    background-color: var(--color-background-page);
    filter: brightness(1.2);
}

.main {
    flex: 1;
}

.main__content {
    height: 100%;
    /* overflow-x: hidden; */
    position: relative;
}

.main__header {
    display: flex;
    align-items: center;
    gap: var(--xl);
    border-bottom: 0.01rem solid rgba(255, 255, 255, 0.1);
    padding-block: var(--xxs);
    margin-bottom: var(--xs);
}

.main__title {
    font-size: var(--font-xl);
}


/* user manual */
.manual {
    margin-block: var(--xxxxl);
}

.manual__section {
    margin-bottom: var(--xxxxxl);
}

.manual__section > *:not(.manual__section-header) {
    margin-left: var(--xl);
}

.manual__section-header {
    margin-bottom: var(--xxl);
    display: flex;
    align-items: center;
    gap: var(--s);
}

.manual__section-header::after {
    content: "";
    flex: 1;   
    height: 0.01rem;
    background: currentColor;
    opacity: 0.09;
    align-self: center;
}

.manual__header {
    font-weight: var(--semi-bold);
    font-size: var(--font-xxl);
}

.manual__subsection {
    margin-block: var(--xxl) var(--xxxl);
}

.manual__subheader {
    font-size: var(--font-xl);
    margin-bottom: var(--xl);
}

.manual__minor-header {
    font-weight: var(--semi-bold);
    line-height: 1.5;
    margin-bottom: var(--s);
}

.manual__group {
    display: grid;
    gap: var(--xxxs);
    margin-bottom: var(--xl);
}

.manual__text,
.manual__point {
    opacity: 0.64;
    line-height: 1.7;
}

.manual__points {
    list-style: disc;
    margin-bottom: var(--xl);
    margin-left: var(--xl);
}

.manual__points .manual__points {
    list-style: circle;
}

.manual__text {
    margin-bottom: var(--l);
}

.manual__subheader:has(+ .manual__text),
.manual__minor-header:has(+ .manual__text) {
    margin-bottom: var(--xs);
}

.manual__group:has(+ .manual__text) {
    margin-bottom: 0;
}

.note {
    background-color: var(--color-background-page);
    padding: var(--s);
    padding-top: var(--xl);
    border-radius: var(--radius-s);
    display: grid;
    gap: var(--l);
    border-bottom: 0.1rem solid rgba(255, 255, 255, 0.06);  
}

.note:has(+ *) {
    margin-bottom: var(--xxl);
}

body[data-theme="light"] .note {
    background-color: var(--color-input-background);
    box-shadow: 0.1rem 0.2rem 0.6rem 0.1rem rgba(0, 0, 0, 0.08);
}


/* table */
.table {
    margin-bottom: var(--xl);
}

.table__row {
    display: grid;
    justify-content: space-between;
    column-gap: var(--l);
    padding: var(--s) var(--xxxs);
    font-size: var(--font-s);
}

.table__row:nth-child(odd){
    background-color: var(--color-alternate-background);
    border-top: 0.01rem dashed var(--color-input-border);
    border-bottom: 0.01rem dashed var(--color-input-border);
}

.table__row {
    display: grid;
}

#abbreviation .row-2 {
    grid-template-columns: 5rem 1fr;
}

#phrase .row-2 {
    grid-template-columns: 16rem 1fr;
}

#phrase .row-2 .table__field:nth-child(2) {
    line-height: 1.5;
}


/* scroll to top & prev page button */
.bottom-buttons {
    position: absolute;
    top: 120vh;
    bottom: var(--xxxl);
    right: var(--xl);
    pointer-events: none;
}

.bottom-buttons__container {
    position: -webkit-sticky; 
    position: sticky; 
    top: 90vh; 
    display: flex;
    gap: var(--s);
    background-color: var(--color-background-card);
    padding: var(--xxxs);
    border-radius: var(--radius-m);
    border: 0.1rem solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0.4rem 0.4rem rgba(0, 0, 0, 0.1);
}

.bottom-button {
    pointer-events: all;
    display: flex;
    align-items: center;
}


.footer {
    margin-top: auto;
    border-top: 0.01rem solid rgba(255, 255, 255, 0.06);    
}

.footer__content {
    padding: var(--xs);
}


/* media query */
@media (max-width: 1440px) {
    .header__content {
        justify-content: space-between;
    }

    .logo {
        margin-right: var(--xxs);
        position: relative;
    }

    .logo::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 0;
        transform: translate(calc(var(--l) / 2), -50%);
        height: 2rem;
        width: 0.01rem;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .header__institution {
        position: initial;
        top: initial;
        left: initial;
        transform: translate(0, 0);
        margin-right: auto;
        opacity: 0.56;
    }

    .menu {
        display: block;
    }

    .aside {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%);
        z-index: 3;
    }
    
    .aside.active {
        transform: translateX(0);
    }
    
    .aside__content {
        height: 100vh;
    }
    
    .aside__list {
        max-height: 86vh;
    }
    
    .wrapper .blur.active {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        opacity: 1;
        background-color: rgba(255, 255, 255, 0.04);
        backdrop-filter: blur(0.05rem);
        z-index: 2;
    }

    .aside__button {
        display: block;
    }
}

@media (max-width: 1200px) {
    .wrapper__content {
        flex-direction: column-reverse;
    }
}

@media (max-width: 880px) {
    .header__content {
        gap: var(--xxxs);
    }

    .header__institution {
        display: none;
    }

    .theme {
        margin-left: auto;
    }

    .menu span {
        display: none;
    }
}

@media (max-width: 640px) {
    #phrase .row-2 {
        grid-template-columns: 12rem 1fr;
    }
}

@media (max-width: 560px) {
    .header__content {
        height: auto;
        padding-block: var(--xs);
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .logo {
        margin-top: var(--xs);
    }

    .logo::after {
        display: none;
    }

    .header__user {
        flex-basis: 100%;
        flex-direction: column;
        align-items: flex-end;
    }

    .login,
    .logout {
        align-self: flex-end;
    }

    .aside {
        width: 100%;    
    }
    
    .main__header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main__title {
        font-size: var(--font-l);
        font-weight: var(--semi-bold);
    }

    .main__features {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .main__feature {
        aspect-ratio: 1;
    }

    .wrapperInfo__title {
        font-size: var(--font-m);
    }

    #phrase .row-2 {
        grid-template-columns: 1fr;
        gap: var(--xxxs);
    }

    #phrase .row-2 .table__field:nth-child(2) {
        opacity: 0.6;
    }
}



@media (max-width: 480px) {
    .wrapperInfo__barcode {
        width: 100%;
    }

    .wrapperInfo__name {
        font-size: var(--font-xxs);
    }

    .manual__section > *:not(.manual__section-header) {
        margin-left: 0;
    }

    .manual__header {
        font-size: var(--font-xl);
    }

    .manual__subheader {
        font-size: var(--font-l);
    }

    .manual__minor-header,
    .manual__point,
    .manual__text {
        font-size: var(--font-s);
    }

    .manual__section-header::after {
        display: none;
    }

    .manual__section-header {
        border-bottom: 0.1rem solid rgba(255, 255, 255, 0.06);  
        padding-bottom: var(--xxxs);
    }

    body[data-theme="light"] .manual__section-header {
        border-bottom: 0.01rem solid rgba(0, 0, 0, 0.1);
    }

    .long-string {
        text-wrap: nowrap;
        overflow-x: auto;
    }
}
