body.glossary-page #bodyText {
    position: absolute;
    top: 15%;
    bottom: 5%;
    left: 22%;
    width: 56%;
    padding-bottom: 0 !important;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body.glossary-page #bodyText::-webkit-scrollbar {
    display: none;
}

.glossary-shell {
    width: min(860px, 100%);
    height: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-rows: 1fr auto 1fr auto 1fr;
    align-items: center;
    text-align: center;
}

.glossary-title,
.glossary-shell h1 {
    grid-row: 1;
    position: static;
    margin: 0;
    padding: 0;
    align-self: flex-end;
}

.glossary-search-area {
    grid-row: 3;
    position: relative;
    overflow: visible;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
}

.glossary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px 104px;
    gap: 4px;
    align-items: center;
    width: 100%;
    min-height: 40px;
}

.glossary-control {
    box-sizing: border-box;
    width: 100%;
    min-height: 36px;
    border: 1px dotted rgba(165, 165, 165, 0.55);
    background: var(--background-light);
    color: var(--foreground);
    font-family: 'Open Sans', sans-serif;
    font-size: var(--font-size-p);
    line-height: 1.4;
    padding: 6px 10px;
    outline: none;
}

.glossary-button {
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.glossary-button p {
    margin: 0;
}

.flag-style {
    padding: 0;
}

.flag-grid {
    display: grid;
    grid-template-columns: 45% 10% 45%;
    align-items: center;
    width: 100%;
    height: 100%;
}

.flag-grid-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.flag-image {
    max-height: 80%;
    max-width: 90%;
    width: auto;
}

.lang-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2ch;
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--foreground);
}

.transform-scale {
    transform: scale(1.05);
}

.glossary-alt-link {
    text-decoration: none;
    color: inherit;
}

.glossary-alt-link .glossary-control {
    margin-top: 0;
}

.glossary-grid > div:last-child {
    position: relative;
}

.glossary-grid > div:last-child .glossary-alt-link {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 30;
}

.glossary-grid > div:last-child .glossary-alt-link:nth-of-type(1) {
    top: calc(100% + 4px);
}

.glossary-grid > div:last-child .glossary-alt-link:nth-of-type(2) {
    top: calc(200% + 8px);
}

.glossary-grid > div:last-child .glossary-alt-link:nth-of-type(3) {
    top: calc(300% + 12px);
}

#myList {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
    text-align: left;
    border: 1px dotted rgba(165, 165, 165, 0.35);
    border-top: none;
    background: var(--background-light);
    box-shadow: var(--shadow-unified);
    font-family: 'Open Sans', sans-serif;
}

#myList .list-group-item {
    margin: 0;
    padding: 7px 12px;
    border-bottom: 1px dotted rgba(165, 165, 165, 0.35);
    background: var(--background-light);
    color: var(--foreground);
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
}

#myList .gsearch,
#myList .gsearch:visited {
    color: var(--foreground) !important;
    text-decoration: none !important;
    outline: none;
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
}

#myList .gsearch:hover {
    color: var(--red-yellow) !important;
}

.gsearch-inline-link {
    color: var(--foreground) !important;
    text-decoration: none !important;
    outline: none;
}

#localSearchSimple {
    display: none;
}

#detail {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 25;
    margin-top: 0;
    max-height: 60vh;
    overflow-y: auto;
    text-align: left;
    color: var(--foreground);
    background: var(--background-light);
    box-shadow: var(--shadow-unified);
}

#detail table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: var(--background-light);
    color: var(--foreground);
}

#detail th,
#detail td {
    border: 1px dotted rgba(165, 165, 165, 0.45);
    padding: 9px 12px;
    color: var(--foreground);
    font-family: 'Open Sans', sans-serif;
}

.table-font-800 {
    font-weight: 700;
}

.table-font-100 {
    font-weight: 400;
}

.marktext {
    color: var(--red-yellow);
    font-weight: 700;
    background: transparent;
}

@media screen and (max-width: 768px) {
    body.glossary-page #bodyText {
        top: 27%;
        bottom: 10%;
        left: 18%;
        width: 64%;
        padding-bottom: 0 !important;
        overflow-y: auto;
    }

    .glossary-shell {
        width: 100%;
        grid-template-rows: 0.8fr auto 0.8fr auto 1fr;
    }

    .glossary-grid {
        grid-template-columns: minmax(0, 1fr) 44px;
    }
    

    .glossary-control {
        min-height: 34px;
        padding: 5px 8px;
    }

    #myList,
    #detail {
        top: calc(50% + 24px);
    }

    .flag-style {
        display: none !important;
    }
   
}
