body {
    background: #111;
    color: white;
    user-select: none;
    font-family: sans-serif;
    display: grid;
    grid-template-rows: 1fr auto;
    height: 100dvh;
    margin: 0;
    padding: .5rem;
    box-sizing: border-box;
    gap: .5rem;
}

main {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-height: 100%;
    overflow: auto;
}

.item-wrapper {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    
    fieldset {
        padding: 0;
        border: none;
        border-top: solid 2px #888;
    }
    
    legend {
        margin: auto;
        padding: 0 .5rem;
        display: flex;
        align-items: center;
        gap: .5rem;
    }
}

.item-container {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    position: relative;
    
    .item {
        display: grid;
        grid-template-columns: 3rem 1fr 3rem;
        align-items: center;
        min-height: 3.25rem;
        padding: 0 .7rem;
        border-radius: 1rem;
        background: #333;
        border: 1px solid rgba(255, 255, 255, .06);
    }
    
    .date {
        justify-self: start;
        opacity: .9;
        font-size: .9rem;
    }

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

    .drag-handle {
        justify-self: end;
        width: 2rem;
        height: 2rem;
        display: grid;
        place-items: center;
        touch-action: none;
    }

    .drag-handle svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.item.dragging {
    display: grid;
    grid-template-columns: 3rem 1fr 3rem;
    align-items: center;
    box-sizing: border-box;
    padding: 0 .7rem;
    min-height: 3.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, .1);
    opacity: 0.98;
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    box-shadow: 0 22px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .12);
    transform: scale(1.02);
    background: linear-gradient(135deg, #444, #2f2f2f);
}

.item.dragging .date {
    justify-self: start;
    opacity: .9;
    font-size: .9rem;
}

.item.dragging .name {
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item.dragging .drag-handle {
    justify-self: end;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
}

.item.dragging .drag-handle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.drop-placeholder {
    min-height: 3.25rem;
    border: 2px dashed #5f5f5f;
    border-radius: 1rem;
    background: rgba(255, 255, 255, .04);
    box-sizing: border-box;
    width: 100%;
}

.drag-handle.hidden {
    visibility: hidden;
    pointer-events: none;
}

.item-container {
    .drop-placeholder {
        margin: 0;
    }
}

.add-btn {
    border: none;
    background: #07a;
    color: white;
    border-radius: 50%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    width: 3rem;
    margin: 0 auto;
    
    svg {
        width: 2rem;
        height: 2rem;
    }
}

.contextmenu {
    display: none;
    background: #1e1e1e;
    padding: .6rem;
    border-radius: .7rem;
    flex-direction: column;
    gap: .4rem;
    position: fixed;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    width: 80%;
    
    &.open {
        display: flex;
    }

    button, & > div {
        background: #2a2a2a;
        padding: .9rem;
        border-radius: .7rem;
        border: none;
        color: #eee;
        font-size: 1.1rem;
        transition: .2s;
    }

    button:active {
        background: #444;
    }
    
    &>div {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    input {
        padding: .5rem;
        background: #444;
        border-radius: .5rem;
        color: white;
        border: none;
        width: 50%;
        
        &:focus {
            outline: none;
        }
    }
}
