/* Raid assignments of a boss: free text, the names of the composition's characters are dressed as characters */
.composition-assignments {
    margin: 0 1rem 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-input-faint);
    border: 1px solid var(--border-primary-faint);
    border-radius: var(--r, 8px);
}

.assignments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.assignments-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.assignments-view {
    color: var(--text-primary);
}

.assignment-line {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    min-height: 1.5rem;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-primary-faint);
}

.assignment-line:last-child {
    border-bottom: none;
}

.assignment-line:has(> .assignment-values:empty) {
    min-height: 0.5rem;
    padding: 0;
    border-bottom: none;
}

/* A line without a label: the text takes the whole row */
.assignment-line > .assignment-values:only-child {
    grid-column: 1 / -1;
}

.assignment-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-gold, #e3a94a);
}

.assignment-values {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-primary);
}

.assignment-char {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.5rem;
    font-weight: 600;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-primary-faint);
    border-radius: var(--r, 4px);
    white-space: nowrap;
}

.assignment-char--mine {
    border-color: var(--color-gold, #e3a94a);
}

/* Sections: a title above the lines of each one */
.assignments-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.assignment-section {
    padding: 0.6rem 1rem 0.75rem;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-primary-faint);
    border-radius: var(--r, 8px);
}

.assignment-section-title {
    margin: 0 -1rem 0.4rem;
    padding: 0 1rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-primary);
}

.assignment-edit-section {
    padding: 0.75rem;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-primary-faint);
    border-radius: var(--r, 8px);
}

.assignment-edit-section {
    margin-bottom: 0.75rem;
}

.assignment-edit-head {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.assignment-edit-title {
    flex: 1;
}

.assignment-edit-tools {
    display: flex;
    gap: 0.25rem;
}

.assignments-input {
    width: 100%;
    resize: vertical;
    font-family: inherit;
}

.assignments-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.assignments-actions .filter-custom-select--assignments-copy {
    width: auto;
    min-width: 260px;
}

/* The select sits at the bottom of the composition card (overflow hidden): its menu opens upward */
.filter-custom-select--assignments-copy .filter-custom-select__menu {
    top: auto;
    bottom: calc(100% + 0.3rem);
}

/* "@" autocomplete of the characters */
.assignments-autocomplete {
    position: fixed;
    z-index: 1100;
    min-width: 220px;
    max-width: 340px;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.3rem;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r, 8px);
    box-shadow: 0 14px 30px color-mix(in srgb, #000 26%, transparent);
}

.assignments-autocomplete__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--r, 4px);
    cursor: pointer;
}

.assignments-autocomplete__item:hover,
.assignments-autocomplete__item.is-active {
    background: var(--bg-input-faint);
}

.assignments-autocomplete__name {
    font-weight: 600;
}

.assignments-autocomplete__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
