body {
    background: #fefefe;
    color: #333;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

h1 {
    font-size: 17px;
    font-weight: bold;
    margin: 0 6px;
}

#tab-manage-data h3 {
    margin: 10px 0;
    margin-inline-end: 10px;
}

h4 {
    display: flex;
    flex-direction: row;
    margin: 30px 0 15px 0;
}
h4::after {
    content: "";
    flex: 1 1;
    border-bottom: 1px solid #d3d3d3;
    margin: auto;
    margin-inline-start: 10px;
}

div.checkbox {
    max-width: 600px;
    white-space: nowrap;
}

div.checkbox span[class^=i18n_] {
    white-space: normal;
    white-space: break-spaces;
}

div.checkbox + div.checkbox, div#learning-setting-divs div:first-child, div#learning-setting-divs + div.checkbox {
    margin-top: 5px;
}

input[type=checkbox] {
    flex: none;
    margin-inline-end: 0.8em;
}

div.checkbox .ui-icon {
    margin-inline-start: 0.2em;
    font-size: 1.2em;
}

div.checkbox .ui-icon-alert {
    color: #cc0000;
}

td
{
  font-size: 13px;
  vertical-align: top;
  text-align: left;
}

button
{
  white-space: pre;
}

label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
#tracking-domains-filters label {
    display: inline;
}

p, #settingsForm {
    margin: 10px 0;
}

#allowlist-form {
    margin: 20px 0 0;
}

#tab-manage-data {
  overflow: auto;
}

.btn-silo {
  float: left;
  clear: both;
  margin-bottom: 20px;
  max-width: 700px;
  width: 100%;
}

.btn-silo + .btn-silo {
  border-top: 1px solid #d3d3d3;
  margin-top: 10px;
  padding-top: 10px;
}

.btn-silo div {
  max-width: 350px;
  width: 100%;
  float: left;
}

.btn-danger {
  color: #e02431;
  border-width: 1px;
  border-color: #e02431;
}

.btn-danger:hover {
  color: white;
  background: #e02431;
}

.importInput{
  visibility: hidden;
  height: 0;
  width: 0;
}

#tracking-domains-loader {
    position: absolute;
    width: 95%;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tracking-domains-loader .spinner {
    border: 0.5em solid #222;
    border-bottom-color: #fff;
    height: 5em;
    width: 5em;
    border-radius: 5em;
    animation: spin 1s infinite linear;
}
@keyframes spin {
    0% {
        transform: rotate(0);
    }
    100% {
        transform: rotate(359deg);
    }
}

#tracking-domains-filters {
    color: #505050;
    font-size: 14px;
    list-style-type: none;
    padding: 10px;
    border: 1px solid #d3d3d3;
}

#tracking-domains-filters li {
    margin: 10px 0;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

#tracking-domains-filters > li > label {
    flex: 1 0 150px; /* at least this wide */
    max-width: 300px; /* at most this wide */
}

#tracking-domains-filters > li > label + * {
    flex: 1 0 300px; /* at least this wide or wrap */
    max-width: 300px;
}

#tracking-domains-filters > li > label + input[type=checkbox] {
    flex: none;
}

.clickerContainer {
    max-height: 400px; /* override popup.css */
}

a.removeDomain {
    display: inline-block; /* override popup.css */
}

/* domain "more info" tooltips */
.origin-inner {
    cursor: pointer;
    text-decoration: underline dotted #505050;
    text-underline-offset: 2px;
    border: 2px solid transparent; /* to avoid shifting on focus */
    display: inline-block;
}
.origin-inner:focus-visible {
    border: 2px solid #F06A0A;
    outline: none; /* for Chrome */
}
div.switch-toggle {
    margin-top: 2px; /* to align with domain names */
}

.tooltipster-badger-domain-more-info.tooltipster-sidetip .tooltipster-box {
    padding: 10px 0;
}
.tooltipster-badger-domain-more-info.tooltipster-sidetip .tooltipster-content {
    font-size: 15px;
}
.tooltipster-badger-domain-more-info.tooltipster-sidetip .tooltipster-content a,
.tooltipster-badger-domain-more-info.tooltipster-sidetip .tooltipster-content a:visited {
    color: #fff;
}
.tooltipster-badger-domain-more-info.tooltipster-sidetip .tooltipster-content a:hover  {
    color: #f06a0a;
}
.tooltipster-badger-domain-more-info.tooltipster-sidetip .tooltipster-content ul {
    padding-inline-start: 25px;
}

label[for=hide-widgets-select] {
    display: block;
}

#widget-site-exceptions-select-div {
    float: left;
    max-width: 420px;
    width: 100%;
    margin-inline-end: 10px;
    margin-bottom: 5px;
}

#widget-site-exceptions-remove-button {
    float: left;
    margin-bottom: 10px;
}

#new-disabled-site-input, #allowlist-select, #widget-site-exceptions-select {
    box-sizing: border-box;
    width: 100%;
}
#new-disabled-site-input {
    padding: 8px;
}

#tabs, header {
    background: transparent;
    border: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}
header {
    margin-top: 8px;
}
#tabs .ui-widget-header {
    background: transparent;
    border: none;
    border-bottom: 1px solid #d3d3d3;
    border-radius: 0px;
    padding: 0;
}
#tabs .ui-tabs-nav .ui-state-default {
    background: transparent;
    border: none;
    border-radius: 0px;
    margin: 0;
    padding: 0;
}
#tabs .ui-tabs-nav .ui-state-hover {
    box-shadow: inset 0 -3px 0 0 #ccc;
}
#tabs .ui-tabs-nav .ui-state-active {
    box-shadow: inset 0 -3px 0 0 #f06a0a;
}
#tabs .ui-tabs-nav li a.ui-tabs-anchor {
    padding: 1em;
}
#tabs .ui-tabs-nav .ui-state-hover a,
#tabs .ui-tabs-nav .ui-state-active a {
    color: #000;
}
#tabs .ui-tabs-nav li a:focus {
    outline: none;
}

.indent1 {
    margin-inline-start: 25px;
}

#tip-container {
    margin: 10px 0 20px 0;
    border-left: 4px solid #f06a0a;
    background-color: #e8e9ea;
    border-radius: 4px;
}

#tip-header {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #f06a0a;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 4px;
    background-color: #e8e9ea;
    width: 100%;
    text-align: start;
    border: unset;
    background: unset;
}

#tip-header:hover {
    background-color: #ccc;
}

#tip-icon {
    font-size: 1.2em;
    margin-right: 8px;
    flex-shrink: 0;
}

.tip-arrow {
    flex-shrink: 0;
}

#tip-title {
    color: #333;
    /* Text should expand to keep the arrow on the right, then shrink and wrap when the screen is narrow */
    flex: 1 1;
    white-space: normal;
}

#disable-instructions-image {
    max-width: 100%;
    width: 400px;
    border: 1px solid #ccc;
    border-radius: 2px;
    margin-top: 10px;
}

#tip-expanded {
    padding: 8px 16px;
}


@media screen and (max-width: 500px) {
    .ui-tabs .ui-tabs-panel {
        padding: 0.5em 0;
    }
}

@media screen and (min-width: 800px) {
    .origin {
        max-width: 340px;
    }

    .switch-container {
        margin-left: 350px;
    }

    .key {
        left: 345px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }

    body {
        background-color: #333;
        color: #ddd;
    }

    h1 {
        color: #f9f9f9;
    }

    h4::after, #tabs .ui-widget-header {
        border-bottom: 1px solid #555;
    }
    .btn-silo + .btn-silo {
        border-top: 1px solid #555;
    }

    input[type="text"],
    #allowlist-select,
    .select2-container--default .select2-selection--multiple,
    .select2-dropdown,
    #widget-site-exceptions-select {
        background-color: #222;
        border: 1px solid #555;
        color: #ddd;
    }

    input[type="text"]:focus,
    #allowlist-select:focus,
    #widget-site-exceptions-select:focus,
    #tip-header:focus-visible {
        border: 1px solid #f06a0a;
        outline: none;
    }

    .ui-tabs-panel {
        color: #ddd;
    }

    .ui-widget-content a {
        color: #ddd;
    }
    .ui-widget-content a:hover {
        color: #f06a0a;
    }

    #tabs .ui-tabs-nav .ui-state-default a {
        color: #bbb;
    }

    #tabs .ui-tabs-nav .ui-state-hover a,
    #tabs .ui-tabs-nav .ui-state-active a {
        color: #f9f9f9;
    }

    #tracking-domains-filters {
        color: #bbb;
        border: 1px solid #555;
    }

    .origin-inner {
        text-decoration: underline dotted #ddd;
    }

    #resetData, #removeAllData {
        background-color: #86151d;
        background-image: none;
        border: 1px solid #e02431;
    }

    #resetData:hover, #removeAllData:hover {
        background-color: #9c1922;
        background-image: none;
        border: 1px solid #e64f5a;
    }
    #resetData:focus, #removeAllData:focus {
        outline: auto;
    }

    .ui-button.ui-corner-all.ui-widget {
        background-color: #555;
        background-image: none;
        border: 1px solid #777;
        color: #f9f9f9;
    }

    .ui-button.ui-corner-all.ui-widget:hover {
        background-color: #666;
        border: 1px solid #bbb;
    }
    .ui-button.ui-corner-all.ui-widget:focus {
        border: 1px solid #f06a0a;
        outline: none;
    }

    .select2-container--default.select2-container--focus .select2-selection--multiple {
        border: 1px solid #f06a0a;
        color: #ddd;
    }

    .select2-container--default .select2-results__option[aria-selected=true] {
        color: #333;
        background-color: #bbb;
    }

    .select2-container--default .select2-results__option--highlighted[aria-selected] {
        background-color: #f06a0a;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        background-color: #333;
        border: 1px solid #555;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
        color: #ddd;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
        color: #f96a0a;
    }

    .select2-container--default.select2-container--disabled .select2-selection--multiple {
        background-color: #222;
        opacity: 0.5;
        cursor: not-allowed;
    }

    .select2-container--default .select2-search--inline .select2-search__field {
        color: #ddd;
    }

    #tip-container {
        background-color: #555;
    }

    #tip-header:hover {
        background-color: #666;
    }

    #tip-title {
        color: #f9f9f9;
    }
}
