nav {
  position: sticky;
  top: 5px;
  background-color: var(--background-color-highlighted);
  padding: 5px;
  font-size: 150%;
  border-radius: 8px;
  border: 1px solid;
  overflow: auto;
}

nav>a,
nav ul,
nav ul li,
nav ul li a {
  display: inline;
  color: var(--text-color) !important;
  text-decoration: none;
  border-radius: 8px;
  padding: 2px;
}

nav ul li {
  text-wrap: nowrap;
}

#name {
  border-radius: 0px;
  border-right: 1px solid;
  padding-right: 8px;
}

.tabonly {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tabonly:focus {
  position: static;
  width: auto;
  height: auto;
}

:root {
  color-scheme: light dark;
  background-color: var(--background-color);
  color: var(--text-color);
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;

  --background-color: light-dark(#e0e0e8, #101020);
  --background-color-highlighted: light-dark(#d0d0d8, #202030);
  --text-color: contrast-color(var(--background-color));
  --primary-color: highlight;
  --primary-color-text: contrast-color(var(--primary-color));
}

.currpage {
  background-color: var(--primary-color);
  color: var(--primary-color-text);
}

@media only screen and (max-width: 768px) {
  nav {
    position: static;
  }

  nav>a,
  nav ul,
  nav ul li,
  nav ul li a {
    display: block;
  }

  nav ul li {
    text-wrap: wrap;
  }

  #name {
    border-radius: 0px;
    border-right: 0px;
    padding-right: 0px;
    border-bottom: 1px solid;
    padding-bottom: 8px;
  }

  .matrix-list aside img {
    display: none;
  }

  .matrix-list aside div::before {
    content: "";
    background: no-repeat url("info.svg");
    background-size: 1em 1em;
    width: 1em;
    height: 1em;
    display: block;
    float: left;
    margin-right: 0.5em;
  }

  .contrast {
    display: block;
  }
}

table,
th,
td {
  border: 1px solid;
  border-collapse: collapse;
  background-color: var(--background-color-highlighted);
}

table {
  margin: auto auto;
}

pre code {
  border: 1px solid;
  border-radius: 8px;
  padding: 10px;
  background-color: var(--background-color-highlighted);
}

pre code::before {
  content: "> ";
}

.speculation {
  background-image: url("warining.svg");
  --speculation-background-color: #800000;
  background-color: var(--speculation-background-color);
  color: contrast-color(var(--speculation-background-color));
}

.speculation:hover {
  background-image: none;
}

.speculation>*:first-child {
  font-style: italic;
}

.speculation>*:last-child {
  font-style: italic;
}

video {
  width: 100%;
}

.matrix-list img {
  width: 50%;
  float: right;
}

.matrix-list li {
  display: block;
  flex-direction: column;
  background-color: var(--background-color-highlighted);
  margin-top: 3px;
  margin-bottom: 3px;
  min-height: 3em;
  padding: 5px 10px;
}

.matrix-list div {
  overflow: auto;
}

.account-done {
  width: 100%;
}

.sub-matrix-list li {
  border-left: 3px solid var(--background-color);
  border-bottom: 3px solid var(--background-color);
  margin-top: 0px;
  margin-bottom: 0px;
}

.sub-matrix-list li:first-child {
  border-top: 3px solid var(--background-color);
}

.matrix-list aside {
  --aside-background-color: light-dark(lch(from var(--primary-color) 80 100% h), lch(from var(--primary-color) 20 100% h));
  background-color: var(--aside-background-color);
  color: contrast-color(var(--aside-background-color));
  overflow: auto;
  margin: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
  font: 0.8em sans-serif;
}

.matrix-list aside img {
  width: 64px;
  height: 64px;
  float: left;
}

@media only screen and (max-width: 1600px) {
  .matrix-list img {
    width: 100%;
    float: none;
  }
}

form {
  border: 1px solid var(--text-color);
}

fieldset {
  border: 1px solid var(--text-color);
}

input[type="text"] {
  width: 100%;
}

textarea {
  width: 100%;
  height: 15em;
  resize: vertical;
}

a {
  color: light-dark(lch(from var(--primary-color) 10 75% h), lch(from var(--primary-color) 90 75% h));
}

a:visited {
  color: light-dark(lch(from var(--primary-color) 5 10% h), lch(from var(--primary-color) 95 10% h));
}

.contrast {
  border: none;
  background: none;
  float: right;
  height: 2.5em;
  width: 2.5em;
}

.contrast img {
  width: 100%;
}

/**/
/*   display: inline-block; */
/* .icon::before { */
/*   width: 2em; */
/*   height: 2em; */
/*   margin-right: 1em; */
/*   content: ""; */
/*   background-size: 100%; */
/* } */
/**/
/* .nextcloud::before { */
/*   background: center / contain no-repeat url("https://nextcloud.com/c/uploads/2023/02/logo_nextcloud_white.svg"); */
/* } */
/**/
/* .matrix::before { */
/**/
/* } */
