:root {
    --app-surface: #f5f7fa;
    --app-panel: #ffffff;
    --app-ink: #172033;
    --app-muted: #64748b;
    --app-accent: #db3a34;
    --app-accent-strong: #b92722;
    --app-border: #d9e0e8;
}

[data-bs-theme='dark'] {
    --app-surface: #151719;
    --app-panel: #202327;
    --app-ink: #f4f6f8;
    --app-muted: #aab4c2;
    --app-accent: #ff6b63;
    --app-accent-strong: #ff8b85;
    --app-border: #3b4148;
}

body.app-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--app-ink);
    background: var(--app-surface);
}

body.app-body > main {
    flex: 1 0 auto;
}

.app-header {
    position: relative;
    z-index: 1030;
    background: var(--app-panel);
    border-color: var(--app-border) !important;
}

.navbar-brand {
    color: var(--app-ink);
    font-weight: 700;
}

.brand-logo {
    width: auto;
    height: 3rem;
    display: block;
}

.theme-icon-dark,
[data-bs-theme='dark'] .theme-icon-light {
    display: none;
}

[data-bs-theme='dark'] .theme-icon-dark {
    display: inline-block;
}

.notification-menu-toggle {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navbar-help-link {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-count {
    min-width: 1.35rem;
}

.notification-dropdown {
    width: min(24rem, calc(100vw - 2rem));
    overflow: hidden;
}

.notification-preview {
    position: relative;
    padding: 0.85rem 1rem;
}

.notification-preview-icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    flex: 0 0 2rem;
    align-items: center;
    justify-content: center;
}

.notification-preview-body,
.notification-table-preview {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
}

.notification-preview-body {
    -webkit-line-clamp: 2;
}

.notification-table-preview {
    max-width: 28rem;
    -webkit-line-clamp: 2;
}

.notification-preference-row:first-of-type {
    border-top: 0 !important;
}

.min-w-0 {
    min-width: 0;
}

.public-home {
    min-height: calc(100vh - 5rem);
    display: grid;
    place-items: center;
    padding: 4rem 0 7rem;
    background: var(--app-panel);
}

.public-home-inner {
    max-width: 42rem;
}

.public-home-logo {
    width: min(22rem, 80vw);
    height: auto;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-block: 1px solid var(--app-border);
}

.dashboard-stat {
    min-height: 8.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem;
    border-right: 1px solid var(--app-border);
}

.dashboard-stat:last-child {
    border-right: 0;
}

.dashboard-stat-value,
.dashboard-stat-label {
    display: block;
}

.dashboard-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.dashboard-stat-label {
    margin-top: 0.35rem;
    font-weight: 600;
}

.dashboard-section-heading {
    min-height: 3.75rem;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--app-border);
}

.dashboard-list-row,
.dashboard-download-row {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--app-border);
    transition: background-color 120ms ease;
}

.dashboard-list-row:hover,
.dashboard-download-row:hover {
    color: inherit;
    background: var(--app-panel);
}

.dashboard-list-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto 1rem;
    align-items: center;
    gap: 1rem;
    min-height: 5rem;
    padding: 0.85rem 0.65rem;
}

.dashboard-list-main,
.dashboard-list-meta,
.dashboard-download-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-list-main strong,
.dashboard-download-heading strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-list-meta {
    align-items: flex-end;
    gap: 0.3rem;
}

.dashboard-list-chevron {
    color: var(--app-muted);
    font-size: 0.75rem;
}

.dashboard-download-row {
    display: grid;
    gap: 0.55rem;
    min-height: 6.25rem;
    padding: 0.9rem 0.65rem;
}

.dashboard-download-status {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--app-muted);
    font-size: 0.8rem;
}

.dashboard-progress {
    width: 100%;
    height: 0.55rem;
    display: block;
}

.dashboard-download-eta {
    display: block;
    line-height: 1.25;
}

.dashboard-empty-state {
    min-height: 9rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 0.65rem;
    border-bottom: 1px solid var(--app-border);
}

.curation-notes {
    white-space: pre-wrap;
}

.card,
.alert,
.form-control,
.form-select,
.btn,
.dropdown-menu {
    border-radius: 8px;
}

.card {
    border-color: var(--app-border);
}

.media-owner-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
}

.collection-poster {
    --collection-poster-width: 2.75rem;
    --poster-aspect-ratio: 2 / 3;
    position: relative;
    width: var(--collection-poster-width);
    aspect-ratio: var(--poster-aspect-ratio);
    flex: 0 0 var(--collection-poster-width);
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--bs-tertiary-bg);
}

.collection-poster--header {
    --collection-poster-width: 3.5rem;
}

.collection-poster--detail {
    --collection-poster-width: 8rem;
}

.collection-poster-fallback,
.collection-poster-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.imdb-search-column {
    border-top: 1px solid var(--app-border);
    padding-top: 1.5rem;
}

.imdb-search-message {
    display: grid;
    min-height: 8rem;
    place-items: center;
    border: 1px dashed var(--app-border);
    border-radius: 6px;
    text-align: center;
}

.imdb-search-result {
    display: flex;
    width: 100%;
    min-height: 6.5rem;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-align: left;
}

.imdb-search-result:hover,
.imdb-search-result:focus-visible {
    border-color: var(--bs-primary);
    background: var(--bs-tertiary-bg);
}

.imdb-search-result[aria-pressed="true"] {
    border-color: var(--bs-success);
    box-shadow: inset 0 0 0 1px var(--bs-success);
}

.imdb-search-result-copy {
    min-width: 0;
}

.imdb-search-poster {
    --poster-aspect-ratio: 2 / 3;
    position: relative;
    width: 4rem;
    aspect-ratio: var(--poster-aspect-ratio);
    flex: 0 0 4rem;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--bs-tertiary-bg);
}

.imdb-search-poster-fallback,
.imdb-search-poster-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.imdb-search-poster-fallback {
    display: grid;
    place-items: center;
    color: var(--app-muted);
    font-size: 1.25rem;
}

.imdb-search-poster-image {
    z-index: 1;
    display: block;
    object-fit: cover;
}

@media (min-width: 992px) {
    .imdb-search-column {
        border-top: 0;
        border-left: 1px solid var(--app-border);
        padding-top: 0;
        padding-left: 1.5rem;
    }
}

.collection-poster-fallback {
    display: grid;
    place-items: center;
    color: var(--app-muted);
    font-size: calc(var(--collection-poster-width) * 0.34);
}

.collection-poster-image {
    z-index: 1;
    display: block;
    object-fit: cover;
    background: var(--bs-tertiary-bg);
}

.collection-table-identity,
.collection-page-heading,
.collection-metadata-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.collection-table-identity {
    min-width: 14rem;
}

.collection-table-identity-copy,
.collection-page-heading-copy,
.collection-metadata-summary-copy {
    min-width: 0;
}

.collection-page-heading {
    flex: 1 1 auto;
}

.collection-page-heading-copy h1 {
    overflow-wrap: anywhere;
}

.collection-metadata-summary {
    align-items: flex-start;
}

.collection-metadata-summary-copy {
    flex: 1 1 auto;
}

.omdb-details-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.45fr);
    gap: 2rem;
    align-items: start;
}

.omdb-plot {
    max-width: 58rem;
    color: var(--app-ink);
    font-size: 1.05rem;
    line-height: 1.7;
}

.omdb-highlights {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--app-muted);
}

.omdb-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    margin-top: 2rem;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--bs-tertiary-bg);
}

.omdb-score {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.15rem;
    border-right: 1px solid var(--app-border);
}

.omdb-score:last-child {
    border-right: 0;
}

.omdb-score-icon {
    flex: 0 0 auto;
    font-size: 1.25rem;
}

.omdb-score strong,
.omdb-score span {
    display: block;
}

.omdb-score strong {
    font-size: 1.2rem;
}

.omdb-score div > span {
    margin-top: 0.15rem;
    color: var(--app-muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.omdb-score-source strong {
    font-size: 1rem;
}

.omdb-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2rem;
    margin-top: 2rem;
}

.omdb-facts > div {
    min-width: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--app-border);
}

.omdb-facts dt {
    margin-bottom: 0.3rem;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.omdb-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.torrent-download-table {
    font-size: 0.875rem;
}

.torrent-download-table thead th > a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.torrent-download-table thead th > a > .float-end {
    order: 2;
    float: none !important;
    line-height: 1;
}

.torrent-hash {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.torrent-progress-cell {
    width: 17%;
    min-width: 13.5rem;
}

.torrent-progress-details {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.125rem 0.75rem;
    margin-top: 0.25rem;
}

.torrent-progress-size {
    margin-left: auto;
    white-space: nowrap;
}

.torrent-name-cell {
    width: 20%;
    min-width: 11rem;
}

.torrent-added-by-cell {
    width: 8rem;
    min-width: 7rem;
}

.torrent-timestamp-cell {
    width: 7.25rem;
    min-width: 6.75rem;
}

.torrent-updated-cell {
    width: 6.75rem;
    min-width: 6.25rem;
}

.torrent-speed-cell {
    min-width: 4.75rem;
}

.torrent-count-cell {
    min-width: 4.25rem;
}

td.torrent-timestamp-cell {
    font-size: 0.8rem;
    line-height: 1.35;
}

.torrent-progress {
    width: 100%;
    height: 0.65rem;
    display: block;
}

.dashboard-progress,
.torrent-progress {
    overflow: hidden;
    border: 0;
    border-radius: var(--bs-border-radius-pill);
    appearance: none;
    background-color: var(--bs-secondary-bg);
}

.dashboard-progress::-webkit-progress-bar,
.torrent-progress::-webkit-progress-bar {
    background-color: var(--bs-secondary-bg);
}

.dashboard-progress::-webkit-progress-value,
.torrent-progress::-webkit-progress-value,
.dashboard-progress::-moz-progress-bar,
.torrent-progress::-moz-progress-bar {
    background-color: var(--bs-success);
    background-image: linear-gradient(
        45deg,
        rgb(255 255 255 / 20%) 25%,
        transparent 25%,
        transparent 50%,
        rgb(255 255 255 / 20%) 50%,
        rgb(255 255 255 / 20%) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

.torrent-progress-animated::-webkit-progress-value,
.torrent-progress-animated::-moz-progress-bar {
    animation: torrent-progress-stripes 1s linear infinite;
}

@keyframes torrent-progress-stripes {
    from {
        background-position-x: 1rem;
    }

    to {
        background-position-x: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .torrent-progress-animated::-webkit-progress-value,
    .torrent-progress-animated::-moz-progress-bar {
        animation: none;
    }
}

.app-narrow-container {
    max-width: 52rem;
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile-avatar {
    display: inline-flex;
    flex: 0 0 6rem;
    width: 6rem;
    height: 6rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    color: var(--app-muted);
    background: var(--bs-tertiary-bg);
    font-size: 2.25rem;
}

.user-profile-details {
    min-width: 0;
}

.user-profile-email {
    color: var(--app-muted);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2rem;
}

.admin-user-table th,
.admin-user-table td {
    vertical-align: middle;
}

.admin-user-section-icon,
.admin-user-role-icon {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
}

.admin-user-section-icon {
    background: var(--bs-secondary-bg);
    border-radius: 50%;
    height: 2.75rem;
    width: 2.75rem;
}

.admin-user-role-icon {
    background: var(--bs-tertiary-bg);
    border-radius: 0.375rem;
    color: var(--bs-secondary-color);
    height: 2.5rem;
    width: 2.5rem;
}

.admin-user-role-card,
.admin-user-role-summary {
    align-items: flex-start;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    display: flex;
    gap: 0.875rem;
    padding: 1rem;
}

.admin-user-role-card {
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.admin-user-role-card:hover,
.admin-user-role-card:focus-within {
    border-color: var(--bs-primary);
}

.admin-user-role-card:has(.form-check-input:checked) {
    background: rgba(var(--bs-primary-rgb), 0.08);
    border-color: rgba(var(--bs-primary-rgb), 0.65);
}

.admin-user-role-card:has(.form-check-input:disabled) {
    cursor: default;
}

.user-role-badge {
    border: 1px solid transparent;
}

.user-role-badge--admin {
    color: #2c2100;
    background-color: #d9b84e;
    border-color: #a88213;
}

.user-role-badge--curator {
    color: #202428;
    background-color: #c9ced4;
    border-color: #8e969e;
}

.help-intro {
    max-width: 48rem;
}

.help-tutorial-callout {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--app-panel);
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--app-accent);
    border-radius: 0.5rem;
}

.help-tutorial-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    font-size: 1.2rem;
}

.account-tutorial-section {
    scroll-margin-top: 5rem;
}

.help-kicker {
    color: var(--app-accent);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.help-flow {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-block: 1px solid var(--app-border);
}

.help-flow-step {
    min-width: 0;
    min-height: 5.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem;
    color: inherit;
    text-decoration: none;
    border-right: 1px solid var(--app-border);
    transition: background-color 120ms ease;
}

.help-flow-step:last-child {
    border-right: 0;
}

.help-flow-step:hover {
    color: inherit;
    background: var(--app-panel);
}

.help-flow-step > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.help-flow-step small {
    color: var(--app-muted);
}

.help-flow-icon,
.help-section-icon,
.help-choice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.help-flow-icon {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

.help-guide {
    border-top: 1px solid var(--app-border);
}

.help-section {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 1.5rem;
    padding: 4rem 0;
    border-bottom: 1px solid var(--app-border);
    scroll-margin-top: 5rem;
}

.help-section-aside {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0.75rem;
}

.help-section-icon {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.25rem;
}

.help-section-number {
    color: var(--app-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.help-section-content {
    max-width: 62rem;
}

.help-section-lead {
    max-width: 54rem;
    color: var(--app-muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

.help-callout {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.8rem;
    max-width: 54rem;
    padding: 1rem 1.15rem;
    background: var(--app-panel);
    border-left: 3px solid var(--app-accent);
}

.help-callout > i {
    text-align: center;
    font-size: 1.15rem;
}

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

.help-choice-card {
    height: 100%;
    border-color: var(--app-border);
    border-radius: 0.5rem;
}

.help-choice-icon {
    width: 2.75rem;
    height: 2.75rem;
}

.help-point {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 0.75rem;
}

.help-point > i {
    padding-top: 0.15rem;
    font-size: 1.15rem;
    text-align: center;
}

.help-point h3 {
    margin-bottom: 0.3rem;
}

.help-point p {
    margin-bottom: 0;
    color: var(--app-muted);
    font-size: 0.9rem;
}

.help-preview-type {
    min-height: 9rem;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.15rem;
    background: var(--app-panel);
    border: 1px solid var(--app-border);
    border-radius: 0.5rem;
}

.help-preview-type > i {
    color: var(--app-accent);
    font-size: 1.35rem;
}

.help-preview-type span {
    color: var(--app-muted);
    font-size: 0.9rem;
}

.help-finish {
    padding: 2rem 0;
    border-block: 1px solid var(--app-border);
}

@media (max-width: 767.98px) {
    .help-tutorial-callout {
        grid-template-columns: 3.25rem minmax(0, 1fr);
    }

    .help-tutorial-callout > .btn {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

.btn-primary {
    --bs-btn-bg: var(--app-accent);
    --bs-btn-border-color: var(--app-accent);
    --bs-btn-hover-bg: var(--app-accent-strong);
    --bs-btn-hover-border-color: var(--app-accent-strong);
}

.app-footer {
    padding: 1.5rem 0;
    color: var(--app-muted);
    background: var(--app-panel);
    border-color: var(--app-border) !important;
}

.tutorial-widget {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1085;
    width: min(22rem, calc(100vw - 2rem));
    overflow: visible;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    transition: opacity .15s ease, visibility 0s linear 0s;
}

.tutorial-widget-suspended {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, visibility 0s linear .15s;
}

.tutorial-widget[data-tutorial-placement="browser-top-left"][data-tutorial-on-page="true"] {
    right: auto;
    bottom: auto;
    left: 1rem;
    top: 3rem;
}

.tutorial-browser-permission-indicator {
    display: none;
}

.tutorial-widget[data-tutorial-placement="browser-top-left"][data-tutorial-on-page="true"] .tutorial-browser-permission-indicator {
    position: absolute;
    top: -2.25rem;
    left: 1.25rem;
    display: block;
    color: var(--bs-primary);
    font-size: 1.65rem;
    line-height: 1;
    filter: drop-shadow(0 .1rem .15rem rgba(0, 0, 0, .3));
    animation: tutorial-browser-permission-up .9s ease-in-out infinite;
    pointer-events: none;
}

.tutorial-widget[data-tutorial-placement="browser-top-left"][data-tutorial-on-page="true"][data-tutorial-browser="firefox"] .tutorial-browser-permission-indicator {
    left: calc(1.25rem + 233px);
}

.tutorial-widget-pending {
    visibility: hidden;
}

.tutorial-widget-anchored {
    right: auto;
    bottom: auto;
}

.tutorial-widget-minimized {
    width: auto;
    min-width: 10rem;
}

.tutorial-widget-accent {
    height: .25rem;
    background: var(--bs-primary);
    border-radius: .5rem .5rem 0 0;
}

.tutorial-scroll-indicator {
    position: absolute;
    left: 50%;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

.tutorial-scroll-icon {
    color: var(--bs-primary);
    font-size: 1.35rem;
    filter: drop-shadow(0 .1rem .15rem rgba(0, 0, 0, .3));
}

.tutorial-scroll-label {
    color: var(--bs-body-color);
    font-size: .75rem;
    font-weight: 600;
    text-shadow:
        0 0 .18rem var(--bs-body-bg),
        0 0 .18rem var(--bs-body-bg),
        0 .1rem .15rem rgba(0, 0, 0, .3);
}

.tutorial-target-above .tutorial-scroll-indicator {
    top: -2.1rem;
}

.tutorial-target-below .tutorial-scroll-indicator {
    bottom: -2.1rem;
}

.tutorial-target-above .tutorial-scroll-icon {
    animation: tutorial-scroll-up .9s ease-in-out infinite;
}

.tutorial-target-below .tutorial-scroll-icon {
    order: 2;
    animation: tutorial-scroll-down .9s ease-in-out infinite;
}

.tutorial-widget-body {
    padding: 1rem;
}

.tutorial-widget-minimized .tutorial-widget-body {
    padding: .75rem 1rem;
}

.tutorial-widget-minimized .tutorial-widget-header {
    margin-bottom: 0 !important;
}

.tutorial-widget-minimized .tutorial-auto-narration-control {
    display: none;
}

.tutorial-widget-minimized .tutorial-browser-permission-indicator {
    display: none !important;
}

.tutorial-widget-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    text-decoration: none;
}

.tutorial-narration-toggle[aria-pressed="true"] {
    color: var(--bs-primary) !important;
}

.tutorial-auto-narration-control {
    font-size: .75rem;
    white-space: nowrap;
}

.tutorial-message {
    white-space: pre-line;
}

.tutorial-widget-scroll-prompt [data-tutorial-acknowledge-form],
.tutorial-widget-scroll-prompt [data-tutorial-complete-form] {
    display: none !important;
}

.tutorial-target-active {
    position: relative;
    z-index: 1045;
    outline: .25rem solid color-mix(in srgb, var(--bs-primary) 45%, transparent);
    outline-offset: .3rem;
    border-radius: .25rem;
    animation: tutorial-target-pulse 1.8s ease-in-out infinite;
}

.tutorial-invitation {
    background: color-mix(in srgb, var(--bs-primary) 7%, var(--bs-body-bg));
}

.tutorial-invitation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--bs-primary);
    background: color-mix(in srgb, var(--bs-primary) 14%, transparent);
    border-radius: 50%;
}

@keyframes tutorial-target-pulse {
    50% { outline-color: color-mix(in srgb, var(--bs-primary) 75%, transparent); }
}

@keyframes tutorial-scroll-up {
    50% { opacity: .35; transform: translateY(-.35rem); }
}

@keyframes tutorial-scroll-down {
    50% { opacity: .35; transform: translateY(.35rem); }
}

@keyframes tutorial-browser-permission-up {
    50% { opacity: .4; transform: translateY(-.35rem); }
}

@media (prefers-reduced-motion: reduce) {
    .tutorial-target-active { animation: none; }
    .tutorial-scroll-icon { animation: none !important; }
    .tutorial-browser-permission-indicator { animation: none !important; }
    .tutorial-widget { transition: none; }
}

@media (max-width: 767.98px) {
    .tutorial-widget:not(.tutorial-widget-modal-target),
    .tutorial-widget-anchored:not(.tutorial-widget-modal-target) {
        left: 1rem !important;
        right: 1rem;
        top: auto !important;
        bottom: 1rem;
        width: auto;
    }

    .tutorial-widget.tutorial-target-below {
        bottom: 3.25rem;
    }

    .tutorial-widget[data-tutorial-placement="top"][data-tutorial-target="[data-torrent-search-query]"],
    .tutorial-widget[data-tutorial-placement="top"][data-tutorial-target="[data-torrent-search-submit]"] {
        top: 1rem !important;
        bottom: auto;
    }

    .tutorial-widget.tutorial-widget-minimized {
        left: auto !important;
        right: 1rem;
        top: auto !important;
        bottom: 1rem;
        width: auto;
    }

    .tutorial-widget[data-tutorial-placement="browser-top-left"][data-tutorial-on-page="true"] {
        left: 1rem !important;
        right: 1rem;
        top: 1rem !important;
        bottom: auto;
        width: auto;
    }

    .tutorial-widget[data-tutorial-placement="browser-top-left"][data-tutorial-on-page="true"] .tutorial-browser-permission-indicator {
        display: none;
    }

    .tutorial-widget[data-tutorial-placement="browser-top-left"][data-tutorial-on-page="true"] .tutorial-widget-body {
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .tutorial-widget[data-tutorial-placement="browser-top-left"][data-tutorial-on-page="true"].tutorial-widget-minimized {
        left: auto !important;
        right: 1rem;
        top: auto !important;
        bottom: 1rem;
        width: auto;
    }
}

@media (max-width: 575.98px) {
    .public-home {
        min-height: calc(100vh - 4.5rem);
        padding: 3rem 0 6rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-stat {
        min-height: 6.5rem;
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
    }

    .dashboard-stat:last-child {
        border-bottom: 0;
    }

    .dashboard-list-row {
        grid-template-columns: auto minmax(0, 1fr) 1rem;
    }

    .dashboard-list-meta {
        grid-column: 2;
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .dashboard-list-row > .collection-poster {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .dashboard-list-chevron {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .collection-poster--header {
        --collection-poster-width: 3rem;
    }

    .collection-poster--detail {
        --collection-poster-width: 7rem;
    }

    .collection-page-heading,
    .collection-table-identity {
        gap: 0.75rem;
    }

    .collection-metadata-summary {
        flex-direction: column;
        align-items: center;
    }

    .user-profile-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .collection-metadata-summary-copy {
        width: 100%;
    }

    .omdb-details-intro,
    .omdb-facts {
        grid-template-columns: 1fr;
    }

    .omdb-details-intro {
        gap: 1.5rem;
    }

    .omdb-scores {
        grid-template-columns: 1fr;
    }

    .omdb-score {
        border-right: 0;
        border-bottom: 1px solid var(--app-border);
    }

    .omdb-score:last-child {
        border-bottom: 0;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .omdb-details-intro {
        grid-template-columns: minmax(0, 1fr) minmax(12rem, 0.55fr);
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-stat:nth-child(2) {
        border-right: 0;
    }

    .dashboard-stat:nth-child(-n + 2) {
        border-bottom: 1px solid var(--app-border);
    }

    .help-flow {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .help-flow-step:nth-child(3) {
        border-right: 0;
    }

    .help-flow-step:nth-child(-n + 3) {
        border-bottom: 1px solid var(--app-border);
    }
}

.torrent-search-name {
    min-width: 20rem;
    max-width: 34rem;
}

.jellyfin-download-name {
    flex: 1 1 auto;
    min-width: 0;
}

.jellyfin-promotion-file-facts dt,
.jellyfin-promotion-file-facts dd {
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
}

.jellyfin-stream-table {
    font-size: 0.8125rem;
}

.jellyfin-stream-table th,
.jellyfin-stream-table td {
    padding: 0.35rem 0.45rem;
    white-space: nowrap;
}

.jellyfin-stream-table td:last-child {
    width: 100%;
    white-space: normal;
}

@media (min-width: 992px) {
    .jellyfin-promotion-metadata-column {
        padding-right: 1.5rem;
        border-right: 1px solid var(--app-border);
    }
}

.jellyfin-image-preview-frame {
    display: flex;
    min-height: 12rem;
    align-items: center;
    justify-content: center;
}

.jellyfin-image-preview {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 65vh;
    object-fit: contain;
}

.jellyfin-video-preview-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.jellyfin-video-preview-loading {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #fff;
}

.jellyfin-video-preview-frame [data-video-preview],
.jellyfin-video-preview-frame .video-js {
    width: 100%;
    height: 100%;
    visibility: hidden;
}

.video-preview-ready .jellyfin-video-preview-loading {
    display: none;
}

.video-preview-ready .jellyfin-video-preview-frame [data-video-preview],
.video-preview-ready .jellyfin-video-preview-frame .video-js {
    visibility: visible;
}

.jellyfin-video-preview-native {
    display: block;
    object-fit: contain;
}

.section-collapse-toggle {
    display: inline-flex;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.section-collapse-toggle .fa-chevron-up {
    transition: transform 0.2s ease;
}

.section-collapse-toggle.collapsed .fa-chevron-up {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .help-flow-step,
    .section-collapse-toggle .fa-chevron-up {
        transition: none;
    }
}

@media (max-width: 575.98px) {
    .help-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .help-flow-step {
        border-bottom: 1px solid var(--app-border);
    }

    .help-flow-step:nth-child(even) {
        border-right: 0;
    }

    .help-flow-step:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .help-section {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 3rem 0;
    }

    .help-section-aside {
        align-items: center;
        flex-direction: row;
    }

    .help-section-lead {
        font-size: 1rem;
    }
}
