@media (prefers-color-scheme: dark) {

body {
  background-color: #2b2d30;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  box-shadow: 0px 0px 0px #000 inset;
}

::-webkit-scrollbar-thumb {
  border-radius: .5rem;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(60,60,60,0.9) !important;
}

::-webkit-scrollbar-track {
  background-color: rgba(95,95,95,0.9) !important;
}

/* Brighter default link colours */
body.message div.object table.message a,
body a:not(.btn):not(.nav-item) {
  color: #35a8fb;
}

body a:visited:not(.btn):not(.dropdown-item):not(.nav-item):not(.page-link):not(.jstree-anchor):not(.noshowvisit):not(.list-group-item-action) {
  color: #9370DB;
}

body.message div.object table.message a:visited,
body a:visited:not(.btn):not(.dropdown-item):not(.nav-item):not(.page-link):not(.jstree-anchor):not(.noshowvisit):not(.list-group-item-action) {
  color: #CB5CFF;
}

body a:visited:hover {
  color: #DF99FF;
}

/* Muted text */
body .text-muted {
  color: rgba(175,175,175,0.85) !important;
}

body .bg-light>.text-muted,
body .bg-light.text-muted {
  color: rgba(195,195,195,1) !important;
}


/* White text */
/*
body h1,
body h2,
body h3,
body h4,
body h5,
body h6,
*/
body,
body .popover-body,
body .toast-header,
body .bodymessage,
body .fc-widget-header,
body .fc-unthemed .fc-list-item td,
body>.position-relative>.container>*:not(.alert),
body ul#cssdropdown a,
body #mailboxlist li,
body #mailboxlist li a,
body #cards #smartertabs,
body #cards #smartertabs li a,
body #mailcontframe tr.message:not(.Flagged) .emaildiv,
body #mailboxlist-container,
body #mailcontframe,
body #mailpreviewdiv,
body #currentcard,
body fieldset,
body .dropdown-menu,
body .list-group .list-group-item-secondary,
body .list-group .list-group-item-light:not(.active),
body .list-group .list-group-item-action:not(.active),
body .list-group .list-group-item:not([class*="list-group-item-"]):not(.active),
body button:not([class]):not([role]),
body input[type='submit']:not([class]),
body input[type='button']:not([class]),
body a.btn:not([class*="btn-"]),
body input.btn:not([class*="btn-"]),
body *.btn:not([class*="btn-"]),
body .btn-light,
body .btn-light:hover,
body .form-control,
body input:not([type]):not(.no-form-control):not(.money),
body select.form-select,
body select:not([class]),
body [contenteditable],
body.message table.message,
body .table,
body .input-group-text,
body .bg-trans,
body div#calendar,
body .ui-dialog .ui-dialog-content,
body .ui-dialog .ui-dialog-titlebar,
body .ui-dialog .ui-dialog-buttonpane,
body .ui-tabs-panel,
body .nav-link.active,
body .modal-content,
body .modal-dialog,
body .fc-ltr .fc-dayGrid-view .fc-day-top:not(.fc-today) .fc-day-number,
body .card:not(.bg-amber):not(.bg-danger):not(.bg-warning):not(.bg-white):not(.bg-dark):not(.bg-primary):not(.bg-info) {
  color: rgba(255,255,255,0.8) !important;
}

/* Light text */
::placeholder,
::-webkit-input-placeholder, 
::-moz-placeholder,
:-ms-input-placeholder,
:-moz-placeholder {
  color: rgba(255,255,255,0.6);
}

body .fc-unthemed td.fc-widget-content.fc-today {
  background-color: rgba(252, 248, 227,0.5) !important;
}

/* Black text 
body .modal {
  color: rgba(0,0,0,0.8) !important;
}
*/

/* Lighter background */
body .input-group-text,
body .bg-light,
body .btn-light:hover,
body .toast-header,
body div.em .projx,
body ul#cssdropdown,
body ul#cssdropdown .headlink ul,
body .ui-tabs-tab,
body #cards #smartertabs li#current a,
body #cards #smartertabs li a:hover,
body .list-group .list-group-item-light:not(.active),
body button:hover:not([class]):not([role]),
body input[type='submit']:hover:not([class]),
body input[type='button']:hover:not([class]) {
/*
  background-color: rgba(95,95,95,0.9) !important;
*/
  background-color: rgba(75,85,99,0.9) !important;
}

/* Medium backgrounds */
body .popover-header,
body .toast,
body div#caltable div.leftpanel,
body button:not([class]):not([role]),
body input[type='submit']:not([class]),
body input[type='button']:not([class]),
body button:not([class]):not([role]),
body a.btn:not([class*="btn-"]),
body input.btn:not([class*="btn-"]),
body *.btn:not([class*="btn-"]),
body .btn-light,
body .page-link,
body .form-control:focus,
body input:focus:not([type]):not(.no-form-control):not(.money),
body [contenteditable]:focus,
body .ui-dialog .ui-dialog-titlebar,
body .ui-dialog .ui-dialog-buttonpane,
body .ui-tabs-nav,
body .ui-tabs,
body .nav-link.active,
body .nav-link:hover,
body .tab-content,
body .list-group .list-group-item-action:not(.active):hover,
body .list-group .list-group-item-secondary:not(.active),
body .list-group .list-group-item:not([class*="list-group-item-"]):not(.active),
body div.em,
body.message table.message,
body.message table#maintable,
body.message div.body,
body table.table,
body #messagelist .emaildate th,
body #smartertabs ul,
body #cards #smartertabs li a {
/*
  background-color: rgba(75,75,75,0.9) !important;
*/
  background-color: rgba(55,65,81,0.9) !important;
}

/* Darker background */
body .popover,
body .fc-unthemed .fc-list-item:hover td,
body .fc-widget-header,
body .bodymessage,
body #maintable,
body #mailboxlist-container,
body #mailcontframe,
body #mailpreviewdiv,
body #currentcard,
body fieldset,
body .dropdown-menu,
body .bg-trans,
body div#calendar,
body .ui-dialog,
body .modal-content,
body .modal-dialog-slideout,
body button:hover:not([class]):not([role]),
body a.btn:not([class*="btn-"]):hover,
body input.btn:not([class*="btn-"]):hover,
body *.btn:not([class*="btn-"]):hover,
body .page-link:hover,
body .ui-tabs-active,
body .form-control,
body .calendarflexcont,
body input:not([type]):not(.no-form-control):not(.money),
body select.form-select,
body select:not([class]),
body table.oddeven tr.sticky-top th,
body table.oddeven tr.sticky-top td,
body table.oddeven thead tr:first-of-type th,
body table.sortable tr.sticky-top th,
body table.sortable tr.sticky-top td,
body table.table-striped tr.sticky-top th,
body table.table-striped tr.sticky-top td,
body table.table-striped thead tr th,
body .card:not(.bg-amber):not(.bg-danger):not(.bg-warning):not(.bg-white):not(.bg-dark):not(.bg-primary):not(.bg-info) {
/*
  background: rgba(60,60,60,0.9) !important;
*/
  background-color: rgba(31,41,55,0.9) !important;
}

/* No background */
body.message,
body.message table.message tr td ul li,
body.message table.message tr td,
body.message table.message tr th,
body .list-group .list-group-item-action {
  background-color: transparent !important;
}

/* Matching border */
body .border,
body .border-left,
body .border-right,
body .border-top,
body .border-bottom,
body .fc-widget-header,
body .fc-unthemed .fc-list-view,
body hr,
body div.fc-view td,
body div.fc-view th,
body div#caltable div.leftpanel,
body ul#cssdropdown,
body ul#cssdropdown .headlink ul,
body #mailboxlist-container,
body #mailcontframe,
body #mailpreviewdiv,
body #currentcard,
body fieldset,
body legend,
body .dropdown-menu,
body button:not([class]):not([role]),
body input[type='submit']:not([class]),
body input[type='button']:not([class]),
body button:not([class]):not([role]),
body a.btn:not([class*="btn-"]),
body input.btn:not([class*="btn-"]),
body *.btn:not([class*="btn-"]),
body .btn-light,
body .page-link,
body .form-control,
body input:not([type]):not(.no-form-control):not(.money),
body select.form-select,
body select:not([class]),
body .input-group-text,
body .list-group,
body .list-group .list-group-item:not([class*="list-group-item-"]):not(.active),
body .ui-dialog,
body .ui-dialog .ui-dialog-content,
body .ui-dialog .ui-dialog-titlebar,
body .ui-tabs-tab,
body .nav-link.active,
body .nav-link:hover,
body .tab-content,
body .nav-tabs,
body.message table.message,
body #mailcontframe tr.message td,
body #mailboxlist li,
body #mailboxlist li a,
body #cards #smartertabs,
body #cards #smartertabs li a,
body div#calendar,
body table.table,
body .modal-footer,
body .modal-header,
body .popover-header,
body .table-striped th,
body .table-striped td,
body #messagelist .emaildate th,
body .card:not(.bg-white),
body .card:not(.bg-white) .card-body {
  border-color: rgba(110,110,110,0.9) !important;
}

/* Box Shadow */
.card,
.dropdown-menu,
body fieldset:not(.search),
nav.bodynav,
.tab-content,
body table.form,
body form.form,
body #cssdropdown,
body #cssdropdown li.headlink ul,
body #mailboxlist-container,
body #mailcontframe,
body #mailpreviewdiv,
#folders,
#messages,
img.pic,
#faqlist .content,
#banner,
body .popover,
.modal-dialog-slideout,
.modal-dialog:not(.modal-dialog-slideout) .modal-content,
.ui-dialog,
#fullimg,
.dragzone,
body .shadow {
  /* Main box shadow  */
/*
  box-shadow: 0px 2px 6px -2px #666;
*/
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.25);
}

.ishadow {
  box-shadow: 0 0 1rem rgba(0,0,0,.25) inset;
}

/* Specific fixes */

.gm-style {
  color: #333;
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23eeeeee' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

body .mail-cal-cont {
  border-color: rgba(59,130,246,1);
  background-color: rgba(75,85,99,1);
}

body .mail-cal-header {
  color: rgba(255,255,255,1);
  background-color: rgba(59,130,246,1);
}

body .mail-cal-body {
  color: rgba(239,68,68,1);
}

body .bg-blue {
  background-color: rgba(30,64,175,1);
}

body .bg-yellow {
  background-color: rgba(217,119,6,1);
}

body .bg-green {
  background-color: rgba(4,120,87,1);
}

body .datecont.thisweek {
  background-color: rgba(23,162,184,0.5);
  border-color: #ccc;
}
pre { color:whitesmoke}

.navbar-light {
  background-color: rgba(60, 60, 60, 0.9) !important;
}

}
