/*
 * Design of the Notify Console (loaded after bootstrap.css).
 * Colors are taken from the logo: light blue #6a9cff, strong blue #1e35ff, red #ff0d17.
 */
:root {
    --app-sidebar-width: 264px;
    --app-sidebar-bg: #0f1a3a;
    --app-sidebar-bg-2: #16285a;
    --app-sidebar-text: rgba(255, 255, 255, .72);
    --app-sidebar-hover: rgba(255, 255, 255, .07);
    --app-accent: #6a9cff;
    --app-accent-strong: #1e35ff;
    --app-bg: #f3f5fa;
    --app-surface: #ffffff;
    --app-surface-2: #f8f9fc;
    --app-border: #e3e7f0;
    --app-text: #1d2433;
    --app-muted: #6b7385;
    --app-radius: .75rem;
    --app-radius-sm: .5rem;
    --app-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
    --app-shadow-lg: 0 12px 32px rgba(15, 26, 58, .16);

    --app-online: #1f9d55;
    --app-idle: #f0a500;
    --app-away: #9aa3b5;
    --app-offline: #dc3545;
    /* faded status colors, background of the device tiles */
    --app-online-soft: rgba(31, 157, 85, .10);
    --app-idle-soft: rgba(240, 165, 0, .12);
    --app-away-soft: rgba(154, 163, 181, .14);
    --app-offline-soft: rgba(220, 53, 69, .09);

    --bs-body-color: var(--app-text);
    --bs-border-color: var(--app-border);
}

body {
    background: var(--app-bg);
    color: var(--app-text);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(106, 156, 255, .3);
}

/* ------------------------------------------------------------------ Sidebar */
.app-sidebar.navbar {
    background: linear-gradient(180deg, var(--app-sidebar-bg) 0%, var(--app-sidebar-bg-2) 100%);
    padding: .75rem 1rem;
    box-shadow: 1px 0 0 rgba(255, 255, 255, .04), 4px 0 24px rgba(15, 26, 58, .12);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    text-decoration: none;
}

.app-brand:hover {
    color: #fff;
}

.app-brand-logo {
    width: 34px;
    height: 42px;
    object-fit: contain;
    background: #fff;
    border-radius: .45rem;
    padding: 3px;
    flex-shrink: 0;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .01em;
}

.app-brand-text small {
    font-weight: 500;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--app-accent);
}

.app-nav-caption {
    color: rgba(255, 255, 255, .4);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 1.25rem .75rem .5rem;
}

.app-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--app-sidebar-text);
    padding: .6rem .75rem !important;
    border-radius: var(--app-radius-sm);
    font-weight: 500;
    position: relative;
    transition: background-color .15s ease, color .15s ease;
}

.app-nav .nav-link i {
    width: 1.25rem;
    text-align: center;
    opacity: .85;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus-visible {
    color: #fff;
    background: var(--app-sidebar-hover);
}

.app-nav .nav-link.active {
    color: #fff;
    background: rgba(106, 156, 255, .18);
}

.app-nav .nav-link.active::before {
    content: "";
    position: absolute;
    left: -1rem;
    top: .45rem;
    bottom: .45rem;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--app-accent);
}

.app-nav .nav-link.active i {
    color: var(--app-accent);
    opacity: 1;
}

.app-nav .nav-item + .nav-item {
    margin-top: 2px;
}

.app-sidebar-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.app-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .75rem;
    color: #fff;
}

.app-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--app-accent) 0%, var(--app-accent-strong) 100%);
    flex-shrink: 0;
}

.app-user-name {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-user-name small {
    font-weight: 400;
    color: rgba(255, 255, 255, .5);
}

.app-logout {
    color: rgba(255, 255, 255, .8);
    border: 1px solid rgba(255, 255, 255, .18);
}

.app-logout:hover,
.app-logout:focus-visible {
    color: #fff;
    background: rgba(220, 53, 69, .85);
    border-color: transparent;
}

@media (min-width: 576px) {
    .app-sidebar.navbar {
        padding: 1.25rem 1rem;
        overflow-y: auto;
    }

    .app-sidebar .navbar-collapse {
        flex: 1 1 auto !important;
        display: flex !important;
    }

    .app-sidebar-footer {
        margin-top: auto;
    }

    .app-brand {
        padding: 0 .25rem;
    }
}

@media (max-width: 575.98px) {
    .app-brand-logo {
        width: 28px;
        height: 34px;
    }

    .app-sidebar .navbar-collapse {
        padding-bottom: .5rem;
    }
}

/* -------------------------------------------------------------- Page header */
.app-content {
    padding: 1.75rem 2rem 3rem !important;
    max-width: 1680px;
}

@media (max-width: 575.98px) {
    .app-content {
        padding: 1rem 1rem 2rem !important;
    }
}

.app-page-header {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1.5rem;
}

.app-page-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--app-accent-strong);
    background: rgba(106, 156, 255, .16);
    flex-shrink: 0;
}

.app-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0;
}

/* -------------------------------------------------------------------- Cards */
.card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    --bs-card-bg: var(--app-surface);
    --bs-card-cap-bg: var(--app-surface);
}

.card > .card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
    padding: .95rem 1.25rem;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    border-radius: var(--app-radius) var(--app-radius) 0 0;
}

.card > .card-header > i:first-child,
.card > .card-header > .bi:first-child {
    color: var(--app-accent-strong);
    width: 1.25rem;
    text-align: center;
}

.card > .card-footer {
    background: var(--app-surface-2);
    border-top: 1px solid var(--app-border);
    border-radius: 0 0 var(--app-radius) var(--app-radius);
    padding: .75rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.app-section-title {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--app-muted);
    margin: 1.5rem 0 .75rem;
}

/* ------------------------------------------------------------------- Tables */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(106, 156, 255, .07);
    margin-bottom: 0;
}

.table > thead th,
.table > tbody > tr > th {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--app-muted);
    background: var(--app-surface-2);
    border-bottom: 1px solid var(--app-border);
    white-space: nowrap;
    padding: .7rem .6rem;
}

.table > thead th.wrap {
    white-space: normal;
}

.table > tbody > tr > td {
    padding: .75rem .6rem;
    border-color: var(--app-border);
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.table td[onclick] {
    cursor: pointer;
}

.table-warning {
    --bs-table-bg: #fff8e6;
    --bs-table-hover-bg: #fff1cc;
    --bs-table-color: var(--app-text);
}

/* logbook: entries of the level danger (lock) */
.table-danger {
    --bs-table-bg: #fdeeef;
    --bs-table-hover-bg: #fae0e3;
    --bs-table-color: var(--app-text);
}

/* tables directly in a card body use the full width of the card */
.card-body > .table-responsive:first-child {
    margin: -1.25rem -1.25rem 0;
    width: auto;
}

.card-body > .table-responsive:first-child:last-child {
    margin-bottom: -1.25rem;
}

.card-body > .table-responsive:first-child .table > thead th:first-child,
.card-body > .table-responsive:first-child .table td:first-child {
    padding-left: 1.25rem;
}

.card-body > .table-responsive:first-child .table > thead th:last-child,
.card-body > .table-responsive:first-child .table td:last-child {
    padding-right: 1.25rem;
}

.app-date {
    display: block;
    font-weight: 600;
    white-space: nowrap;
}

.app-time {
    display: block;
    font-size: .8rem;
    color: var(--app-muted);
    white-space: nowrap;
}

.app-msg-title {
    font-weight: 600;
    color: var(--app-text);
}

.app-msg-type {
    font-size: .78rem;
    color: var(--app-muted);
}

.app-actions {
    display: inline-flex;
    gap: .35rem;
    flex-wrap: nowrap;
}

.app-actions .btn {
    white-space: nowrap;
}

/* progress of deliveries and confirmations */
.app-ratio {
    min-width: 7rem;
}

.app-ratio-text {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    margin-bottom: .3rem;
}

.app-ratio-text span:last-child {
    color: var(--app-muted);
}

.app-progress {
    height: .35rem;
    background: #e9edf5;
    border-radius: 1rem;
}

/* -------------------------------------------------------------------- Chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    margin: .15rem .1rem;
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.3;
    border-radius: 2rem;
    border: 1px solid transparent;
    background: #eef1f6;
    color: #3a4255;
    white-space: nowrap;
    vertical-align: middle;
    text-decoration: none;
}

.chip i {
    font-size: .8em;
    opacity: .85;
}

.chip-group {
    background: rgba(30, 53, 255, .08);
    color: #1b2fb8;
    border-color: rgba(30, 53, 255, .12);
}

.chip-device {
    background: rgba(13, 202, 240, .1);
    color: #087990;
    border-color: rgba(13, 202, 240, .2);
}

.chip-success {
    background: rgba(31, 157, 85, .1);
    color: #146c3b;
    border-color: rgba(31, 157, 85, .22);
}

.chip-warning {
    background: rgba(240, 165, 0, .12);
    color: #8a5d00;
    border-color: rgba(240, 165, 0, .3);
}

.chip-danger {
    background: rgba(220, 53, 69, .08);
    color: #b02a37;
    border-color: rgba(220, 53, 69, .22);
}

.chip-muted {
    background: var(--app-surface);
    color: var(--app-muted);
    border-color: var(--app-border);
}

.chip-meta {
    background: var(--app-surface);
    color: #3a4255;
    border-color: var(--app-border);
}

/* status chips, which can be clicked (reset of the device status) */
button.chip {
    cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease;
}

button.chip:hover {
    box-shadow: 0 2px 8px rgba(16, 24, 40, .12);
    transform: translateY(-1px);
}

.chip .status-dot {
    margin-right: .1rem;
}

/* --------------------------------------------------------- Device status */
.status-dot {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: var(--app-away);
    flex-shrink: 0;
}

.status-online .status-dot,
.status-dot.status-online {
    background: var(--app-online);
    box-shadow: 0 0 0 3px rgba(31, 157, 85, .18);
}

.status-idle .status-dot,
.status-dot.status-idle {
    background: var(--app-idle);
}

.status-away .status-dot,
.status-dot.status-away {
    background: var(--app-away);
}

.status-offline .status-dot,
.status-dot.status-offline {
    background: var(--app-offline);
}

.app-kpi {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.25rem;
    height: 100%;
}

.app-kpi-icon {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.app-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.app-kpi-label {
    font-size: .8rem;
    color: var(--app-muted);
}

.device-group + .device-group {
    margin-top: 1.5rem;
}

.device-group-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 600;
    padding-bottom: .6rem;
    margin-bottom: .75rem;
    border-bottom: 1px solid var(--app-border);
}

.device-group-header > i {
    color: var(--app-accent-strong);
}

.device-group-header .app-group-online {
    margin-left: auto;
    font-size: .8rem;
    font-weight: 500;
    color: var(--app-muted);
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: .65rem;
}

.device-tile {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .85rem;
    background: var(--app-away-soft);
    border: 1px solid var(--app-border);
    border-left: 4px solid var(--app-away);
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
    text-decoration: none;
    min-width: 0;
}

a.device-tile:hover {
    color: var(--app-text);
    box-shadow: var(--app-shadow);
}

.device-tile.status-online {
    border-left-color: var(--app-online);
    background: var(--app-online-soft);
}

.device-tile.status-idle {
    border-left-color: var(--app-idle);
    background: var(--app-idle-soft);
}

.device-tile.status-offline {
    border-left-color: var(--app-offline);
    background: var(--app-offline-soft);
}

/* not assigned to a group: dashed border, the background keeps the status color */
.device-tile.is-unassigned {
    border-style: dashed;
    border-left-style: solid;
}

.device-tile > i {
    color: var(--app-muted);
}

.device-tile-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.device-tile-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-tile-meta {
    font-size: .76rem;
    color: var(--app-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    font-size: .85rem;
    color: var(--app-muted);
}

.app-legend > span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.app-empty {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .9rem 1rem;
    color: var(--app-muted);
    background: var(--app-surface-2);
    border: 1px dashed var(--app-border);
    border-radius: var(--app-radius-sm);
}

/* ------------------------------------------------------- Changelog (download) */
.changelog-table th {
    font-size: .74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--app-muted);
}

.changelog-table td {
    vertical-align: top;
    padding-top: .65rem;
    padding-bottom: .65rem;
}

.changelog-date {
    width: 6.5rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.changelog-day {
    display: block;
    font-size: .82rem;
    color: var(--app-text);
}

.changelog-time {
    display: block;
    font-size: .74rem;
    color: var(--app-muted);
}

.changelog-version {
    width: 5.5rem;
    white-space: nowrap;
}

.changelog-chip {
    display: inline-block;
    padding: .1rem .5rem;
    font-size: .76rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    color: var(--app-muted);
    background: var(--app-surface-2);
    border: 1px solid var(--app-border);
    border-radius: 999px;
}

/* newest version (= CLIENT_VERSION in the database) */
.changelog-chip.is-current {
    color: #146c3b;
    background: var(--app-online-soft);
    border-color: rgba(31, 157, 85, .22);
}

.changelog-changes {
    font-size: .9rem;
}

.changelog-changes ul {
    padding-left: 1.1rem;
}

.changelog-changes li + li {
    margin-top: .2rem;
}

/* ------------------------------------------------------------------- Alerts */
.alert {
    border: 1px solid transparent;
    border-left-width: 4px;
    border-radius: var(--app-radius-sm);
    box-shadow: var(--app-shadow);
}

.alert-success {
    border-left-color: var(--bs-success);
}

.alert-danger {
    border-left-color: var(--bs-danger);
}

.alert-warning {
    border-left-color: var(--bs-warning);
}

.alert-info {
    border-left-color: var(--bs-info);
}

/* ------------------------------------------------------------ Forms/buttons */
.form-label {
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: .4rem;
}

.form-control,
.form-select,
.input-group-text {
    border-color: #d5dbe7;
}

.input-group-text {
    background: var(--app-surface-2);
    color: #3a4255;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 .2rem rgba(106, 156, 255, .25);
}

.btn {
    font-weight: 500;
}

.btn-sm {
    --bs-btn-padding-x: .6rem;
}

.btn-primary {
    box-shadow: 0 1px 2px rgba(13, 110, 253, .25);
}

.modal-content {
    border: 0;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-lg);
}

/* receivers select of a new message */
select[name="receivers[]"] {
    padding: .5rem;
    border-radius: var(--app-radius-sm);
}

select[name="receivers[]"] option.optionGroup {
    margin-top: .35rem;
    border-radius: .4rem;
    background: rgba(30, 53, 255, .07);
    color: #1b2fb8;
}

select[name="receivers[]"] option.optionDevice {
    border: 1px solid var(--app-border);
    border-radius: 2rem;
    padding: .3rem .8rem;
}

select[name="receivers[]"] option:checked {
    background: var(--app-accent-strong) linear-gradient(0deg, var(--app-accent-strong), var(--app-accent-strong));
    color: #fff;
}

/* text editors of a message (messageEditor() in ui.php) */
.htmleditor-area {
    min-height: 300px;
    overflow: auto;
}

#quillArea {
    min-height: 300px;
}

/* same font as in the client (bootstrap) instead of the Quill default */
#quillArea .ql-editor {
    font-family: inherit;
    font-size: 1rem;
}

/* edit history below a message (message.php) */
.app-msg-edits {
    margin-top: 1.25rem;
    padding-top: .75rem;
    border-top: 1px dashed var(--app-border);
    font-size: .85rem;
    color: var(--app-muted);
}

.app-msg-edits > div + div {
    margin-top: .25rem;
}

.app-msg-edits i {
    margin-right: .4rem;
}

/* ------------------------------------------------------------- Login page */
body.app-login {
    margin-left: 0 !important;
    padding-top: 0 !important;
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(106, 156, 255, .35), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(30, 53, 255, .25), transparent 60%),
        linear-gradient(160deg, var(--app-sidebar-bg) 0%, var(--app-sidebar-bg-2) 100%);
}

.app-login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.app-login-card {
    width: 100%;
    max-width: 23rem;
    border: 0;
    box-shadow: var(--app-shadow-lg);
}

.app-login-card .card-body {
    padding: 2rem;
}

.app-login-logo {
    height: 88px;
    width: auto;
}

.app-login-footer {
    margin-top: 1.25rem;
    font-size: .8rem;
    color: rgba(255, 255, 255, .55);
}

.app-login-card.app-login-card-wide {
    max-width: 27rem;
}

/* --------------------------------------------------------- User management */
.app-row-inactive > td {
    opacity: .6;
}

.app-row-inactive > td:last-child {
    opacity: 1;
}

/* rows of the dashboard, which open the message */
tr.app-row-link > td {
    cursor: pointer;
}

/* -------------------------------------------------------- Device management */
/* group name, which opens and closes the devices of the group */
a.chip {
    text-decoration: none;
    transition: box-shadow .15s ease, transform .15s ease;
}

a.chip:hover {
    box-shadow: 0 2px 8px rgba(16, 24, 40, .12);
    transform: translateY(-1px);
}

/* opened group and its devices below */
.table > tbody > tr.app-group-open > td {
    background: var(--app-surface-2);
    border-bottom: 0;
}

.table > tbody > tr.app-group-devices > td {
    background: var(--app-surface-2);
    padding: 0 .6rem 1rem 2rem;
}

.table-hover > tbody > tr.app-group-devices:hover > * {
    --bs-table-bg-state: transparent;
}

.app-group-devices .table {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
}

/* order of groups and devices: switch (alphabetical / manual) and drag & drop of rows (app.js) */
.app-sort-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1.25rem;
    margin-bottom: .75rem;
}

.app-sort-switch {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.app-sort-switch .btn {
    white-space: nowrap;
}

.app-drag-handle {
    width: 2rem;
    color: var(--app-muted);
    text-align: center;
    cursor: grab;
    user-select: none;
    /* touch: the row is dragged instead of scrolling the page (app.js) */
    touch-action: none;
    -webkit-user-select: none;
}

.app-drag-handle:active {
    cursor: grabbing;
}

.table > tbody > tr.app-dragging > td {
    opacity: .35;
}

.table > tbody > tr.app-drop-before > td {
    box-shadow: inset 0 3px 0 0 var(--app-accent-strong);
}

.table > tbody > tr.app-drop-after > td {
    box-shadow: inset 0 -3px 0 0 var(--app-accent-strong);
}

/* ----------------------------------------------- Two-factor authentication */
.app-totp-setup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--app-surface-2);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
}

/* white frame around the code, so it can be scanned well */
.app-qrcode {
    width: 11rem;
    height: 11rem;
    flex: none;
    padding: .6rem;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
}

.app-qrcode svg {
    display: block;
    width: 100%;
    height: 100%;
}

.app-totp-key {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
    font-size: .8rem;
    color: var(--app-muted);
}

.app-totp-key code {
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .04em;
    word-spacing: .2em;
    color: var(--app-text);
    padding: .45rem .6rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    word-break: break-word;
}

.app-login-card .app-totp-setup {
    flex-direction: column;
    text-align: center;
}

.app-totp-code {
    max-width: 12rem;
    font-family: var(--bs-font-monospace);
    font-size: 1.25rem;
    letter-spacing: .3em;
}

.app-login-card .app-totp-code {
    max-width: none;
    text-align: center;
}

/* code of the current app (new phone, deactivate) */
.app-totp-current {
    width: auto;
    flex: 0 1 18rem;
}

.app-totp-current .app-totp-code {
    max-width: none;
    font-size: 1rem;
}

/* ------------------------------------------------- Device statistics (devicestats.php): online timeline */
.app-timeline-row {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.app-timeline-row + .app-timeline-row {
    margin-top: .4rem;
}

.app-timeline-label {
    flex: 0 0 4.5rem;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}

.app-timeline-sum {
    flex: 0 0 5.5rem;
    font-size: .8rem;
    color: var(--app-muted);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* one day, the grid lines mark 3 hours */
.app-timeline-bar {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 1.25rem;
    border-radius: .25rem;
    background-color: #e9edf5;
    background-image: repeating-linear-gradient(to right, rgba(16, 24, 40, .12) 0, rgba(16, 24, 40, .12) 1px, transparent 1px, transparent 12.5%);
    overflow: hidden;
}

.app-timeline-axis .app-timeline-bar {
    height: 1rem;
    background: none;
    overflow: visible;
}

.app-timeline-hours span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: .72rem;
    line-height: 1rem;
    color: var(--app-muted);
}

.app-timeline-hours span:first-child {
    transform: none;
}

.app-timeline-hours span:last-child {
    transform: translateX(-100%);
}

.app-timeline-seg {
    position: absolute;
    top: 2px;
    bottom: 2px;
    min-width: 2px;
    border-radius: 2px;
    background: var(--app-online);
}

.app-timeline-future {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    background: var(--app-surface-2);
}

.app-timeline-now {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--app-accent-strong);
}

.app-swatch {
    display: inline-block;
    width: .9rem;
    height: .6rem;
    border-radius: 2px;
}

.app-swatch-online {
    background: var(--app-online);
}

.app-swatch-offline {
    background: #e9edf5;
    border: 1px solid rgba(16, 24, 40, .12);
}

.app-swatch-future {
    background: var(--app-surface-2);
    border: 1px solid var(--app-border);
}
