:root {
    --bg-color: var(--light-light);
    --button-color: var(--light-light);
    --button-highlight: #ffffff;
    --border-color: var(--light-dark);
    --bg-mid: var(--light-mid);
    --text-color: var(--dark-mid);
    --lightest: var(--accent-lightest);
    --light: var(--accent-light);
    --dark: var(--accent-dark);
    --darkest: var(--accent-darkest);
    --accent-navbar: var(--accent-light);
    --accent-text: var(--accent-dark);
    --highlight: var(--highlight-light);
    --highlight-text: var(--text-color);
}

[data-theme="dark"] {
    --bg-color: var(--dark-dark);
    --border-color: var(--dark-light);
    --button-color: var(--dark-light);
    --button-highlight: color-mix(in srgb, var(--light-dark) 50%, var(--bg-color));
    --bg-mid: var(--dark-mid);
    --text-color: var(--light-mid);
    --accent-navbar: var(--accent-dark);
    --accent-text: var(--accent-light);
    --highlight: var(--bg-color);
    --highlight-text: var(--highlight-mid);
}

*, *::before, *::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: var(--font-header), sans-serif;
}

html, body {
    font-size: var(--font);
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-weight: 400;
}

body>div {
    padding: 1rem;
    padding-left: 2rem;
    padding-right: 2rem;
    width: 100%;
}

p, div.p, form, blockquote, pre, table, fieldset, ul, ol, dl {
    margin-bottom: 0.5rem;
}

div.p, p {
    padding-bottom: var(--gap);
    line-height: 1.5rem;
    text-align: justify;
    text-justify: distribute-all-lines;
    word-break: keep-all;
    text-justify: inter-word;
    break-inside: auto;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

.none {
    border: none;
    background: none;
    box-shadow: none;
    opacity: 0;
}

input, fieldset, select, textarea {
    border-color: var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    border: var(--border-width) solid var(--border-color);
}

input, input[type="text"], input[type="password"], textarea {
    border-radius: var(--radius);
    box-shadow: inset 0 1px 1px var(--bg-mid);
}

button, select, .calendar td {
    cursor: pointer;
    --btn-bg: var(--button-color);
    --btn-border: var(--border-color);
    --btn-border-bottom: var(--border-color);
    --btn-border-top: color-mix(in srgb, var(--btn-bg) 50%, #ffffff);
    color: var(--text-color);
    /* text-shadow: 0 1px 1px var(--btn-border-top); */
    background-color: var(--btn-bg);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border: var(--border-width) solid var(--btn-border);
    border-bottom-width: var(--border-bottom-width);
    border-left-width: 0px;
    border-bottom-color: var(--btn-border-bottom);
    box-shadow:
        0 2px 1px rgba(0, 0, 0, 0.075), inset 0 -2px 1px rgba(0, 0, 0, 0.075), inset 0 2px 1px color-mix(in srgb, var(--button-color) 50%, var(--button-highlight));
}

select {
    border-radius: var(--radius);
    border-left-width: var(--border-width);
}

button:hover, select:hover {
    --btn-bg: var(--button-color);
    --btn-border: var(--border-color);
    --btn-border-bottom: var(--border-color);
    --btn-border-top: color-mix(in srgb, var(--btn-bg) 50%, #ffffff);
    color: var(--text-color);
    text-shadow: none;
    background-color: var(--btn-bg);
    border: var(--border-width) solid var(--btn-border);
    border-bottom-width: var(--border-width);
    border-left-width: 0px;
    border-bottom-color: var(--btn-border-bottom);
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.075), inset 0 -1px 1px color-mix(in srgb, var(--btn-border) 50%, var(--btn-bg)), inset 0 1px 1px var(--btn-border-bottom);

}

select:hover {
    border-left-width: var(--border-width);
}

button:first-of-type {
    border-left-width: var(--border-width);
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

button:last-of-type {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    margin-right: 1rem;
}

button.nav {
    color: var(--light-light);
    --btn-bg: var(--accent);
    --btn-border: var(--accent-dark);
    --btn-border-bottom: var(--accent-darkest);
    --btn-border-top: var(--accent-light);
    text-shadow: 0 1px 1px var(--btn-border-bottom);
    background-color: var(--btn-bg);
    border: var(--border-width) solid var(--btn-border);
    border-bottom-width: var(--border-bottom-width);
    border-left-width: 0px;
    border-bottom-color: var(--btn-border-bottom);
    box-shadow:
        0 2px 1px rgba(0, 0, 0, 0.075), inset 0 -2px 1px color-mix(in srgb, var(--btn-border) 50%, var(--btn-bg)), inset 0 2px 1px var(--btn-border-top);
}

button.nav:first-of-type {
    border-left-width: var(--border-width);
}

button.nav:hover {
    --btn-bg: var(--accent);
    --btn-border: var(--accent-dark);
    --btn-border-bottom: var(--accent-darkest);
    --btn-border-top: var(--accent-light);
    /* text-shadow: 0 1px 1px var(--btn-border-bottom); */
    background-color: var(--btn-bg);
    border: var(--border-width) solid var(--btn-border);
    border-top-color: color-mix(in srgb, var(--btn-border) 80%, #000000);
    border-bottom-width: var(--border-width);
    border-left-width: 0px;
    border-bottom-color: var(--btn-border-bottom);
    box-shadow:
        0 0px 1px rgba(0, 0, 0, 0.075), inset 0 -1px 1px color-mix(in srgb, var(--btn-border) 50%, var(--btn-bg)), inset 0 1px 1px var(--btn-border-bottom);
}

button.nav:first-of-type:hover {
    border-left-width: var(--border-width);
}

td button, td select, th button, th select {
    box-shadow: none;
}

th div {
    align-items: center;
    gap: 5px;
    display: flex;
}

th.th_del {
    width: 3rem;
    padding: 0;
    margin: 0;
}

th.th_definition, th.th_comment {
    width: auto;
    max-width: 80%;
}

th.th_slno, th.th_hide, th.th_new, th.th_length, th.th_first {
    width: 6rem;
}

th.th_ipa, th.th_roman, th.th_script, th.th_headword, th.th_by, th.th_morph, th.th_task, th.th_split, th.th_gloss {
    width: 7rem;
}

th.th_bigram_mean, th.th_trigram_mean, th.th_bigram_worst, th.th_trigram_worst {
    width: 8rem;
}
th.th_bigram, th.th_trigram, th.th_bigram_score, th.th_trigram_score {
    width: 12rem;
}
th.th_ger, th.th_inf, th.th_adv, th.th_hab, th.th_real, th.th_irr, th.th_neg, th.th_Thang, th.th_Kingphu, th.th_spellings, th.th_tree {
    width: 6rem;
}

th.th_pos {
    width: 4rem;
}

th.th_edited {
    width: 7rem;
}

button.delete-btn, button.sort-btn, #clear_button {
    background: none;
    background-color: none;
    border: none;
    color: var(--text-color);
    box-shadow: none;
}

button.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px;
}

button.delete-btn:hover {
    color: var(--accent);
}

button#add-row-btn, button#nextPage, button#prevPage {
    color: var(--text-color);
}

.disabled, input:disabled, button:disabled {
    opacity: 0.5;
    cursor: default;
}

.muted {
    color: color-mix(in srgb, var(--bg-color) 50%, var(--text-color))
}

fieldset {
    padding: 0.5rem;
}

input:not([type="checkbox"]):not([type="radio"]), select, button {
    font-size: 1rem;
    line-height: 2rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    box-sizing: border-box;
    vertical-align: middle;
    appearance: none;
}

input:not([type="checkbox"]):not([type="radio"]), select {
    margin: 0 0.5rem 0 0;
}

input[type="checkbox"] {
    accent-color: var(--accent);
    padding: 0;
    margin: 0;
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
    margin-right: 0.5rem;
}

input[type="checkbox"], input[type="text"], textarea {
    cursor: pointer;
    border: var(--border-width) solid var(--border-color);
    border-top: var(--border-bottom) solid var(--border-color);
    border-bottom: var(--border-width) solid var(--border-color);
    background-color: var(--bg-color);
}

input[type="text"].quiet {
    background: var(--border-color);
}

select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="10" viewBox="0 0 10 6" width="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 0l5 6 5-6z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.65rem auto;
    padding-right: 1.75rem;
}

button.theme {
    float: right;
    margin-right: 1rem;
    border: none;
    background: none;
}

#footer, footer {
    background-color: var(--bg-mid);
    margin-top: auto;
}

footer img {
    height: 2rem;
    width: auto;
    margin-top: 1rem;
}

footer p {
    font-family: var(--font-header), sans-serif;
    margin: 0;
    padding: 0;
}

footer p:last-of-type {
    padding-bottom: 0.5rem;
}

.gapleft {
    margin-left: 1rem;
}

.gapright {
    margin-right: 1rem;
}

.center {
    text-align: center;
}

table {
    table-layout: fixed;
    width: 100%;
}

#table {
    width: 100%;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius);
    table-layout: fixed;
}

#table thead th {
    font-family: var(--font-header), sans-serif;
    font-weight: 600;
    text-align: left;
    padding: var(--gap)
}

#table thead th input {
    font-family: var(--font-header), sans-serif;
}

strong, b {
    font-weight: 600;
}

table#resultsfilter {
    width: auto;
}

table#resultsfilter p {
    margin: 0;
}

table#resultsfilter td {
    padding: 0;
    padding-right: var(--gap);
}

table#resultsfilter td input {
    border: none;
    border-bottom: var(--border-width) dashed var(--border-color);
    border-radius: 0;
    box-shadow: none;
}

#table thead input[type="text"] {
    border: none;
}

input#user {
    width: 7rem;
}

#table tbody tr:nth-child(odd) {
    background-color: var(--bg-mid);
}

#table td {
    border: none;
    border-top: var(--border-width) solid var(--border-color);
    padding: var(--gap)
}

#table td[contenteditable="true"] {
    user-select: text;
    pointer-events: auto;
}

.smallcaps {
    font-variant: small-caps
}

.small {
    font-size: 0.75rem;
}

hr {
    border: 0;
    border-top: var(--border-width) solid var(--border-color);
    margin-top: 1rem;
    margin-bottom: 1rem;
    min-width: 100%;
}

/* dictionary formatting */
div.cols {
    column-gap: 2rem;
}

div.cols h1 {
    padding-top: 1rem;
}

div.cols h1:first-of-type {
    padding-top: 0rem;
}

@media (min-width: 800px) {
    div.cols {
        columns: 2;
    }
}

@media (min-width: 1300px) {
    div.cols {
        columns: 3;
    }
}

pre, code {
    font-family: "Noto Sans Mono", monospace;
    font-size: 0.9rem;
    background-color: var(--bg-mid);
}

pre {
    padding: var(--gap);
    border-radius: var(--radius);
}

code, highlight {
    margin: 0 var(--gap);
    padding: 0 var(--gap);
    border-radius: var(--radius);
}

.not_editable {
    color: color-mix(in srgb, var(--bg-color) 50%, var(--text-color)) !important;
}

highlight {
    background-color: var(--highlight) !important;
    color: var(--highlight-text) !important;
}

input[type="text"].filter {
    color: var(--accent-text);
    font-weight: 600;
    width: 100%;
    flex: 1;
    min-width: 3rem;
    box-shadow: none;
}

.capitalise {
    text-transform: capitalize;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-header), sans-serif;
    margin-bottom: var(--gap);
    color: var(--accent-text)
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.4rem;
}

h4 {
    font-size: 1.2rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.8rem;
}

.script {
    font-family: "Noto Sans Myanmar";
}

article {
    line-height: 1.5rem;
    margin-bottom: 0.5rem !important;
}

article * {
    padding-right: var(--gap);
    font-family: var(--font), serif;
}

article em {
    padding-right: 0;
}

.accented {
    color: var(--accent-text);
}

nav .accented {
    color: var(--accent-dark);
}

.noshadow {
    box-shadow: none;
    background: none !important;
    color: var(--dark);
    text-shadow: none;
    cursor: pointer;
}

.noshadow:hover {
    box-shadow: none;
    background: none !important;
    color: var(--dark);
    text-shadow: none;
    cursor: pointer;
}

.hide {
    display: none !important;
}

#column-toggles label {
    margin-right: calc(2 * var(--gap));
}

@media (max-width: 600px) {

    html, body {
        padding: 0;
        margin: 0;
        font-size: var(--font-mobile);
    }

    button {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    nav {
        padding: 0.75rem !important;
    }

    body>div {
        margin: 0;
        padding: 0.75rem;
    }

    h1, h2, p, button, label, td, th {
        margin: 0.1rem;
        padding: 0.1rem;
    }

    h1, h2, h3 {
        font-size: 1.25rem;
    }

    h4, h5, h6 {
        font-size: 1rem;
    }

    h1, h2, h4 {
        font-weight: 600;
    }

    h3, h5, h6 {
        font-weight: 400;
    }

    th, td, tr {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        font-size: 1rem;
    }

    nav div {
        padding: 0rem;
    }

    nav div button {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    button {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .nophone {
        display: none;
    }
}

input.displayonly {
    background: none !important;
    background-image: none !important;
    border: none !important;
    cursor: default !important;
    box-shadow: none;
}

nav {
    /* padding: var(--gap); */
    margin: calc(0 - var(--gap));
    padding: 1rem;
    padding-left: 2rem;
    padding-right: 2rem;
    width: 100%;
    background-color: var(--nav-bg-toggle);
    /* background-image: linear-gradient(45deg, var(--accent) 0%, color-mix(in srgb, var(--accent-navbar) 50%, var(--accent)) 100%); */
}

nav * {
    font-family: var(--font-header), sans-serif !important;
}

.swatches {
    display: inline-block;
}

.swatches div {
    display: inline-block;
    border-radius: var(--radius);
    width: 1.5rem;
    margin-right: var(--gap)
}

.padright {
    padding-right: 0.5rem !important;
}

.padleft {
    padding-left: 0.5rem !important;
}