/* WebTags tag input (TagInput). Colors match the WebEditor (DdtTheme tokens). */
.wt-input {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 5px 8px;
    border: 1px solid var(--ddt-border-strong);
    border-radius: var(--ddt-radius);
    background: var(--ddt-surface);
    color: var(--ddt-text);
    font-family: var(--ddt-font);
    font-size: 14px;
    cursor: text;
}

.wt-input.wt-focused {
    border-color: var(--ddt-accent);
    box-shadow: 0 0 0 3px rgba(var(--ddt-focus-rgb), 0.18);
}

.wt-input.wt-disabled {
    background: var(--ddt-surface-muted);
    cursor: default;
}

.wt-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    max-width: 100%;
    padding: 2px 4px 2px 10px;
    border: 1px solid var(--ddt-accent-border);
    border-radius: 999px;
    background: var(--ddt-accent-subtle);
    color: var(--ddt-text);
    font-weight: 600;
    line-height: 1.5;
}

.wt-disabled .wt-chip {
    padding-right: 10px;
}

.wt-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wt-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ddt-text-muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.wt-chip-remove:hover {
    background: var(--ddt-danger-bg);
    color: var(--ddt-danger);
}

/* Two classes, so that the host's global input styles (border, padding, width, focus outline) do not reach the field. */
.wt-input .wt-text,
.wt-input .wt-text:focus {
    flex: 1 1 120px;
    width: auto;
    min-width: 120px;
    margin: 0;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
    color: var(--ddt-text);
    font: inherit;
}

.wt-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 320px;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--ddt-border);
    border-radius: var(--ddt-radius);
    background: var(--ddt-surface-raised);
    box-shadow: 0 8px 24px rgba(var(--ddt-shadow-rgb), 0.16);
}

.wt-suggestion {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px;
    border-radius: var(--ddt-radius-sm);
    cursor: pointer;
}

.wt-suggestion.wt-active {
    background: var(--ddt-accent-soft);
}

.wt-name mark {
    padding: 0;
    background: transparent;
    color: var(--ddt-accent-strong);
    font-weight: 700;
}

.wt-count {
    flex: none;
    color: var(--ddt-text-subtle);
    font-size: 12px;
}

.wt-new .wt-count {
    color: var(--ddt-success-text);
    font-weight: 600;
}
