/* Compact topic editors use a single border as their focus indicator. */
.topic-input:focus,
.topic-input:focus-visible,
.topic-edit-input:focus,
.topic-edit-input:focus-visible {
    border-color: var(--color-link);
    box-shadow: none;
    outline: none;
}

/* While renaming, the input stands in for the chip so the chip's fill and padding don't frame it. */
.topic-tag:has(> .topic-edit-input) {
    padding: 0;
    background: transparent;
    border-color: transparent;
}

.topic-input {
    box-sizing: border-box;
    height: 26px;
}

.topic-tag > .topic-edit-input {
    box-sizing: border-box;
    height: 100%;
    padding: 0 0.6em;
    border-radius: 12px;
    font-size: inherit;
}

/* Chip buttons inherit the body line-height via font: inherit; keep them to the glyph height. */
.topic-tag button {
    line-height: 1;
}

/* Run chip: the selected topic's live loop and its controls. */
.loop-run-chip {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin: 0.25em 0;
    padding: 2px 8px;
    border: 1px solid var(--color-border, currentcolor);
    border-radius: var(--radius-round, 999px);
    font-size: 0.85em;
}

.loop-run-chip[hidden],
.loop-run-chip-action[hidden] {
    display: none;
}

.loop-run-chip[data-state="running"] .loop-run-chip-status,
.loop-run-chip[data-state="pending_verification"] .loop-run-chip-status {
    color: var(--color-active);
}

.loop-run-chip-detail {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--text-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loop-run-chip-actions {
    display: inline-flex;
    flex: none;
    gap: 2px;
}

.loop-run-chip-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
}

.loop-run-chip-icon {
    width: 1em;
    height: 1em;
}
