body {
    /*
    font-family: 'Brill', serif;
    color: black;
    max-width: 800px;
    margin: 0 auto;
    padding-top: 20px;
    font-size: 1.5em;
    line-height: 1;
    */
    hyphens: auto;
    display: flex;
    flex-direction: row-reverse;
    padding: 0;
    margin: 0;
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    font-variant-ligatures: none;
}

#recordcontainer, .recordcontainer {
    overflow-x: hidden;
    overflow-y: scroll;
    width: 100%;
    padding-left: 0;
    flex: 1 0 50%;
    position: relative;
    margin-left: auto;
    margin-right: auto;
}

.record.thin {
    position: relative;
    /*padding-left: 12.5%;*/
    /*width: 120%;*/
    padding-left: 3.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.record.fat {
    position: relative;
    /*padding-left: 12.5%;
    width: 87.5%;*/
    padding-left: 3.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.record.thin h1 {
    /*max-width: 55%;*/
    /*max-width: 550px;
    width: 87.5%;*/
}
.teitext {
    width: 87.5%;
    font-size: 1.4rem;
}
.record.thin .teitext {
    width: unset;
    max-width: 800px;
    padding-right: 2rem;
}
.teitext p:not(.diplo) {
    max-width: 70ch;
}

#viewer {
    position: relative;
    flex: calc(50% - 15px);
    min-width: (50% - 15px);
    max-width: 100%;
    height: 100vh;
    border: 0;
    background: rgb(34,34,48);
}

#viewer .fullscreen {
    position: relative;
    height: 100%;
}

#topbar {
    position: sticky;
    height: 0;
    top: 1em;
    left: 1em;
    display: flex;
    width: 100%;
    flex-direction: row;
}

#buttoncontainer {
    position: absolute;
    top: 0;
    left: -2.8em;
    font-size: 1em;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#buttoncontainer > div {
    background: rgba(255,255,248,0.6);
    /*box-shadow: -2px 2px 1px 2px rgba(0,0,0,0.2);*/
    box-shadow: -2px 3px 6px rgba(0,0,0,0.4);
    border: 1px solid transparent;
    border-radius: 0.2rem;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

#buttoncontainer > div:active {
    box-shadow: unset;
    position: relative;
    left: -2px;
    top: 2px;
}

#buttoncontainer > div:active {
    background: #ff9900;
    border: 1px solid #ff9900;
}

@media (hover: hover) and (pointer: fine) {
    #buttoncontainer > div:hover {
        background: #ff9900;
        border: 1px solid #ff9900;
    }
}

#transbutton {
    display: none;
    padding: 0.1rem 0.5rem 0.1rem 0.5rem;
    height: 36px;
    width: 34px;
    box-sizing: border-box;
    flex-shrink: 0;
    font-size: 1.5rem;
    cursor: default;
}

@media (max-width: 800px) {
    html {
        font-size: 12px;
    }
    #topbar {
        z-index: 3;
    }
    #buttoncontainer {
        font-size: 1.17rem;
        left: 0;
    }
    .record.thin {
        padding-left: 1rem;
    }
    .line-view-icon {
        margin-right: 0.8rem;
    }
}

#transbutton:lang(en) {
    padding: 0.2em 0 0 0.43em;
    font-size: 1.5em;
}

#transbutton:lang(ta-Taml) {
    padding: 0.2em 0 0 0.4em;
    font-size: 1em;
}

#transbutton:lang(sa-Gran) {
    padding: 0.5em 0 0 0.5em;
    font-size: 1.2em;
    line-height: 1;
}

#transbutton:lang(sa-Deva) {
    padding: 0.1em 0 0 0.4em;
    font-size: 1.4em;
}

#transbutton:lang(sa-Beng) {
    padding: 0.1em 0 0 0.4em;
    font-size: 1.4em;
}

#transbutton:lang(sa-Telu) {
    padding: 0.2em 0 0 0.3em;
    font-size: 1.6em;
    line-height: 1;
}

#transbutton:lang(sa-Nand) {
    font-size: 1.2em;
    padding: 0.3em 0 0 0.5em;
}

#transbutton:lang(sa-Newa) {
    font-size: 1.3em;
    padding: 0 0 0 0.5em;
}

#transbutton:lang(sa-Shrd) {
    padding: 0.2em 0 0 0.45em;
    font-size: 1.4em;
}

#transbutton:lang(sa-Mlym) {
    padding: 0.4em 0 0 0.4em;
    font-size: 1.1em;
}

#transbutton:lang(sa-Tibt) {
    padding: 0.3em 0 0 0.35em;
    line-height: 1.5em;
}
#transbutton:hover {
    background: #ff9900;
    border: 1px solid #ff9900;
}

.line-view-icon {
    margin-right: 0.5rem;
    cursor: default;
}

.line-view-icon:hover svg {
    background: #ff9900;
}

section.mspart {
    padding-left: 2em;
    background: rgba(230,230,230,0.5);
}

section > div.lg {
    margin-left: 1rem;
}

section > table {
    /*max-width: 55%;*/
    border-spacing: 0 1rem;
}

th {
    vertical-align: baseline;
    font-size: 1rem;
    line-height: 2rem;
    padding-right: 1.5rem;
    hyphens: none;
    width: min-content;
}

th.left-align {
    text-align: left;
    writing-mode: horizontal-tb;
    position: initial;
    padding-top: 0;
}

thead th {
    font-size: 1.4rem;
}

td {
    font-size: 1.4rem;
    line-height: 140%;
    word-break: break-word;
}

td p:first-child {
    margin-top: 0;
}

ul ul {
    margin-left: 1rem;
}

div.para {width:100%;
          text-align: justify;
          padding: 1% 0 2% 0;
}

/*
div.devanagari {font-size: 1.1em !important;
              line-height: 150%;
}

span.devanagari {font-size: 1em !important;
}

p.devanagari {font-size: 1.2em !important;
}

div.malayalam {font-size: 1.2em !important;
}
span.malayalam {font-size: 1.1em !important;
}
p.malayalam {font-size: 1.3em !important;
}

div.telugu {font-size: 1.2em !important;
          line-height: 150%;
          word-spacing: 103%;
}
span.telugu {font-size: 1.1em !important;
             line-height: 120%;
}
p.telugu {font-size: 1.3em !important;
}

.balinese {font-size: 1.1em !important;
           line-height: 200%;
}
*/
span.spacer {display: none;
             white-space: pre-wrap; /* when the highlight function splits a spacer node, sometimes the whitespace gets collapsed */
}
/*
:lang(sa) {
    font-family: Brill, PedanticDevanagari, PedanticMalayalam, PedanticTelugu, Tantular Bali, serif;
}
*/
/*
div.teitext {
    border: 0;
    padding: 0 4% 0 0;
    vertical-align:top;
    font-size: 1.1em;
    line-height:135%;
    top: 2em;
}
*/
.texttitle td {
    font-size: 2rem;
}

#recordcontainer h2, #recordcontainer h3, #recordcontainer h4, .editionStmt,
section > p, section > div.lg, section > table {
    max-width: 800px;
    width: 87.5%;
}

.record section > table.texttitle {
    max-width: 100%;
    width: 100%;
    top: 0;
    padding-bottom: 1rem;
    position: sticky;
    z-index: 2;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    background: linear-gradient(rgb(255,255,248) 60%, rgba(255,255,255,0));
}

.record.fat section > div.para.wide, .record.fat section > div.lg.wide {
    max-width: 100%;
    width: 87.5%;
    padding-left: 0;
    margin-left: 1rem;
}
/*
.record.thin h2, .record.thin h3, .record.thin h4, .record.thin .editionStmt,
.record.thin section > p, .record.thin section > div.lg, .record.thin section > table {
    max-width: 800px;
    width: 87.5%;
}
*/
span.type {
    padding-right: 1em;
    font-variant: small-caps;
}
/*
.teitext {
    width: inherit;
}
*/
.off {
    display: none;
}

.mirador-osd-info {
    padding-bottom: 8px !important;
}

#tooltip {
    display: block;
    position: fixed;
    background: rgba(17,17,17,0.8);
    border-radius: 4px;
    color: #fff;
    font-style: normal;
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: normal;
    line-height: normal;
    vertical-align: middle;
    padding: 0.5em 1em;
    margin-bottom: 11px;
    max-width: 300px;
    z-index: 10;
}

#tooltip hr {
    border: 0;
    margin-bottom: 3px;
    margin-top: 3px;
    height: 1px;
    background-image: linear-gradient(to right, rgba(255,255,255,0),rgba(255,255,255,0.75),rgba(255,255,255,0));
}

blockquote {
    margin-top: 0;
}

p blockquote {
    margin-top: 0.5em;
}

.blockquote {
    display: block;
    margin: 0.5em;
}

a.uri {
    word-break: break-word;
}

hr {
    width: 87.5%;
}
#togglers {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#togglers > div {
    background-color: #ddd;
    color: rgba(1,1,1,0.4);
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: et-book;
    cursor: pointer;
    padding: 0 1px 0 0;
    -webkit-text-stroke: 1px rgba(1,1,1,0.2);
    text-stroke: 1px rgba(1,1,1,0.2);
    box-shadow: -2px 3px 6px rgba(0,0,0,0.4);
}
#togglers > div.horizontal {
    box-shadow: 1px -2px 2px 1px rgba(0,0,0,0.45);
    padding: 0 0 1px 0;
}

#viewertoggle.horizontal {
    border-radius: 0 0 0 0.2rem;
}
#recordtoggle.horizontal {
    border-radius: 0 0 0.2rem 0;
}
#rotator.horizontal {
    border-radius: 0 0 0.2rem 0.2rem;
    margin: 0 0.2rem 0 0.2rem;
}

.toggle {
    display: flex;
    flex-grow: 1;
    border-radius: 0 0.2rem 0.2rem 0;
}
#rotator {
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    border-radius: 0 0.2rem 0.2rem 0;
    padding: 0.2rem;
}
#togglers > div:hover {
    color: #ddd;
    background: #ff9900;
    text-shadow: -2px 2px 1px rgba(0,0,0,0.3);
    -webkit-text-stroke: unset;
    text-stroke: unset;
}

#togglers > div.horizontal:hover {
    color: #ddd;
    background: #ff9900;
    text-shadow: 2px -2px 1px rgba(0,0,0,0.3);
    -webkit-text-stroke: unset;
    text-stroke: unset;
}

.record.thin hr {
    width: unset;
    margin-right: 2rem;
    max-width: 800px;
}

@media (max-width: 1280px) {
    .teitext {
        width: unset;
        margin-right: 1rem;
    }
    hr {
        width: auto;
        margin-right: 1rem;
    }
}

@media (max-width: 800px) {
    th {
        writing-mode: vertical-lr;
        position: sticky;
        top: 0;
        padding-top: 1rem;
        background: rgb(255,255,248);
    }
}

@media (max-width: 600px) {
    body {
        flex-direction: column;
    }
    #buttoncontainer {
        flex-direction: row;
    }
    /*
    .record.thin .teitext {
        width: 95%;
    }
    */
    .record.thin, .record.fat {
        padding-left: 1rem;
    }
    ul {
        list-style-type: none;
    }
    #togglers {
        writing-mode: vertical-lr;
        height: auto;
        transform: rotate(180deg);
        height: auto;
        width: 100vw;
    }
    #rotator {  
        display: none !important;
    }
}
