.entity-favorites-widget {
    position: relative;
    display: inline-flex;
    color: inherit;
}

.entity-favorites-trigger,
.entity-favorites-close,
.entity-favorites-item-remove,
.entity-favorite-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.entity-favorites-trigger {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 8px;
}

.entity-favorites-trigger-icon,
.entity-favorite-toggle-icon {
    display: inline-flex;
}

.entity-favorites-count {
    position: absolute;
    right: 1px;
    bottom: 1px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 8px;
    background: currentColor;
    color: var(--mc-theme-color-paper, #fff);
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}

.entity-favorites-display-icon .entity-favorites-count {
    display: none;
}

.entity-favorites-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 32%);
}

.entity-favorites-dialog {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1200;
    width: min(440px, 92vw);
    height: 100dvh;
    overflow-y: auto;
    padding: 28px;
    background: var(--mc-theme-color-paper, #fff);
    color: var(--mc-theme-color-ink, #151515);
    box-shadow: -12px 0 40px rgb(0 0 0 / 12%);
}

.entity-favorites-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.entity-favorites-dialog-title {
    font-size: 24px;
    font-weight: 600;
}

.entity-favorites-close {
    width: 40px;
    height: 40px;
}

.entity-favorites-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.entity-favorites-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 12px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}

.entity-favorites-item-content {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.entity-favorites-item-image {
    width: 72px;
    height: 72px;
    object-fit: cover;
}

.entity-favorites-item-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.entity-favorites-item-title {
    font-weight: 600;
}

.entity-favorites-item-description {
    overflow: hidden;
    color: color-mix(in srgb, currentColor 62%, transparent);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-favorites-item-remove {
    width: 40px;
    height: 40px;
    font-size: 20px;
}

.entity-favorites-empty {
    margin: 32px 0 0;
}

.entity-grid-item,
.entity-list-item,
.combined-entity-list-table td {
    position: relative;
}

.entity-favorite-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 4;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: rgb(255 255 255 / 88%);
}

.entity-favorite-toggle.is-favorite svg path {
    fill: currentColor;
}

.entity-favorite-toggle:focus-visible,
.entity-favorites-trigger:focus-visible,
.entity-favorites-close:focus-visible,
.entity-favorites-item-remove:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.entity-favorites-widget [hidden] {
    display: none !important;
}
