*,
::after,
::before {
  box-sizing: border-box;
}

.sr-only {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
}

.sr-only-focusable {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  -webkit-clip-path: none;
  clip-path: none;
}

.invis_button {
  background-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

#skip a {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#skip a:focus {
  position: static;
  width: auto;
  height: auto;
}

.hidden {
  display: none;
  opacity: 0;
}

.braille-input {
  font-size: 200%;
  border: none;
  resize: none;
  padding: 5px;
  /* pointer-events: none; */
}

.btn {
  display: inline-block;
  font-weight: 400;
  color: #212529;
  text-align: center;
  vertical-align: middle;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-link {
  font-weight: 400;
  color: #007bff;
  background-color: transparent;
}

.btn-link.active {
  color: #0056b3;
  border: 2px solid #0056b3;
}

/* Menu stuff */

.maidr-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1072;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 1;
  transition: opacity 0.15s linear;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
}

@media (min-width: 576px) {
  .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
  }
}

@media (min-width: 900px) {
  .modal-dialog {
    max-width: 800px;
    margin: 1.75rem auto;
  }
}

.close:not(:disabled):not(.disabled) {
  cursor: pointer;
}

.modal-header .close {
  padding: 1rem;
  margin: -1rem -1rem -1rem auto;
  font-size: 2rem;
}

button.close {
  padding: 0;
  background-color: transparent;
  border: 0;
  -webkit-appearance: none;
}

.close {
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.5;
}

button,
select {
  text-transform: none;
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
}

h5.modal-title {
  font-size: 1.25rem;
  border-bottom: 1px solid #dee2e6;
}

h4.modal-title {
  font-size: 1.5rem;
}

.modal-content {
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  outline: 0;
}

.modal-header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
  -ms-flex-align: start;
  align-items: flex-start;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
  border-top-left-radius: 0.3rem;
  border-top-right-radius: 0.3rem;
}

.modal-body {
  position: relative;
  -webkit-box-flex: 1;
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  padding: 1rem;
}

.modal-footer {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: end;
  -ms-flex-pack: end;
  justify-content: flex-end;
  padding: 1rem;
  border-top: 1px solid #e9ecef;
}

/* custom modal stuff */

.modal button {
  display: inline-block;
  text-align: center;
  vertical-align: middle;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.375rem 0.75rem;
  margin: 0.125rem;
  font-weight: bold;
}

.modal-backdrop {
  z-index: 1071;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #000;
  opacity: 0.5;
}

/* table stuff */

table {
  width: 100%;
  max-width: 100%;
  margin-bottom: 1rem;
  background-color: transparent;
  border-collapse: collapse;
}

table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid #dee2e6;
}

table td,
table th {
  padding: 0.75rem;
  vertical-align: top;
}

/* form fields */

label {
  margin: 0 1.5rem;
  vertical-align: middle;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: inline-block;
  margin-bottom: 0.5rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

button,
input,
optgroup,
select,
textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* LLM stuff */

#chatLLM_chat_history_wrapper {
  position: relative;
  padding: 0.5rem;
  background-color: #fff;
}

#chatLLM_chat_history {
  padding: 0.5rem;
  padding-bottom: 4rem;
  border-radius: 0.25rem;
  border: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  align-items: column;
  justify-content: center;
}

.chatLLM_message_self,
.chatLLM_message_other {
  padding: 0.5rem 1.5rem;
  border-radius: 1.5rem;
  margin: 0.5rem;
  max-width: 70%;
  word-wrap: break-word;
}

.chatLLM_message_self {
  align-self: flex-end;
}

.chatLLM_message_other {
  align-self: flex-start;
}

.LLM_suggestions > p > button,
#chatLLM_copy_all {
  font-weight: normal;
  border-radius: 0.5rem;
  border: none;
}

.LLM_suggestions > p {
  display: inline-block;
}

/* align this to the lower right of the chat history */

#chatLLM_copy_all_wrapper {
  position: absolute;
  bottom: -0.5rem;
  right: 1.5rem;
  margin: 0.5rem;
}

.chatLLM_message_copy_button {
  font-weight: normal;
}

#menu .modal-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* goto context menu */

#context-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 300px;
  z-index: 1000;
}

.menu-container {
  display: flex;
  flex-direction: column;
  padding: 10px;
}

#menu-search {
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  font-size: 16px;
}

#menu-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

#menu-items li {
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
}

#menu-items li:focus {
  outline: none;
  background: #007bff;
  color: #fff;
}

#menu-items li:hover {
  background: #007bff;
  color: #fff;
}