:root {
    --border-color: rgb(225, 225, 225);
    --secondary-color: rgb(125, 125, 125);
}

@media (prefers-color-scheme: dark) {
    :root {
        --border-color: var(--grey-50);
        --secondary-color: var(--grey-10-a60);
    }
}

#root {
    padding: 20px 10px;
}

body {
    background: var(--box-background) !important;
    color: var(--box-color) !important;
    font-size: 13px;
}

a              { color: var(--blue-40); }
a:hover        { color: var(--blue-50); }
a:hover:active { color: var(--blue-60); }


button.ghost {
    width: 24px !important;
    height: 24px !important;
    padding: initial;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.ghost:not(:hover) {
    background-color: initial;
}


#form {
    display: flex;
    flex-direction: column;
}

#buttons {
    display: flex;
    align-items: center;
    align-self: flex-end;
    margin-block-start: 20px;
}

#buttons > :not(:last-child) {
    margin-inline-end: 5px;
}

#status-line {
    color: var(--secondary-color);
}

.bridge {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    order: -1;
    padding-bottom: 20px;
}

.bridge,
.bridge__loading {
    display: flex;
    flex-direction: column;
}

.bridge__loading {
    align-items: center;
    align-self: center;
    font-size: 1.25em;
    font-weight: 300;
    width: 30%;
}

.bridge__loading progress {
    margin-top: 5px;
    width: 100%;
}

.bridge__info {
    display: flex;
    padding-inline-start: 25px;
}

.bridge__status {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin-inline-end: 25px;
}

.bridge__info--not-found {
    padding-inline-end: 25px;
}
.bridge__info--found .bridge__status {
    border-inline-end: 1px solid var(--border-color);
    padding-inline-end: 25px;
}

.bridge__info--timed-out .bridge__status {
    display: flex;
    flex-direction: row;
    gap: 20px;
}
.bridge__info--timed-out .bridge__status-title {
    font-size: 1.75em;
}

.bridge__status-title {
    margin: initial;
    font-weight: 600;
    font-size: 1.5em;
    white-space: nowrap;
}

.bridge__status-text {
    margin: initial;
    margin-top: 5px;
    font-size: 1.15em;
    text-align: center;
}

.bridge__info--not-found .bridge__status {
    display: grid;
    grid-template-columns: min-content 1fr;
    grid-template-rows: min-content min-content;
    grid-template-areas:
        "status-icon status-title"
        "status-icon status-text";
}
.bridge__info--found .bridge__status-icon {
    margin-block-end: 5px;
}
.bridge__info--not-found .bridge__status-icon {
    grid-area: status-icon;
    margin-inline-end: 10px;
}
.bridge__info--not-found .bridge__status-title {
    grid-area: status-title;
    white-space: normal;
}
.bridge__info--not-found .bridge__status-text {
    grid-area: status-text;
    margin-top: initial;
}

.bridge__stats {
    border-collapse: collapse;
    border-spacing: 0;
}

.bridge__stats th {
    font-weight: 600;
    padding-inline-end: 10px;
    text-align: end;
    vertical-align: top;
    white-space: nowrap;
}

.bridge__options {
    margin-top: 30px;
}

.bridge__update-info {
    align-items: center;
    display: flex;
    margin-top: 10px;
}

.bridge__update-label {
    display: inline-block;
    margin: initial;
}

.bridge__update-options {
    display: inline-flex;
    flex-direction: column;
    margin-left: 10px;
}

.bridge__update-start {
    align-self: flex-end;
    margin-top: 5px;
}

.bridge--update-status {
    margin-left: 10px;
}

.bridge__backup-host,
.bridge__backup-port {
    margin-left: 0.5em;
    margin-right: 0.5em;
}

.bridge__backup-host {
    width: 125px;
}

.bridge__backup-port {
    width: 75px;
}


.category {
    border: initial;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    grid-column-gap: 10px;
    grid-row-gap: 5px;
    margin: initial;
    padding: 10px 0;
}

.category:disabled {
    color: var(--secondary-color);
}

#form > .category {
    border-bottom: 1px solid var(--border-color);
}


.category > hr {
    border: initial;
    border-top: 1px solid var(--border-color);
    grid-column: span 2;
    width: 100%;
}

.category__name {
    float: left;
}

.category__name > h2 {
    font-size: 1.15em;
    font-weight: 600;
    margin: initial;
}

.category__description {
    color: var(--secondary-color);
    margin-top: initial;
    max-width: 60ch;
}

.category__name,
.category__description,
.category .category {
    grid-column: span 2;
}


.option {
    display: contents;
}

.option--inline {
    align-items: center;
    display: grid;
    grid-column-start: 2;
    grid-template-columns: min-content 1fr;
    grid-template-rows: min-content min-content;
    grid-template-areas:
        "input label"
        ". description";
}

.option--inline > input {
    grid-area: input;
    width: 16px;
}
.option--inline > .option__label {
    grid-area: label;
    text-align: initial;
}
.option--inline > .option__description {
    grid-area: description;
}

.option__label {
    text-align: right;
    display: inline-block;
}

.option__recommended {
    background-color: var(--blue-60);
    border-radius: 2px;
    color: white;
    font-size: smaller;
    margin-inline-start: 5px;
    padding: 0 5px;
}

.option__description {
    color: var(--secondary-color);
    font-size: smaller;
    grid-column: span 2;
    margin: 5px 0;
    max-width: 45ch;
}

.option > input,
.option > select {
    align-self: center;
    justify-self: flex-start;
    margin-inline-start: initial;
}


.editable-list {
    background-color: var(--box-background);
    border: 1px solid var(--border-color);
    color: var(--box-color);
    justify-content: end;
    padding: 5px;
}

.editable-list__view-actions {
    display: flex;
    justify-content: end;
}

.editable-list__save-raw-button {
    margin-inline-end: 5px;
}

.editable-list hr {
    border: initial;
    border-top: 1px solid var(--border-color);
    margin: 5px 0;
}

.editable-list__items {
    display: flex;
    flex-direction: column;
    margin: initial;
    margin-inline-start: -5px;
    padding: initial;
    width: calc(100% + 10px);
}

.editable-list__item {
    align-items: center;
    display: flex;
    height: 34px;
    padding: 0 5px;
}

.editable-list__item:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

.editable-list__item--selected {
    background-color: var(--blue-50-a30) !important;
}

.editable-list__title {
    flex: 1;
    font-family: monospace;
    overflow: hidden;
    padding: 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editable-list__item:not(.editable-list__item--selected) > .editable-list__title {
    padding: 0 8px;
}

.editable-list__title + button {
    margin-inline-end: 5px;
}

.editable-list__edit-field {
    font: inherit;
    margin-inline-end: 1em;
    width: -moz-available;
}

.editable-list__raw-view {
    max-height: 300px;
    overflow-y: auto;
    resize: vertical;
    width: 100%;
}

.editable-list__add-button {
    margin-inline-end: auto;
}


.translator__tag {
    color: #0a84ff;
    display: inline-block;
    font-size: 80%;
    font-weight: bold;
    margin-inline-start: 2px;
    text-transform: uppercase;
    vertical-align: text-top;
}


@media (prefers-color-scheme: dark) {
    .editable-list__item:nth-child(odd) {
        background-color: rgba(255, 255, 255, 0.05);
    }
}
