/* Glitch setup: word filters and source */
.glitch-words {
    margin: 20px 0;
    text-align: left;
}

.glitch-words h3 {
    margin-bottom: 10px;
}

.glitch-words-categories {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0 0 14px;
    min-width: 0;
}

.glitch-words-categories legend {
    font-weight: 600;
    padding: 0 6px;
}

.glitch-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px 12px;
}

.glitch-words-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    cursor: pointer;
}

.glitch-words-check input {
    width: 20px;
    height: 20px;
    flex: none;
}

.glitch-words-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.glitch-words-row label {
    font-weight: 600;
    flex: 1 1 100%;
}

.glitch-words-row select {
    flex: 1 1 160px;
    min-height: 44px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    min-width: 0;
}

.glitch-words-row .btn-secondary {
    flex: 0 0 auto;
    min-height: 44px;
}

.glitch-words-row .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.glitch-words-count {
    min-height: 1.4em;
    font-weight: 600;
}

/* G1: word options folded behind a one-line summary. */
.glitch-words-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    min-height: 44px;
    padding: 8px 0;
    cursor: pointer;
    list-style: none;
}

.glitch-words-summary::-webkit-details-marker {
    display: none;
}

.glitch-words-summary h3 {
    margin: 0;
}

.glitch-words-chosen {
    flex: 1 1 200px;
    color: #333333;
}

.glitch-words-change {
    font-weight: 600;
    text-decoration: underline;
}

.glitch-words-details[open] .glitch-words-change {
    display: none;
}
