:root {
  --bs-link-color: #337ab7;
  --bs-link-hover-color: #23527c;
  --bs-dark-rgb: 86, 105, 143
}

a.pseudo {
  position: relative;
  text-decoration: none;
  cursor: pointer;
}

a.pseudo:after {
  content: '';
  position: absolute;
  border-bottom: 1px dashed currentColor;
  bottom: 0;
  left: 2px;
  right: 2px;
}

.btn-primary {
  --bs-btn-bg: #337ab7;
  --bs-btn-border-color: #337ab7;
  --bs-btn-hover-bg: #23527c;
  --bs-btn-hover-border-color: #23527c;
}

.btn-success {
  --bs-btn-bg: #15cd41;
  --bs-btn-border-color: #15cd41;
}

.navbar .btn-logout {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.navbar .btn-logout:hover {
  color: rgba(255, 255, 255, 0.75);
}

.tab-content .list-group-item:first-child {
  border-top: none;
  border-radius: 0;
}

.events-list .list-group-item-heading a {
  text-decoration: none;
}

.events-list .list-group-item-heading :not(.btn-outline-secondary) .bi {
  color: white;
}

.event-buttons-row {
  padding: 0.5em 0;
}

.event-buttons-row .glyphicon {
  font-size: 20px;
  display: flex;
  align-items: center;
}

.event-messages {padding-top: 1em}

.comment-textarea-wrapper {
  position: relative;
}

.comment-textarea-wrapper .form-check {
  position: absolute;
  top: 0.3em;
  right: 5px;
}

.markdown-preview {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 2rem));
  max-height: min(760px, calc(100vh - 2rem));
  margin: 0;
  padding: 0;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: .25rem;
  background: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #212529);
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
  transform: translate(-50%, -50%);
  z-index: 1080;
}

.markdown-preview[open] {
  display: flex;
  flex-direction: column;
}

.markdown-preview::backdrop {
  background: rgba(0, 0, 0, .35);
}

.markdown-preview__header {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  background: var(--bs-light, #f8f9fa);
}

.markdown-preview__body {
  max-height: calc(100vh - 12rem);
  padding: .75rem;
  overflow: auto;
  overflow-wrap: break-word;
}

.markdown-preview__body > :last-child {
  margin-bottom: 0;
}

.markdown-preview__footer {
  display: flex;
  justify-content: flex-end;
  padding: .75rem;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.btn-xs {
  padding: .25rem .5rem;
  font-size: .65em;
  border-radius: .25rem;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
  position: relative;
  top: 1px;
  display: inline-block;
  /*noinspection CssNoGenericFontName*/
  font-family: 'bootstrap-icons';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  padding-left: 5px;
}

a.asc:after {
  content: "\F571";
}

a.desc:after {
  content: "\F570";
}

.sort-numerical a.asc:after {
  content: "\e153";
}

.sort-numerical a.desc:after {
  content: "\e154";
}

.sort-ordinal a.asc:after {
  content: "\e155";
}

.sort-ordinal a.desc:after {
  content: "\e156";
}

.user-message {
  overflow-wrap: anywhere;
}

/* Keep long names, URLs and attachments within the content column. */
.wrap > .container {
  overflow-wrap: anywhere;
}

.wrap .row > *,
.wrap .btn-toolbar {
  min-width: 0;
}

/* Safari includes long option text in the page's scrollable width. */
.form-select:not([multiple]):not([size]) {
  overflow: hidden;
}

.wrap > .container img,
.markdown-preview__body img {
  max-width: 100%;
  height: auto;
}

.markdown-body pre,
.markdown-body table,
.markdown-preview__body table {
  max-width: 100%;
  overflow-x: auto;
}

.markdown-body table,
.markdown-preview__body table {
  display: block;
  overflow-wrap: normal;
  word-break: normal;
}

.grid-view .table {
  overflow-wrap: normal;
}

.pagination,
.btn-toolbar {
  gap: .5rem 0;
}

.pagination {
  flex-wrap: wrap;
}

.comment-placeholder {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  vertical-align: middle;
  background: black;
  color: black;
}

.site-profile {
  max-width: 800px;
}

.site-profile .card {
  border-color: rgba(var(--bs-dark-rgb), .16);
  box-shadow: 0 .125rem .5rem rgba(33, 37, 41, .06);
}

.site-profile .detail-view th {
  width: 38%;
}

.site-profile .table-responsive {
  border-radius: .25rem;
}

.notification-preferences-wrap {
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: .5rem;
}

.notification-preferences-table {
  min-width: 560px;
}

.notification-preferences-table thead th {
  padding: .75rem 1rem;
  border-bottom-width: 1px;
  background: var(--bs-tertiary-bg, #f8f9fa);
  vertical-align: middle;
}

.notification-preferences-table thead th:nth-child(2),
.notification-preferences-table thead th:nth-child(3) {
  width: 10rem;
}

.notification-preferences-table tbody td {
  padding: .85rem 1rem;
}

.notification-preferences-table .form-switch {
  min-height: auto;
  padding-left: 0;
}

.notification-preferences-table .form-check-input {
  float: none;
  margin: 0;
  cursor: pointer;
}

.notification-preferences-table .form-check-input:disabled {
  cursor: not-allowed;
}

.user-permission,
.user-notification-channel {
  color: var(--channel-unavailable, #c4c9ce);
  font-size: 1.25rem;
  line-height: 1;
}

.user-permission.is-available {
  color: var(--success-text);
}

.user-notification-channel.is-available[data-channel="push"] {
  color: var(--channel-push, #5200cc);
}

.user-notification-channel.is-available[data-channel="compass"] {
  color: var(--channel-compass, #e05c35);
}

.user-notification-channel.is-available[data-channel="telegram"] {
  color: var(--channel-telegram, #0088cc);
}

.user-notification-channel.is-available[data-channel="email"] {
  color: var(--channel-email, #198754);
}

.notification-preference-description {
  max-width: 34rem;
}

.notification-preference-status {
  min-height: 1.25rem;
}

@media (max-width: 575.98px) {
  .grid-view .table {
    min-width: 640px;
  }

  .detail-view:not(.table-borderless),
  .detail-view:not(.table-borderless) tbody,
  .detail-view:not(.table-borderless) tr,
  .detail-view:not(.table-borderless) th,
  .detail-view:not(.table-borderless) td {
    display: block;
    width: 100%;
  }

  .form-actions {
    align-items: flex-start !important;
  }

  .form-actions > .markdown-help {
    margin-left: 0 !important;
  }

  .kb-navigation {
    padding-right: 0 !important;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-right: 0 !important;
    border-bottom: 1px solid var(--bs-border-color);
  }

  .calendar-index .fc-multimonth-daygrid,
  .calendar-index .fc-multimonth-header {
    padding-right: .25rem;
    padding-left: .25rem;
  }

  .site-profile__header {
    align-items: flex-start !important;
  }

  .site-profile__header h1 {
    width: 100%;
    font-size: calc(1.3rem + .6vw);
  }
}

@media (min-width: 1200px) {
  .event-buttons-row {
    padding-top: 0;
    padding-bottom: 0;
  }
}
