.thr-select-group {
    position: relative;
    background: var(--bg-app);
    border-radius: var(--radius-sm);
    height: 56px;
    border: 1px solid transparent;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.thr-select-group:focus-within {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.thr-select-group label {
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.thr-select-group select {
    width: 100%;
    height: 100%;
    border: none;
    background: none;
    padding: 22px 36px 4px 12px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text-main);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.thr-select-group select:focus {
    outline: none;
}

.thr-select-group::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 14px;
}

.thr-custom-fields {
    display: none;
    gap: 12px;
    margin-top: 12px;
}

.thr-unit-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.thr-unit-toggle button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.thr-unit-toggle button:active {
    transform: scale(0.95);
}

.thr-tol-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.thr-tol-grid .res-row {
    flex-direction: column;
    gap: 2px;
}

.thr-section-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-top: 12px;
    margin-bottom: 4px;
}

#view-thread .canvas-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    border-bottom: 1px solid var(--border);
}

#thrSvg {
    width: 100%;
    height: 100%;
    max-height: 50vh;
}
