:root {
  /* COLORS */
  /* bad contrast
  --palm-green: #527c3a;
  --discreet: #808080;
  */
  --dark-green: #25331a;
  --pale-green: #bcd7ae;
  --palm-green: #476C31;
  --gold: #ffde28;
  --dark-gold: #d2b400;

  --main-bg-color: white;
  --main-fg-color: black;
  --pop-bg-color: var(--pale-green);
  --pop-fg-color: var(--dark-green);
  --pop-hover-bg-color: var(--dark-green);
  --pop-hover-fg-color: white;
  --link-color: #004d00;
  --nav-link-color: var(--dark-green);
  --hint-bg-color: #829e82;
  --required: red;
  --link-visited: #421;
  --dec: #dec;
  --help-color: #008000;
  --discreet: #757575;
  --private: var(--pale-green);
  --badge-300: #ffcc33;
  --badge-200: #c0c0c0;
  --badge-100: #cd7f32;
  --wals: #d22;

  /* WIDTHS */
  --max-content-width: 120ch;
}

* {
    font-family: sans-serif;
    line-height: 1.5em;
}
a:visited {
    color: var(--link-visited);
}
html {
    padding: 1ch;
}
body {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--pop-fg-color);
    max-width: var(--max-content-width);
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 0;
}
header, footer {
    padding: 1ch;
    background: url(/static/img/background.jpg) no-repeat;
    background-size: 24ch; 100%;
    background-color: var(--pop-bg-color);
    color: var(--pop-fg-color);
}
header {
    flex-direction: column;
    display: flex;
    justify-content: space-around;
}
header * {
    flex-direction: row;
    align-items: center;
}
header > nav {
    text-align: center;
    background-color: var(--palm-green);
    color: var(--gold);
    /* border: 1px solid #25331a;*/
    border: 1px solid var(--dark-gold);
    padding: 0.5ch;
}
header > nav a,  header > nav a:visited {
    color: var(--gold);
}
header > div {
    display: flex;
    gap: 0.5ch;
    justify-content: space-between;
}
h1:first-child, h2:first-child {
    margin-top: 0;
}
[role="doc-subtitle"] {
    font-weight: bold;
    font-size: 0.9em;
    margin-top: 1.5em;
}
[role="doc-subtitle"] + h2, [role="doc-subtitle"] + h3 {
    margin-top: 0;
    margin-bottom: 1ch;
}
section > * {
    margin-top: 0;
}
#profile {
    align-self: flex-end;
    padding-bottom: 1ch;
}
footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1em;
    justify-content: flex-end;
}
footer > div {
    display: flex;
    flex-direction: column;
    gap: 1ch;
}

#site {
    display: flex;
    margin-bottom: 0;
    justify-content: space-between;
    margin-top: 0.67em;
    font-size: 2em;
    font-weight: 700;
    line-height: 1.5em;
}

#site a, #site a:visited {
    color: var(--pop-fg-color);
    border-bottom: none;
}
#site a:hover {
    background-color: var(--pop-bg-color);
}
#site #logo, #site #logo:hover {
    background-color: transparent;
    color: var(--gold);
    padding-right: 1em;
    padding-left: 1em;
}
#site-title {
    margin: auto;
    margin-left: 2.5em;
}
nav a {
    padding: 1ch;
    text-decoration: none;
    border-bottom: 0;
}
nav a:hover, #profile a:hover {
    background-color: var(--pop-hover-bg-color);
    color: var(--main-bg-color);
}
nav .me {
    color: var(--gold);
    background: var(--pop-fg-color);
    text-decoration: none;
}
nav {
    background: var(--pop-bg-color);
    text-align: right;
}
li + li {
    margin-top: 1ch;
}
li > hr {
    margin: 0;
}
*:last-child {
    margin-bottom: 0;
}

.message, .message * {
    padding: 1ch;
    font-weight: bold;
    border: 3px solid var(--gold);
}
.help {
    font-size: 0.7em;
    color: var(--help-color);
    max-width: 60em;
}
.private {
    box-sizing: border-box;
    margin: 0 2em 2em 0;
    outline: 2px solid var(--pop-bg-color);
}
/* pms */
.pm, .comment {
    border: 1px solid var(--dark-gold);
    padding: 1ch;
    max-width: 60em;
}
.pm-footer, .comment-footer {
    font-weight: bold;
}
.pm + .pm {
    margin-top: 1ch;
}

/* end pms */

.pagination, .pagination * {
    box-sizing: border-box;
}

.pagination + *, * + .pagination {
    margin-top: 1ch;
}

.pagination {
    grid-template-columns: repeat(auto-fill, minmax(2em, 1fr));
    display: grid;
    gap: 0.5ex;
}
.pagination > * {
    box-sizing: border-box;
    text-align: center;
    display: block;
    align-items: center;
    width: 2em;
    height: 2em;
    padding: 0;
    margin: auto;
}

.pagination a {
    font-weight: 700;
    font-size: 1.1em;
    display: inline-block;
    padding-top: 0.3ch;
    height: 100%;
    width: 100%;
    border-bottom: none;
}
.pagination .selected a {
    color: var(--gold);
    background-color: var(--pop-fg-color);
}

/* forms */

input, textarea {
    border-style: inset;
}
input[type=checkbox], input[type=radio] {
    border-style: inset;
}
input[type=button], input[type=submit], button, select {
    border-style: outset;
}

#profile-form {
    display: flex;
    flex-direction: column;
    gap: 1ex;
}
#profile-form div {
    display: flex;
    flex-direction: column;
    gap: 0.5ex;
}
#profile-form label {
    font-weight: bold;
}
#profile-form input[type="checkbox"] {
    border: 1px solid red;
}

/* end forms */

p, dt, dd {
    max-width: 80ch;
}
main {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
main > section:first-child {
    padding: 2em;
}
a, .link {
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--hint-bg-color);
}
a img {border: none}

dd table {
    border: 1px solid var(--dec);
}
dd + dt {
    margin-top: 1ch;
}
li, td, th {
    padding: 0.25ch;
}
a:hover, .link:hover {
    background-color: var(--gold);
}
a img {border: none}

dd table {
    border: 1px solid var(--dec);
}
ul {
    padding-left: 2ch;
}

tr, td, th {
    text-align: left;
    vertical-align: top;
    margin: 0;
}

.longlist > tr:nth-child(odd), .longlist > li:nth-child(odd), .longlist dt:nth-of-type(odd) {
    background-color: var(--pale-green);
}
.longlist {
    list-style-position: inside;
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
}
.featurelist li {
    font-size: 1.2em;
}
.integer td, .integer {
    text-align: right;
}
.langname {
    width: 10em;
}
.plaintext {
    width: 100%;
    word-break: break-word;
    white-space: pre-wrap;
}

.icon {vertical-align: sub}

/* used in template tags */
.wals a {
    font-family: serif;
    font-size: xx-small;
    font-weight: bold;
    color: var(--wals);
    text-decoration: none;
}

/* language tag cloud */
aside.cloud {
    margin: 2rem;
    min-width: 24ch;
    max-width: 28ch;
    padding: 1ch;
    text-align: justify;
}
.box {
    border: 1px solid var(--dark-gold);
    background-color: var(--main-bg-color);
    display: block;
}
.cloud {
    white-space: collapse;
}
.cloud a {
    text-decoration: none;
    border: none;
    padding: 0;
}
.cloud a:hover {
    background-color: var(--gold);
    color: var(--pop-fg-color);
}
.tagsize1 a, .tagsize2 a { font-weight: normal; color: var(--discreet) }
.tagsize3 a { font-weight: normal }
.tagsize6 a, .tagsize7 a { color: var(--pop-fg-color) }
.tagsize1 { font-size: xx-small }
.tagsize2 { font-size: x-small }
.tagsize3 { font-size: small }
.tagsize4 { font-size: medium }
.tagsize5 { font-size: large }
.tagsize6 { font-size: x-large }
.tagsize7 { font-size: xx-large; font-weight: 900 }

nav ul {
    list-style-type: none;
}

/* main content */
#content {
    flex: 3;
}

/* submenu */
#submenu {
    flex: none;
    min-width: 13em;
}
#submenu nav {
    padding: 1ch 0 1.5ch 1ch;
    margin: 0;
}
#submenu ul {
    padding: 0;
    margin: 0;
}
#submenu li {
    margin-right: 1ch;
}
#submenu li:has(a) {
    margin-right: 0;
}
#submenu li h4, #submenu li input {
    margin-right: 1ch;
    margin-top: 0;
    margin-bottom: 0;
}
#submenu a:before {
    content: '» ';
}
#submenu select {
    width: 13em;
}

/* forms */
.required {
    color: var(--required);
}
/* logout form */
#logout-form {
    display: inline;
}
#logout-form button {
  padding: 0;
  background-color: transparent;
  font-size: 90%;
}
#logout-form .link:hover {
    background-color: var(--gold);
}

/* other */

.namelist {
    list-style-type: none;
    padding-left: 0;
    column-width: 15em;
    column-count: 10;
    column-gap: 1em;
}

/* badges */
.b300 {
    color: var(--badge-300);
}
.b200 {
    color: var(--badge-200);
}
.b100 {
    color: var(--badge-100);
}
.badge {
    display: inline-block;
    box-sizing: border-box;
    border: 1px solid var(--pop-fg-color);
    background-color: var(--pop-fg-color);
    margin: 2px;
    padding: 0.7ch;
}
.badge a, .badge a:visited {
    box-sizing: border-box;
    font-weight: bold;
    font-size: 1em;
    background-color: var(--pop-fg-color);
    border-bottom: 1px dotted var(--gold);
    color: var(--gold);
}
.badge:hover, .badge:hover a {
    background-color: var(--main-bg-color);
    color: var(--nav-link-color);
}
dl.badge-list {
    display: grid;
    grid-template-columns: max-content auto;
    gap: 0.5ch 0;
    align-items: baseline;
}
.badge-list dt {
    grid-column-start: 1;
}
.badge-list dd {
    grid-column-start: 2;
}
.badge-freq {
    font-weight: bold;
}

.messages {
    border: 3px solid #0f0;
    background: var(--main-bg-color);
}

.system-message, .error {
    box-sizing: border-box;
    padding: 1ex;
    border: 3px dashed #000;
    background: var(--gold);
    margin: 0;
    width: 100%;
}

/* tables used as tables */
table.statistics td:first-child {
    font-weight: bold;
    text-align: right;
}
table.statistics td:nth-child(2) {
    font-weight: bold;
}

@media (max-width: var(--max-content-width)) {
    body {
        margin: 1ch;
    }
}
@media (max-width: 54em) {
    html {
        padding: 0;
    }
    body {
        border: none;
        margin: 0;
        padding: 0;
    }
    main > section:first-child {
        padding: 1rem;
    }
    h1 #site-title {
        font-size: 1rem;
    }
    #profile {
        padding-right: 1ch;
        gap: 1ch;
    }
    footer {
        background-image: none;
        flex-direction: column;
    }
    header, footer {
        padding: 0;
    }
    footer > div:first-child {
        margin-right: 0.5ch;
    }
}

@media (max-width: 42em) {
    html {
        font-size: small;
        box-sizing: border-box;
    }
    main {
        flex-direction: column;
    }
    main > section:first-child {
        padding: 0.5ch;
    }
    .separator {display: none}
    header > nav {
        display: flex;
        justify-content: center;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }
    header > nav a {
        padding: 0.5ch;
        background-color: inherit;
    }
    nav a {
        padding: 0.5ch;
        background-color: var(--pop-bg-color);
    }
}
@media (max-width: 32em) {
    h1 #site-title {
        display: none;
    }
    dd {
        padding-left: 0;
        margin-left: 0;
    }
    .namelist {
        column-width: 10em;
    }
    #techfooter {
        display: none;
    }
}

/* smartphones
@media (max-width: 24em) {
}
 */
