@font-face {
    font-family: 'Material Design Icons';
    src: url('../font/material-design-icons.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    src: url('../font/open-sans-cyrillic.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    src: url('../font/open-sans-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto Mono';
    src: url('../font/roboto-mono-cyrillic.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto Mono';
    src: url('../font/roboto-mono-latin.woff2') format('woff2');
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeOut {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

[class^="mdi-"] {
    position: relative;
    top: 1px;
    line-height: 0;
    font-family: 'Material Design Icons';
    font-style: normal;
    font-size: 1.15em;
}

html {
    --color-success:    #008000;
    --color-warning:    #fbb040;
    --color-error:      #ff4000;
    --border-radius:    5px;
    --header-height:    50px;
    --footer-height:    40px;
    --font-mono:        'Roboto Mono';
    --font-size-mono:   13px;
    --font-size-small:  0.875em;
    --font-size-tiny:   0.8125em;
    scrollbar-width:    thin;
    scrollbar-color:    var(--color-shade) var(--background-main);
    font-size: 14px;
}

html[theme="light"] {
    --background-main:  #ffffff;
    --background-shade: #eeeeee;
    --background-hover: #dddddd;
    --background-error: #ffdddd;
    --border-loader:    #888888;
    --border-main:      #cccccc;
    --border-edge:      #e6e6e6;
    --border-shade:     #eeeeee;
    --color-main:       #444444;
    --color-shade:      #888888;
    --color-highlight:  #000000;
    --range-main:       #cccccc;
    --range-dark:       #666666;
    --range-light:      #eeeeee;
    --modal-background: rgba(0, 0, 0, 0.5);
    --box-shadow:       0 2px 10px 0 rgba(127, 127, 127, 0.25);
    color-scheme:       light;
}

html[theme="dark"] {
    --background-main:  #111111;
    --background-shade: #222222;
    --background-hover: #333333;
    --background-error: #331111;
    --border-loader:    #888888;
    --border-main:      #444444;
    --border-edge:      #2a2a2a;
    --border-shade:     #222222;
    --color-main:       #cccccc;
    --color-shade:      #888888;
    --color-highlight:  #ffffff;
    --range-main:       #444444;
    --range-dark:       #222222;
    --range-light:      #cccccc;
    --modal-background: rgba(63, 63, 63, 0.1);
    --box-shadow:       0 2px 10px 0 rgba(63, 63, 63, 0.25);
    color-scheme:       dark;
}

html[icons="off"] .exposeIcon {
    display: none;
}

html[wide="on"] .container {
    max-width: none;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    background-color: var(--background-main);
    box-sizing: border-box;
    font-family: 'Open Sans';
    font-weight: 400;
    color: var(--color-main);
    -webkit-text-size-adjust: 100%;
}

body * {
    scrollbar-width: thin;
}

button {
    cursor: pointer;
    height: 24px;
    padding: 0 10px 1px 10px;
    border: 1px solid var(--border-main);
    border-radius: var(--border-radius);
    background-color: var(--background-shade);
    font-size: var(--font-size-tiny);
    font-weight: 400;
    text-transform: uppercase;
    color: var(--color-main);
}

button:hover:enabled {
    background-color: var(--background-hover);
}

button:disabled {
    cursor: default;
    opacity: 0.5;
}

input[type="checkbox"] {
    margin: 2px;
    margin-right: 5px;
}

input[type="datetime-local"], input[type="number"], input[type="password"], input[type="text"], select, textarea {
    width: 100%;
    border: 1px solid var(--border-main);
    border-radius: var(--border-radius);
    background-color: var(--background-main);
    box-sizing: border-box;
    color: var(--color-main);
    -moz-appearance: none;
    -webkit-appearance: none;
}

input[type="datetime-local"], input[type="number"], input[type="password"], input[type="text"], select {
    height: 30px;
    margin-bottom: 10px;
    padding: 0 5px;
}

textarea {
    height: 75px;
    margin-bottom: 5px;
    padding: 5px;
    font-family: var(--font-mono);
    font-size: var(--font-size-tiny);
    resize: vertical;
}

input[type="range"] {
    appearance: none;
    width: 100%;
    height: 5px;
    margin-left: -2px;
    border: 2px solid var(--background-main);
    border-radius: 5px;
    background-color: var(--range-main);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 0 2px 0 #000000;
}

input[type="range"]::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: none;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 0 2px #666666;
}

input[type="time"] {
    height: 14px;
    border: 1px solid var(--border-main);
    border-radius: var(--border-radius);
}

input.level {
    background: linear-gradient(to right, var(--range-dark), var(--range-light));
}

label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-left: 1px;
    margin-bottom: 2px;
    font-size: var(--font-size-tiny);
    text-transform: uppercase;
}

label.checkbox {
    cursor: pointer;
    justify-content: start;
}

label.checkbox:hover {
    color: var(--color-highlight);
}

form label:last-child {
    margin-bottom: 10px;
}

pre {
    overflow: auto;
    max-height: 800px;
    margin: 0;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid var(--border-shade);
    border-radius: var(--border-radius);
    font-family: var(--font-mono);
    font-size: var(--font-size-mono);
}

span.value {
    margin: 1px 0;
    padding: 0 6px 1px 6px;
    border: 1px solid var(--background-hover);
    border-radius: var(--border-radius);
    background-color: var(--background-shade);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}

th {
    padding: 5px;
    font-size: var(--font-size-tiny);
    font-weight: normal;
    text-transform: uppercase;
    text-align: left;
    color: var(--color-shade);
}

thead input[type="text"] {
    margin-bottom: 5px;
}

tfoot th {
    padding-bottom: 15px;
    border: none;
    border-top: 1px solid var(--border-shade);
}

td {
    padding: 5px;
    padding-top: 4px;
    border-top: 1px solid var(--border-shade);
    white-space: nowrap;
}

td.edge {
    border-top: 2px solid var(--border-edge);
}

td.edit, td.move, td.remove, td.restore {
    cursor: pointer;
}

td.empty {
    width: 10px;
    text-align: center;
    color: var(--color-shade);
    opacity: 0.25;
}

td.move {
    width: 10px;
    color: var(--color-shade);
}

td.remove {
    width: 16px;
    text-align: right;
}

td.restore {
    width: 14px;
    padding-right: 0;
}

td.edit:hover, td.move:hover, td.restore:hover, td.edit:hover .shade {
    color: var(--color-warning);
}

td.remove:hover {
    color: var(--color-error);
}

td.value[data-type="status"] {
    color: var(--color-shade);
}

td.value[data-type="status"][data-value="on"] {
    color: var(--color-warning);
}

th:first-child, td:first-child {
    padding-left: 5px;
}

th:last-child, td:last-child {
    padding-right: 5px;
}

tr:first-child td {
    border: none;
}

.fade-in {
    animation: fadeIn linear 0.2s;
}

.fade-out {
    animation: fadeOut linear 0.2s;
}

.exposeIcon {
    margin-right: 6px;
    color: var(--color-shade);
}

.toggleIcon {
    display: inline-block;
    top: 3px;
    font-size: 1.6em;
}

.separator {
    display: inline-block;
    position: relative;
    top: -1px;
    width: 0;
    height: 12px;
    margin: 0 3px;
    border-left: 1px solid var(--color-shade);
    vertical-align: middle;
}

.shade {
    color: var(--color-shade);
}

.highlight {
    color: var(--color-highlight);
}

.success {
    color: var(--color-success);
}

.warning {
    color: var(--color-warning);
}

.error {
    color: var(--color-error);
}

.center {
    text-align: center;
}

.right {
    text-align: right;
}

.offline, .incomplete {
    background-color: var(--background-error);
}

.inactive {
    opacity: 0.5;
}

.invisible {
    opacity: 0;
}

.invisible:hover {
    opacity: 1;
}

.buttons {
    display: inline-flex;
    gap: 5px;
    white-space: nowrap;
}

.note {
    padding: 0 5px;
    font-size: var(--font-size-small);
    color: var(--color-shade);
}

.small {
    font-size: var(--font-size-small);
}

.lockScroll {
    overflow: hidden;
}

.pageLoader, .dataLoader {
    border: 2px solid var(--border-main);
    border-top: 2px solid var(--border-loader);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pageLoader {
    width: 20px;
    height: 20px;
    margin: 20px auto;
}

.dataLoader {
    width: 10px;
    height: 10px;
}

.placeholder {
    width: 100%;
    height: 20px;
    margin: 5px 0;
    border-radius: var(--border-radius);
    background: repeating-linear-gradient(135deg, var(--color-shade), var(--color-shade) 5px, transparent 5px, transparent 10px);
    opacity: 0.75;
}

.title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.title .name {
    overflow: hidden;
    font-size: 1.25em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.title .name .info:hover {
    cursor: pointer;
    color: var(--color-highlight);
}

.title .value {
    position: relative;
    bottom: 3px;
}

.title .interval {
    font-family: var(--font-mono);
    font-size: var(--font-size-mono);
    color: var(--color-shade);
}

.title .interval span {
    cursor: pointer;
    margin: 0px 2px;
}

.title .interval span:first-child {
    margin-left: 0;
}

.title .interval span:last-child {
    margin-right: 0;
}

.title .interval span:hover {
    color: var(--color-highlight);
}

.title .change {
    cursor: pointer;
    font-size: var(--font-size-tiny);
    color: var(--color-shade);
}

.title .change:hover {
    color: var(--color-main);
}

.title .status {
    font-size: var(--font-size-tiny);
    color: var(--color-shade);
}

.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown:hover {
    color: var(--color-warning);
}

.dropdown hr {
    height: 1px;
    margin: 5px -10px;
    border: none;
    background-color: var(--border-main);
}

.dropdown .list {
    display: none;
    position: absolute;
    top: -1px;
    right: -1px;
    z-index: 1;
    cursor: pointer;
    padding: 4px 10px;
    border: 1px solid var(--border-main);
    border-radius: var(--border-radius);
    background-color: var(--background-shade);
    box-shadow: var(--box-shadow);
}

.dropdown .item {
    height: 23px;
    line-height: 23px;
    white-space: nowrap;
    text-transform: none;
    text-align: left;
    color: var(--color-main);
}

.dropdown .current {
    color: var(--color-warning);
}

.login {
    max-width: 300px;
    min-height: calc(100vh - 20px);
    min-height: calc(100dvh - 20px);
    margin: 0 auto;
    padding: 10px;
    text-align: center;
}

.login img {
    height: 100px;
    margin: 40px 0;
}

.login button {
    width: 100%;
}

.container {
    overflow: auto;
    max-width: 1000px;
    margin: 0 auto;
}

.content {
    flex: 1 0 auto;
    padding: 0 15px;
}

.header {
    flex: none;
    height: var(--header-height);
    line-height: var(--header-height);
    padding: 0 15px;
    background-color: var(--background-shade);
    white-space: nowrap;
}

.header img {
    height: calc(var(--header-height) - 20px);
    margin: 10px 5px;
}

.header span {
    cursor: pointer;
    padding: 0 4px;
    text-transform: uppercase;
}

.header span:hover {
    color: var(--color-highlight);
}

.header .container, .footer .container {
    display: flex;
    justify-content: space-between;
}

.header .services {
    margin-right: 10px;
}

.header .services .search i {
    position: relative;
    top: 1px;
    left: -2px;
}

.header .menu {
    margin-left: auto;
}

.header .dropdown {
    position: absolute;
}

.header .dropdown:hover {
    color: var(--color-highlight);
}

.header .dropdown .list {
    top: -10px;
    left: -5px;
    right: inherit;
    line-height: 20px;
    padding: 5px 28px 5px 10px;
}

.header .dropdown .item {
    text-transform: uppercase;
}

.footer {
    flex: none;
    height: var(--footer-height);
    line-height: var(--footer-height);
    padding: 0 15px;
    background-color: var(--background-shade);
    font-size: var(--font-size-tiny);
    white-space: nowrap;
    color: var(--color-shade);
}

.footer a {
    text-decoration: none;
    color: var(--color-shade);
}

.footer a:hover {
    color: var(--color-main);
}

.emptyList {
    padding: 15px 0;
    font-style: italic;
    text-align: center;
    color: var(--color-shade);
}

.itemList tbody tr {
    cursor: pointer;
}

.itemList tbody tr:hover {
    background-color: var(--background-hover);
}

.itemList tbody tr:first-child td {
    border-top: 1px solid var(--border-shade);
}

.itemList td {
    overflow: hidden;
    max-width: 100px;
    padding: 10px 5px;
    text-overflow: ellipsis;
}

.itemList .search {
    cursor: pointer;
    width: 12px;
    padding-right: 0;
}

.itemList .search:hover {
    color: var(--color-highlight);
}

.itemList .tiny {
    width: 35px;
}

.itemList .sort {
    cursor: pointer;
}

.itemList .sort:hover {
    color: var(--color-warning);
}

.cameraList {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    margin-top: 20px;
}

.cameraItem, .cameraView {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-main);
    border-radius: var(--border-radius);
    background-color: #000000;
}

.cameraItem {
    cursor: pointer;
    aspect-ratio: 1.778;
}

.cameraItem video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cameraItem .title {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 15px 8px 5px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #ffffff;
}

.cameraItem .title .exposeIcon {
    color: inherit;
}

.cameraView video {
    display: block;
    cursor: pointer;
    width: 100%;
}

.streamAlert {
    position: absolute;
    top: 7px;
    right: 7px;
    line-height: 1;
    color: var(--color-error);
}

.dashboardMenu {
    display: flex;
    overflow-x: auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px;
    padding-left: 0;
    white-space: nowrap;
    color: var(--color-shade);
}

.dashboardList {
    padding: 8px 0;
}

.dashboardList span {
    cursor: pointer;
    padding: 0 5px;
}

.dashboardData {
    display: flex;
    flex-wrap: wrap;
}

.dashboardData .column {
    flex: 1;
    min-width: 330px;
    padding: 0 5px;
}

.dashboardBlock {
    margin-bottom: 10px;
    padding: 10px 5px;
    border: 1px solid var(--border-main);
    border-radius: var(--border-radius);
    background-color: var(--background-shade);
}

.dashboardBlock .title {
    margin: 0 5px 10px 5px;
}

.dashboardBlock tr {
    cursor: pointer;
}

.dashboardBlock tr:hover {
    color: var(--color-highlight);
}

.dashboardBlock td {
    border-top: 1px solid var(--border-main);
    vertical-align: top;
}

.dashboardBlock td.label {
    white-space: normal;
}

.dashboardBlock canvas {
    max-width: 100%;
    height: 150px;
}

.dashboardBlock canvas.small {
    height: 100px;
}

.dashboardBlock canvas.large {
    height: 200px;
}

.dashboardBlock .label td {
    padding-bottom: 0;
}

.dashboardBlock .camera {
    position: relative;
    padding: 5px 5px 10px 5px;
}

.dashboardBlock .camera .label {
    margin-bottom: 5px;
    white-space: normal;
}

.dashboardBlock .camera .placeholder {
    margin: 0;
}

.dashboardBlock .camera video {
    display: block;
    width: 100%;
    border-radius: var(--border-radius);
    background-color: #000000;
}

.dashboardBlock .camera .streamAlert {
    right: 5px;
}

.dashboardBlock .chart {
    padding-top: 0;
    border: none;
}

.dashboardBlock .value {
    width: 1%;
    text-align: right;
}

.dashboardBlock .edit, .dashboardBlock .toggle {
    cursor: pointer;
    color: var(--color-shade);
}

.dashboardBlock .edit:hover {
    color: var(--color-warning);
}

.dashboardBlock .toggle {
    margin-left: 8px;
}

.dashboardBlock:has(td.value[data-type="status"][data-value="on"]) .toggle {
    color: var(--color-warning);
}

.dashboardBlock .offline {
    background-color: var(--background-shade);
    opacity: 0.5;
}

.tiled .column.b {
    display: none;
}

.tiled .dashboardBlock {
    margin-bottom: 20px;
    padding: 0;
    border: none;
    background-color: transparent;
}

.tiled .dashboardBlock .title {
    margin: 0;
    margin-bottom: 8px;
}

.tiled .dashboardBlock .title .edit {
    color: var(--color-main);
}

.tiled .dashboardBlock .title .edit:hover {
    color: var(--color-highlight);
}

.tiled .dashboardBlock .title .edit:hover .invisible {
    opacity: 1;
}

.tiled .dashboardBlock table {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(min(120px, 30%), 1fr));
    margin-top: 0;
}

.tiled .dashboardBlock tbody {
    display: contents;
}

.tiled .dashboardBlock tr {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    aspect-ratio: 1;
    line-height: 1.25;
    padding: 8px;
    border: 1px solid var(--border-main);
    border-radius: var(--border-radius);
    background-color: var(--background-shade);
    box-sizing: border-box;
}

.tiled .dashboardBlock td {
    display: block;
    padding: 0;
    border: none;
}

.tiled .dashboardBlock tr:not(.label) td.label {
    display: flex;
    overflow: hidden;
    flex: 1;
    flex-direction: column;
}

.tiled .dashboardBlock tr:not(.label) td.label .name {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.25;
    margin-top: auto;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tiled .dashboardBlock tr:not(.label):has(td.value:not([data-type="status"])) td.label .name {
    color: var(--color-shade);
}

.tiled .dashboardBlock td.value {
    overflow: hidden;
    flex-shrink: 0;
    width: auto;
    margin-top: 5px;
    text-align: left;
    text-overflow: ellipsis;
}

.tiled .dashboardBlock td.value [data-property="runningStatus"] {
    display: none;
}

.tiled .dashboardBlock .exposeIcon {
    display: inline;
}

.tiled .dashboardBlock tr:not(.label) td.label .exposeIcon {
    display: flex;
    top: 0;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    line-height: 1;
    margin-bottom: 5px;
    border-radius: 50%;
    background-color: var(--background-hover);
    font-size: 1.5rem;
}

.tiled .dashboardBlock tr:not(.label) td.value[data-type="status"] {
    display: none;
}

.tiled .dashboardBlock tr:not(.label):has(td.value[data-type="status"][data-value="on"], td.value[data-binary="true"], [data-property="runningStatus"].warning) {
    background-color: var(--background-hover);
}

.tiled .dashboardBlock tr:not(.label):has(td.value[data-type="status"][data-value="on"], td.value[data-binary="true"], [data-property="runningStatus"].warning) .exposeIcon {
    background-color: var(--border-edge);
    color: var(--color-warning);
}

.tiled .dashboardBlock tr:has(td.camera), .tiled .dashboardBlock tr:has(td.chart), .tiled .dashboardBlock tr:has(td.center) {
    grid-column: 1 / -1;
    aspect-ratio: auto;
}

.tiled .dashboardBlock tr[data-size="small"]:has(td.camera) {
    grid-column: span 3;
    grid-row: span 2;
    aspect-ratio: 1.518;
}

.tiled .dashboardBlock tr[data-size="large"]:has(td.camera) {
    grid-column: span 5;
    grid-row: span 3;
    aspect-ratio: 1.682;
}

.tiled .dashboardBlock tr[data-size] td.camera {
    display: flex;
    overflow: hidden;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.tiled .dashboardBlock tr[data-size] td.camera video, .tiled .dashboardBlock tr[data-size] td.camera .placeholder {
    flex: 1;
    min-height: 0;
    height: 0;
    margin: 0;
}

.tiled .dashboardBlock tr[data-size] td.camera video:not(:fullscreen) {
    object-fit: cover;
}

.tiled .dashboardBlock td.camera .label {
    margin-bottom: 10px;
}

.tiled .dashboardBlock td.camera .streamAlert {
    top: 2px;
    right: 0;
}

.tiled .dashboardBlock tr:has(td.chart) {
    display: grid;
    align-items: baseline;
    column-gap: 10px;
    grid-template-columns: 1fr auto;
}

.tiled .dashboardBlock tr:has(td.chart) td.value {
    margin-top: 0;
    text-align: right;
}

.tiled .dashboardBlock td.chart {
    grid-column: 1 / -1;
    margin-top: 5px;
}

.automationInfo table, .itemInfo table, .deviceInfo table {
    margin-bottom: 20px;
}

.automationInfo td:first-child, .itemInfo td:first-child {
    width: 150px;
}

.automationInfo td {
    white-space: normal;
    vertical-align: top;
}

.automationInfo td span {
    display: inline-block;
    overflow: hidden;
    max-width: 300px;
    white-space: nowrap;
    vertical-align: bottom;
    text-overflow: ellipsis;
}

.automationInfo .title, .itemInfo .title, .deviceInfo .title {
    margin: 10px 5px 10px 4px;
}

.automationInfo {
    padding-bottom: 200px;
}

.automationInfo .title a {
    text-decoration: none;
    color: var(--color-shade);
}

.automationInfo .title a:hover {
    color: var(--color-warning);
}

.itemInfo .chart {
    height: 300px;
    margin: 0 3px;
}

.deviceInfo td:first-child {
    width: 25%;
    min-width: 150px;
}

.deviceInfo td:last-child {
    font-family: var(--font-mono);
    font-size: var(--font-size-mono);
}

.deviceInfo .summary tr {
    display: none;
}

.deviceInfo .exposes .label .name {
    cursor: pointer;
}

.deviceInfo .exposes .label .name:hover {
    color: var(--color-highlight);
}

.deviceMap svg {
    display: block;
    width: calc(100% - 10px);
    height: calc(100vh - var(--header-height) - var(--footer-height) - 48px);
    height: calc(100dvh - var(--header-height) - var(--footer-height) - 48px);
    margin: 10px 5px;
    border: 1px solid var(--border-shade);
    border-radius: var(--border-radius);
    background-color: var(--background-main);
    box-sizing: border-box;
}

.deviceMap svg text {
    cursor: pointer;
    paint-order: stroke;
    stroke: var(--background-main);
    stroke-linecap: butt;
    stroke-linejoin: miter;
    stroke-width: 2px;
    fill: var(--color-main);
    font-size: 12px;
}

.deviceMap svg text:hover {
    fill: var(--color-highlight);
}

.deviceMap svg .node {
    stroke: var(--color-main);
    stroke-width: 1.5px;
    fill: var(--background-shade);
}

.deviceMap svg .node:hover {
    stroke: var(--color-error);
}

.deviceMap svg .link {
    stroke: var(--border-main);
    stroke-width: 1px;
}

.deviceMap svg .text {
    fill: var(--color-shade);
    font-size: 9px;
}

.deviceMap svg .highlight {
    stroke: var(--color-warning);
}

.deviceMap .checkbox {
    padding: 0 5px;
}

.exposes td .buttons {
    display: block;
}

.exposes td button {
    height: 18px;
    margin-right: 5px;
    font-size: var(--font-size-tiny);
}

.exposes input[type="number"], .exposes select {
    width: 150px;
    height: 19px;
    margin-bottom: 0;
    font-size: var(--font-size-tiny);
}

.exposes input[type="number"] {
    margin-right: 5px;
    padding-right: 0;
}

.exposes input[type="time"] {
    margin-right: 5px;
}

.exposes textarea {
    margin-bottom: 0;
}

.exposes .label i {
    cursor: pointer;
}

.exposes .label i:not(.invisible):hover {
    color: var(--color-warning);
}

.exposes .value {
    width: 1%;
    min-width: 40px;
    padding-right: 20px;
}

.exposes .value:last-child {
    padding-right: 5px;
}

.exposes .value .color {
    width: 13px;
    height: 13px;
    border-radius: 25%;
}

.exposes .control {
    color: var(--color-shade);
}

.exposes .control span {
    cursor: pointer;
}

.exposes .control span:hover {
    color: var(--color-highlight);
}

.log {
    display: block;
    overflow-y: auto;
    max-height: 480px;
}

.log tr:hover {
    color: var(--color-highlight);
}

.log td:first-child {
    width: 1%;
}

.log .circle {
    width: 8px;
    height: 8px;
    border-radius: 4px;
}

.log .timestamp {
    font-size: var(--font-size-tiny);
    color: var(--color-shade);
}

.datepicker {
    display: none;
    padding: 0 5px 10px 5px;
}

.shift span {
    cursor: pointer;
    font-size: 1.25em;
    color: var(--color-shade);
}

.shift span:hover {
    color: var(--color-highlight);
}

#modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: auto;
    width: 100%;
    height: 100%;
    background-color: var(--modal-background);
    backdrop-filter: blur(5px) grayscale(0.5);
}

#modal label a, #modal label .extend, #modal label .dropdown {
    cursor: pointer;
    text-decoration: none;
    color: var(--color-shade);
}

#modal label a:hover, #modal label .extend:hover, #modal label .dropdown:hover {
    color: var(--color-warning);
}

#modal label .dropdown {
    margin-left: 3px;
}

#modal label .dropdown .item {
    font-size: 1rem;
}

#modal table {
    margin-top: 5px;
    margin-bottom: 20px;
}

#modal tbody tr:first-child td {
    border-top: 1px solid var(--border-shade);
}

#modal tbody tr:last-child td {
    border-bottom: 1px solid var(--border-shade);
}

#modal table.select {
    margin-bottom: 10px;
}

#modal table.select td.icon i {
    margin-right: 6px;
}

#modal table.select td.item {
    overflow: hidden;
    max-width: 100px;
    text-overflow: ellipsis;
}

#modal table.exposes td:first-child {
    width: 1%;
    padding-right: 20px;
}

#modal table td:last-child {
    text-align: right;
}

#modal table td.control, #modal table td.otaData {
    font-family: var(--font-mono);
    font-size: var(--font-size-mono);
}

#modal table td.otaData {
    overflow: hidden;
    max-width: 200px;
    text-overflow: ellipsis;
}

#modal table td.dropdown {
    width: 14px;
}

#modal .data {
    max-width: min(600px, calc(100% - 40px));
    margin: 10px auto;
    padding: 10px;
    border: 1px solid var(--border-shade);
    border-radius: var(--border-radius);
    background-color: var(--background-main);
    box-shadow: var(--box-shadow);
}

#modal .title {
    margin: 0;
    margin-bottom: 10px;
}

#modal .overview {
    padding: 10px 0;
    border-top: 1px solid var(--border-shade);
}

#modal .table {
    position: relative;
    left: -5px;
    width: calc(100% + 10px);
}

#modal .table.overflow {
    overflow-x: auto;
}

#modal .copy {
    cursor: pointer;
    color: var(--color-shade);
}

#modal .copy:hover {
    color: var(--color-warning);
}

#modal .note {
    padding: 0;
    font-size: var(--font-size-tiny);
}

#modal .legend, #modal .log, #modal .states {
    border: none;
}

#modal .groups td:first-child, #modal .legend td:first-child, #modal .states td:first-child {
    width: 120px;
}

#modal .legend td:last-child, #modal .log td:last-child, #modal .states td:last-child {
    text-align: left;
}

#modal .dropdown .list {
    overflow-x: auto;
    min-width: min(400px, calc(100vw - 50px));
    max-width: calc(100vw - 50px);
    max-height: clamp(148px, calc(round(down, 100vh - 220px, 23px) + 56px), 424px);
    box-sizing: border-box;
}

#modal .dropdown .list input[type="text"] {
    margin: 8px 0;
}

#modal .dropdown .item i:first-child {
    margin-right: 6px;
}

#modal .search {
    overflow-y: auto;
    max-height: clamp(100px, calc(round(down, 100vh - 220px, 25px)), 400px);
    margin-bottom: 10px;
}

#modal .search .item {
    overflow: hidden;
    cursor: pointer;
    height: 25px;
    line-height: 25px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#modal .search .item i:first-child {
    margin-right: 6px;
}

#modal .search .current, #modal .search .current .shade {
    color: var(--color-warning);
}

#toast {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 2;
    width: 300px;
}

#toast .item {
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid var(--border-shade);
    border-radius: var(--border-radius);
    background-color: var(--background-main);
    box-sizing: border-box;
    box-shadow: var(--box-shadow);
    text-align: left;
    color: var(--color-main);
}

#toast .message {
    margin: 10px;
}

#toast .success {
    border-left: 5px solid var(--color-success);
}

#toast .warning {
    border-left: 5px solid var(--color-warning);
}

#toast .error {
    border-left: 5px solid var(--color-error);
}

#footerData {
    padding: 0 5px;
}

#hotkeys, #toggleIcons, #toggleTheme, #toggleWide, #logout {
    cursor: pointer;
}

#toggleIcons, #toggleTheme, #toggleWide, #logout {
    padding: 0 5px;
}

#hotkeys:hover, #toggleIcons:hover, #toggleTheme:hover, #toggleWide:hover, #logout:hover {
    color: var(--color-main);
}

@media (hover: hover) and (pointer: fine) {
    .dashboardList span:hover { color: var(--color-highlight); }
}

@media (pointer: coarse) {
    input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; }
    input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; }
}

@media (max-width: 1030px) {
    .narrowHidden { display: none; }
}

@media (max-width: 680px) {
    .mobileHidden { display: none; }
    .header, .footer, .content { padding: 0 5px; }
    .header .dropdown .list { left: 13px; padding-right: 10px;}
    .automationInfo td span { max-width: 150px; }
    .automationInfo td:first-child, .itemInfo td:first-child { width: 75px; }
    .tiled .dashboardBlock tr:not(.label):has(td.value:not([data-type="status"])) td.label .name { font-size: var(--font-size-small); }
    .tiled .dashboardBlock tr[data-size]:has(td.camera) { grid-column: 1 / -1; grid-row: auto; aspect-ratio: auto; }
    .tiled .dashboardBlock tr[data-size] td.camera { display: block; }
    .tiled .dashboardBlock tr[data-size] td.camera video { height: auto; }
    .tiled .dashboardBlock tr[data-size] td.camera .placeholder { height: 20px; }
}