/* Tag chips. Colours come from the tag text at runtime (static/js/tags.js),
   so nothing here sets one. */
.kg-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.55rem;
    margin: 0.1rem 0.2rem 0.1rem 0;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kg-tag.is-clickable { cursor: pointer; }

.kg-tag.is-clickable:hover,
.kg-tag.is-clickable:focus-visible {
    filter: brightness(0.95);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

/* The filter bar greys out the tags not currently chosen. */
.kg-tag.is-muted { opacity: 0.45; }

.kg-tag-x {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
}

.kg-tag-x:hover { opacity: 1; }

.kg-tag-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.1rem;
}

/* The "+ tag" control sits inline with the chips and stays small until used.
   nowrap matters more than it looks: in a narrow table cell the two words
   wrapped onto separate lines and the pill turned into a dashed circle. */
.kg-tag-add {
    padding: 0.1rem 0.6rem;
    border: 1px dashed #adb5bd;
    border-radius: 999px;
    background: none;
    color: #6c757d;
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
}

.kg-tag-add:hover { border-color: #6c757d; color: #495057; }

.kg-tag-input {
    width: 9rem;
    padding: 0.05rem 0.5rem;
    border: 1px solid #adb5bd;
    border-radius: 999px;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.kg-tag-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
}

.kg-tag-filter-label {
    margin-right: 0.25rem;
    color: #6c757d;
    font-size: 0.8125rem;
}

/* A table cell holding tags needs a floor on its width. Left to itself the
   column shrinks to the width of the word "Tags" in the header, which is
   narrower than a single chip. */
.kg-tag-cell {
    min-width: 13rem;
}

/* Tags and the editor beneath a list on the ReelReads page itself. */
.rr-save-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
}
