body {
    margin: 0;
    min-height: 100dvh;
    overflow-x: hidden;
}

body > .page {
    min-height: 100dvh;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.page > .navbar,
.page > .navbar .navbar-nav,
.page > .navbar .navbar-nav .nav-link {
    min-height: 2.25rem;
}

.page > .navbar {
    --tblr-navbar-brand-padding-y: .125rem;
}

#twitch {
    color: #8956fb
}

[x-cloak] {
    display: none !important;
}

.fade {
    transition-duration: 0.1s !important;
}

.icon-sm {
    font-size: .875rem;
}

.icon-md {
    font-size: 1.25rem;
}

.icon-lg {
    font-size: 1.50rem;
}

.icon-xl {
    font-size: 2.00rem;
}

:root .form-help,
[data-bs-theme='dark'] .form-help {
    color: var(--sg-color-text-muted);
    background: var(--sg-color-surface-2);
}

[data-bs-theme='light'] .form-help {
    color: var(--tblr-secondary);
    background: var(--tblr-gray-100);
}

.form-help:hover,
.form-help[aria-describedby] {
    color: #fff;
    background: var(--tblr-info);
}

.auto-start-attention-badge {
    display: none !important;
}

.channel-list-needs-autostart .auto-start-attention-badge {
    display: inline-flex !important;
}

.user-doc-popover {
    max-width: 28rem;
}

.user-doc-popover .popover-body {
    font-size: 0.8125rem;
    line-height: 1.45;
    max-height: min(70vh, 28rem);
    overflow-y: auto;
}

.user-doc-popover .popover-body > :last-child,
.user-doc-popover .popover-body .markdown > :last-child {
    margin-bottom: 0;
}

.user-doc-popover .popover-body .markdown {
    line-height: 1.45;
}

.user-doc-popover .popover-body p {
    margin-bottom: 0.75rem;
}

.user-doc-popover .popover-body ul,
.user-doc-popover .popover-body ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-left: 0;
    margin: 0 0 0.75rem;
}

.user-doc-popover .popover-body ul > li,
.user-doc-popover .popover-body ol > li {
    position: relative;
    padding-left: 1.1rem;
    color: var(--tblr-secondary);
}

.user-doc-popover .popover-body ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: var(--tblr-border-radius-pill);
    background: var(--tblr-primary);
}

.user-doc-popover .popover-body ol {
    counter-reset: user-doc;
}

.user-doc-popover .popover-body ol > li {
    counter-increment: user-doc;
}

.user-doc-popover .popover-body ol > li::before {
    content: counter(user-doc);
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 0.85rem;
    font-size: 0.7rem;
    font-weight: var(--tblr-font-weight-bold);
    line-height: 1.2;
    color: var(--tblr-primary);
}

.user-doc-popover .popover-body strong {
    color: var(--tblr-body-color);
    font-weight: var(--tblr-font-weight-bold);
}

.icon-xxl {
    font-size: 3.00rem;
}

.icon-xxxl {
    font-size: 4.00rem;
}

/*same as tablers .btn-action but without interfering with .btn-loading*/
.btn-icon-square {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.text-transform-none {
    text-transform: none !important;
}

.slot-lifecycle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--sg-color-text);
}

.slot-lifecycle-spinner {
    display: grid;
    width: clamp(3.5rem, 8vw, 5rem);
    aspect-ratio: 1;
    margin-bottom: 1.5rem;
}

.slot-lifecycle-spinner::before,
.slot-lifecycle-spinner::after {
    grid-area: 1 / 1;
    content: '';
    --slot-lifecycle-stroke: no-repeat linear-gradient(var(--sg-color-primary) 0 0);
    background: var(--slot-lifecycle-stroke) 0 0,
    var(--slot-lifecycle-stroke) 100% 0,
    var(--slot-lifecycle-stroke) 100% 100%,
    var(--slot-lifecycle-stroke) 0 100%;
    animation: slot-lifecycle-trace 2s linear infinite, slot-lifecycle-turn 2s linear infinite;
}

.slot-lifecycle-spinner::after {
    margin: 25%;
    transform: scale(-1);
}

@keyframes slot-lifecycle-trace {
    0% {
        background-size: 0 4px, 4px 0, 0 4px, 4px 0;
    }

    12.5% {
        background-size: 100% 4px, 4px 0, 0 4px, 4px 0;
    }

    25% {
        background-size: 100% 4px, 4px 100%, 0 4px, 4px 0;
    }

    37.5% {
        background-size: 100% 4px, 4px 100%, 100% 4px, 4px 0;
    }

    45%, 55% {
        background-size: 100% 4px, 4px 100%, 100% 4px, 4px 100%;
    }

    62.5% {
        background-size: 0 4px, 4px 100%, 100% 4px, 4px 100%;
    }

    75% {
        background-size: 0 4px, 4px 0, 100% 4px, 4px 100%;
    }

    87.5% {
        background-size: 0 4px, 4px 0, 0 4px, 4px 100%;
    }

    100% {
        background-size: 0 4px, 4px 0, 0 4px, 4px 0;
    }
}

@keyframes slot-lifecycle-turn {
    0%, 49.9% {
        background-position: 0 0, 100% 0, 100% 100%, 0 100%;
    }

    50%, 100% {
        background-position: 100% 0, 100% 100%, 0 100%, 0 0;
    }
}

.slot-lifecycle-title,
.slot-power-off-title,
.slot-power-control-label,
.streamgrid-waiting-for-signal {
    font-family: var(--sg-font-accent);
}

.slot-lifecycle-title {
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sg-color-text-muted);
}

.slot-lifecycle-title-pulse {
    animation: sg-opacity-pulse 2.4s ease-in-out infinite;
}

.slot-loading {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.slot-loading .slot-lifecycle {
    position: relative;
    z-index: 1;
    transition: opacity 180ms ease;
}

.slot-studio-reveal-morph {
    position: absolute;
    left: 50%;
    top: 50%;
    width: clamp(3.5rem, 8vw, 5rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(
            155deg,
            color-mix(in srgb, #ffffff 10%, var(--sg-color-primary) 2%) 0%,
            color-mix(in srgb, var(--sg-color-primary) 6%, transparent) 48%,
            color-mix(in srgb, #000000 7%, transparent) 100%
    ),
    color-mix(in srgb, var(--sg-color-primary-ui) 34%, transparent);
    border: 1px solid color-mix(in srgb, var(--sg-color-primary) 30%, #ffffff 5%);
    box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 16%, transparent),
    inset 0 -1px 0 color-mix(in srgb, #000000 10%, transparent),
    0 .14rem .38rem color-mix(in srgb, #000000 13%, transparent);
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: transform 1200ms cubic-bezier(.22, 1, .36, 1),
    border-radius 1200ms cubic-bezier(.22, 1, .36, 1),
    background 1200ms cubic-bezier(.22, 1, .36, 1),
    border-color 1200ms cubic-bezier(.22, 1, .36, 1),
    box-shadow 1200ms cubic-bezier(.22, 1, .36, 1),
    opacity 200ms ease;
    will-change: transform, opacity, border-radius, background;
}

.slot-loading.is-revealing-studio .slot-studio-reveal-morph {
    opacity: 1;
    border-radius: 0;
    border-color: transparent;
    box-shadow: none;
    background: #0B0B0B;
    transform: translate(-50%, -50%) scale(42);
}

.slot-loading.is-revealing-studio .slot-lifecycle {
    opacity: 0;
}

.slot-power-off {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.slot-power-off-title {
    margin-bottom: 1.75rem;
    color: var(--sg-color-text-muted);
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.slot-power-control-form {
    margin: 0;
}

.slot-power-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(11rem, 22vw, 16rem);
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--sg-color-primary) 38%, var(--sg-color-border));
    border-radius: 50%;
    color: var(--sg-color-primary);
    background: radial-gradient(circle at 35% 28%, color-mix(in srgb, #ffffff 13%, transparent), transparent 42%),
    linear-gradient(145deg, var(--sg-color-surface-1), var(--sg-color-surface-2));
    box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 14%, transparent),
    inset 0 -1rem 2rem color-mix(in srgb, #000000 8%, transparent),
    0 .65rem 1.5rem color-mix(in srgb, #000000 18%, transparent);
    cursor: pointer;
    transition: transform .16s ease-out, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}

[data-bs-theme='dark'] .slot-power-control {
    background: radial-gradient(circle at 35% 28%, color-mix(in srgb, #ffffff 4%, transparent), transparent 38%),
    linear-gradient(145deg, var(--sg-color-surface-1), var(--sg-color-surface-2));
    box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 5%, transparent),
    inset 0 -1rem 2rem color-mix(in srgb, #000000 18%, transparent),
    0 .65rem 1.5rem color-mix(in srgb, #000000 28%, transparent);
}

.slot-power-control:hover,
.slot-power-control:focus-visible {
    border-color: color-mix(in srgb, var(--sg-color-primary) 72%, var(--sg-color-border));
    color: var(--sg-color-primary-hover);
    box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 17%, transparent),
    inset 0 -1rem 2rem color-mix(in srgb, #000000 8%, transparent),
    0 0 1.35rem color-mix(in srgb, var(--sg-color-primary) 24%, transparent),
    0 .65rem 1.5rem color-mix(in srgb, #000000 18%, transparent);
}

[data-bs-theme='dark'] .slot-power-control:hover,
[data-bs-theme='dark'] .slot-power-control:focus-visible {
    box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 6%, transparent),
    inset 0 -1rem 2rem color-mix(in srgb, #000000 18%, transparent),
    0 0 1.35rem color-mix(in srgb, var(--sg-color-primary) 14%, transparent),
    0 .65rem 1.5rem color-mix(in srgb, #000000 28%, transparent);
}

.slot-power-control:active {
    transform: translateY(.3rem);
    box-shadow: inset 0 .25rem .8rem color-mix(in srgb, #000000 18%, transparent),
    0 .25rem .65rem color-mix(in srgb, #000000 18%, transparent);
}

.slot-power-control:focus-visible {
    outline: none;
}

.slot-power-control:disabled {
    cursor: default;
    opacity: .55;
}

.slot-power-control-icon {
    --tblr-icon-size: clamp(3rem, 6vw, 4.5rem);
    flex-shrink: 0;
    margin-bottom: .8rem;
    line-height: 1;
}

.slot-power-control-label {
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .08em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}

.streamgrid-waiting-for-signal {
    margin: 2.75rem 0 0;
    color: var(--sg-color-text-muted);
    font-size: 1.125rem;
    animation: sg-opacity-pulse 2.4s ease-in-out infinite;
}

@keyframes sg-opacity-pulse {
    0%, 100% {
        opacity: .45;
    }

    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .slot-power-control,
    .slot-studio-reveal-morph,
    .slot-loading .slot-lifecycle {
        transition: none;
    }

    .slot-lifecycle-title-pulse,
    .streamgrid-waiting-for-signal {
        animation: none;
    }
}
