#structures {
    text-align: center;
    margin: 1rem auto;
    position: relative;
    max-width: 400px;
}

#twoD-viewer {
    min-height: 250px;
}

#rdkit-loader-text {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Legend — overlaid on the bottom of the molecule drawing */
#fg-legend {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.85);
    padding: 3px 10px;
    border-radius: 6px;
    z-index: 2;
}

.fg-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: #495057;
}

.fg-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.15);
}

/* Answer pill rows */
#answer-rows {
    max-width: 560px;
    margin: 1rem auto 1.5rem;
}

.pill-row {
    margin-bottom: 10px;
    max-height: 80px;
    overflow: hidden;
    transition: max-height 0.25s ease, margin-bottom 0.25s ease, opacity 0.25s ease;
    opacity: 1;
}

.pill-row.row-hidden {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
}

.row-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    padding: 6px 14px;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
    user-select: none;
    background: #fff;
}

.pill:hover {
    border-color: #6153cc;
}

.pill.selected {
    background: #f0eeff;
    border-color: #6153cc;
    font-weight: 600;
}

.pill.correct {
    background: #d4edda;
    border-color: #28a745;
}

.pill.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
}

.pill.missed {
    background: #fff3cd;
    border-color: #ffc107;
}

.pill.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Controls */
#primary-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
}
